1

Due to unknown reason(s), the package manager in my Emacs 25.3 cannot refresh properly anymore: whenever I try to do M-x list-packages it throws an error:

error in process filter: package-read-archive-contents: Wrong type argument: listp, <!DOCTYPE

And when I debug it using emacs --debug-init, it shows:

Debugger entered--Lisp error: (wrong-type-argument listp <!DOCTYPE)
  package--read-archive-file("archives/sc/archive-contents")
  package-read-archive-contents("sc")
  package-read-all-archive-contents()
  package-initialize()
  eval-buffer(#<buffer  *load*> nil "/Users/cya/.emacs" nil t)  ; Reading at buffer position 917
  load-with-code-conversion("/Users/cya/.emacs" "/Users/cya/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\266 \306=\203\307\310Q\202? \311=\204\307\312Q\202?\313\307\314\315#\203*\316\202?\313\307\314\317#\203>\320\321\322!D\nB\323\202?\316\324\325\324\211#\210\324=\203e\326\327\330\307\331Q!\"\325\324\211#\210\324=\203d\210\203\247\332!\333\232\203\247\334!\211\335P\336!\203\201\211\202\214\336!\203\213\202\214\314\262\203\245\337\"\203\243\340\341#\210\342\343!\210\266\f?\205\264\314\325\344\324\211#)\262\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" initialization format-message "`_emacs' init file is deprecated, please use `.emacs'" "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7]()
  command-line()
  normal-top-level()

So apparently the error is associated with archives/sc/archive-contents file, and according to this question, deleting the file should fix the problem when Emacs refreshes the packages again. Unfortunately deleting it and refresh the packages bring back the same error error in process filter: package-read-archive-contents: Wrong type argument: listp, &lt;!DOCTYPE

And going into the archives/sc/archive-contents file, it seems to show a lot of irrelevant stuff, e.g.

<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><script type="text/javascript">/* <![CDATA[ */
accConf = {"events":{"endpointPaths":["/a8f4d8cd95e164917035b64b867a45dd"]}};
/* ]]> */</script>
 <meta name="msapplication-starturl" content="https://www.onet.pl/"/> <meta name="msapplication-task" content="name=Wiadomości;action-uri=http://wiadomosci.onet.pl/;icon-uri=https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn2.ico"/> <meta name="msapplication-task" content="name=Biznes;action-uri=http://biznes.onet.pl/;icon-uri=https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn.ico"/> <meta name="msapplication-task" content="name=Sport;action-uri=http://sport.onet.pl/;icon-uri=https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn.ico"/> <meta name="msapplication-task" content="name=Film;action-uri=http://film.onet.pl/;icon-uri=https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn.ico"/> <meta name="msapplication-task" content="name=Muzyka;action-uri=http://muzyka.onet.pl/;icon-uri=https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn.ico"/> <meta name="msapplication-task" content="name=VOD;action-uri=https://vod.pl/;icon-uri=https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn.ico"/> <meta name="description" content="Onet: codzienne źródło informacji milionów Polaków - wiadomości z kraju i ze świata 24/7, pogoda, sport, biznes, moto, rozrywka. Bądź na bieżąco z Onet!"/> <meta property="og:image" content="https://ocdn.eu/images/pulscms/OWU7MDA_/20ec3038d7c7d1637e04da3395de954d.png">  <meta name="referrer" content="origin"> <meta name="staticr-list" content="https://www.onet.pl/staticurls.txt"> <meta name="viewport" content="width=1024"> <!-- config vars --> <meta name="onet-appconfig" data-config='{"variantName":"www.onet.pl::HTTPS_PROD1","pipisenabled":0,"recommender":3}'> <!-- // config vars -->  <meta name="onet-sgexpconfig" data-expenabled='1'> <meta name="onet-o24editor" data-autoplay='1'>  <!-- // yt boo config -->   <meta name="onet-o24it" data-autoplay="100">   <meta name="dreamlab-test" data-percentvalue="0">   <meta name="onet-push" data-percentvalue="100">  <title>Onet – Jesteś na bieżąco</title>   <link rel="manifest" href="/manifest.json" /> <link rel="canonical" href="https://www.onet.pl" /> <link rel="alternate" media="only screen and (max-width: 768px)" href="https://m.onet.pl" /> <link rel="dns-prefetch" href="https://ocdn.eu" /> <link rel="dns-prefetch" href="https://lib.onet.pl" /> <link rel="dns-prefetch" href="https://csr.onet.pl" /> <link rel="dns-prefetch" href="https://kropka.onet.pl" /> <link rel="dns-prefetch" href="https://google-analytics.com" /> <link rel="dns-prefetch" href="https://securepubads.g.doubleclick.net" /> <link rel="dns-prefetch" href="https://fonts.googleapis.com" /> <link rel="dns-prefetch" href="https://fonts.gstatic.com" /> <link rel="shortcut icon" href="https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/faviconn.ico" type="image/x-icon" /> <!--^M
        <link href="https://ocdn.eu/paas-static/template-engine/5fd508316edf96eb0c840a8116572c42/build/nsg2017.css" type="text/css" rel="stylesheet" /> --> <style type="text/css"> @font-face {font-family: 'Fira Sans'; font-style: normal; font-weight: 400; src: local('Fira Sans Regular'), local('FiraSans-Regular'), url(https://ocdn.eu/onetmobilemainpage/firafonts/p05/FiraSans-Regular.woff) format('woff');}^M
            @font-face {font-family: 'Fira Sans'; font-style: normal; font-weight: 500; src: local('Fira Sans Medium'), local('FiraSans-Medium'), url(https://ocdn.eu/onetmobilemainpage/firafonts/p05/FiraSans-Medium.woff) format('woff');}^M

Any suggestion what may cause the error and how to fix it?

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.