Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to download `melpa' archive. #2139

Closed
nevetS opened this issue Nov 5, 2014 · 28 comments
Closed

Failed to download `melpa' archive. #2139

nevetS opened this issue Nov 5, 2014 · 28 comments

Comments

@nevetS
Copy link

@nevetS nevetS commented Nov 5, 2014

with the following line enabled in my init.el, I receive the message:
Failed to download `melpa' archive.

(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages") t)

I can download the package list and install packages from melpa-stable.

@nevetS
Copy link
Author

@nevetS nevetS commented Nov 5, 2014

Update. I discovered the problem, and this particular bug report was helpful in finding the solution. toggle-debug-on-error is very helpful. http://melpa.org/packages vs. http://melpa.org/packages/

It would be nice if emacs was more forgiving in this regard.

@purcell
Copy link
Member

@purcell purcell commented Nov 5, 2014

Aha! Glad you tracked it down.

@purcell purcell closed this Nov 5, 2014
@milkypostman
Copy link
Member

@milkypostman milkypostman commented Nov 5, 2014

That is a bit odd.
On Wed, Nov 5, 2014 at 02:16 Steve Purcell notifications@github.com wrote:

Closed #2139 #2139.


Reply to this email directly or view it on GitHub
#2139 (comment).

@purcell
Copy link
Member

@purcell purcell commented Nov 5, 2014

I presume package.el uses url-expand-file-name, which I imagine behaves similarly to expand-file-name when there's no trailing /.

@s-kostyaev
Copy link
Contributor

@s-kostyaev s-kostyaev commented May 4, 2016

I have the same issue just now.

@mfine
Copy link

@mfine mfine commented May 4, 2016

@s-kostyaev seeing the same issue, too. Can't get the debugger to kick in, but have these messages:

Contacting host: melpa.org:80
Failed to download `melpa' archive.

No idea what the archive is supposed to look like - but this is showing up empty?

$ curl -i http://melpa.org/packages/archive-contents 
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 May 2016 06:29:09 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Connection: keep-alive
Last-Modified: Wed, 04 May 2016 05:38:10 GMT
ETag: "57298ac2-0"
Accept-Ranges: bytes

Is that right? Compare with:

$ curl --silent -i http://elpa.gnu.org/packages/archive-contents | head -20
HTTP/1.1 200 OK
Date: Wed, 04 May 2016 06:37:48 GMT
Server: Apache/2.4.10 (Debian)
Last-Modified: Tue, 03 May 2016 21:03:59 GMT
ETag: "6d01-531f672b2ac6c"
Accept-Ranges: bytes
Content-Length: 27905

(1
 (ace-window .
         [(0 9 0)
          ((avy
        (0 2 0)))
          "Quickly switch windows." single
          ((:url . "https://github.com/abo-abo/ace-window")
           (:keywords "window" "location"))])
 (ack .
      [(1 5)
       nil "interface to ack-like tools" tar
       ((:keywords "tools" "processes" "convenience")
(23) Failed writing body
@douglarek
Copy link

@douglarek douglarek commented May 4, 2016

@mfine same error too

@Geod24
Copy link

@Geod24 Geod24 commented May 4, 2016

I also had the same issues when I tried a couple of hours ago.
Couldn't use melpa but melpa-stable worked fine.

@eldamir
Copy link

@eldamir eldamir commented May 4, 2016

Installed fresh Ubuntu 16.04 yesterday. Nightly build of GNU emacs 25.1.50.2 and installed emacs through the quick install (cloning repo into ~/.emacs.d).

It worked fine yesterday. Today, nothing has changed in my emacs version, the spacemacs version or anything else, but I get the error described in this thread. Something gone wrong the the melpa archive?

@eldamir
Copy link

@eldamir eldamir commented May 4, 2016

UPDATE

Ran apt-get upgrade and found that there were patches to libssl1.0.0 and openssl.

Now it works

@douglarek
Copy link

@douglarek douglarek commented May 4, 2016

@eldamir maybe, I upgraded openssl(1.0.2h) though homebrew(osx) today.

@mfine
Copy link

@mfine mfine commented May 4, 2016

Looks like it's back up:

$ ➜  ~  curl -i http://melpa.org/packages/archive-contents 
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 May 2016 07:29:26 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 511433
Connection: keep-alive
Vary: Accept-Encoding
Last-Modified: Wed, 04 May 2016 07:28:47 GMT
ETag: "5729a4af-7cdc9"
Accept-Ranges: bytes


(1 (zzz-to-char . [(20160122 440) ((emacs (24 4)) (cl-lib (0 5)) (avy (0 3 0))) "Fancy version of `zap-to-char' command" single ((:url . "https://github.com/mrkkrp/zzz-to-char") (:keywords "convenience"))]) (zygospore . [(20140703 152) nil "reversible C-x 1 (delete-other-windows)" single ((:url . "https://github.com/louiskottmann/zygospore.el"))]) (ztree . [(20160127 1542) ((cl-lib (0))) "Text mode directory tree" tar ((:url . "https://github.com/fourier/ztree") (:keywords "files" "tools"))]) (zotxt . [(20160427 1922) ((request-deferred (0 2 0))) "Tools to integrate emacs with Zotero via the zotxt plugin." tar nil]) (zotelo . [(20160118 2045) ((cl-lib (0 5))) "Manage Zotero collections from emacs" single ((:url . "https://github.com/vitoshka/zotelo") (:keywords "zotero" "emacs" "reftex" "bibtex" "mozrepl" "bibliography manager"))]) (zossima . [(20121123 1635) ((inf-ruby (2 2 3))) "Ruby from Emacs" tar 
@milkypostman
Copy link
Member

@milkypostman milkypostman commented May 4, 2016

sorry for the downtime. the server is doing a full rebuild. i suspect that the issue with archive-contents may have been related to our server running low on disk space.

will spend some time soon working on making the maintenance more automated.

@purcell
Copy link
Member

@purcell purcell commented May 4, 2016

@milkypostman Thanks for sorting that out. Maybe we should put monit on the build servers and have it alert us when a certain threshold of disk usage is exceeded?

@lascott
Copy link

@lascott lascott commented May 24, 2016

@milkypostman Same issue yesterday and today. Any thoughts welcomed. Thanks

@purcell
Copy link
Member

@purcell purcell commented May 24, 2016

@lascott This particular error message is generally not a problem with MELPA, but rather can result from a number of problems with your Emacs setup, most commonly with proxy settings or SSL setup (e.g. openssl version, gnutls). Please check out #3914, which is a more recent ticket about the same error message, and try some of the tests there in order to debug the issue on your machine.

@bd339
Copy link

@bd339 bd339 commented Aug 11, 2016

Had this problem today in Windows 10 (...yeah, I know...) and folks having to update their ssl libraries gave me the idea of having Emacs connect to http://melpa.org/packages/ instead of https://melpa.org/packages/. It works, it's of course also not ideal, but I don't know what else to do in Windows...

@achikin
Copy link

@achikin achikin commented Apr 27, 2018

I see this right now. I'm trying to install use-package and following the instructions on their page. https://jwiegley.github.io/use-package/installation/

 Then add one of the archives to package-archives:

To use Melpa:
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
To use Melpa-Stable:
(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)
Once you have added your preferred archive, you need to update the local package list using:

M-x package-refresh-contents RET

I can open 'https://melpa.org/packages/' and 'https://melpa.org/packages/archive-contents' in my browser.

@milkypostman
Copy link
Member

@milkypostman milkypostman commented Apr 27, 2018

@achikin it would help if we knew what the error you’re seeing is.

@purcell
Copy link
Member

@purcell purcell commented Apr 27, 2018

@achikin You're not following our instructions, though. The problem is most likely that your Emacs doesn't support https, but seeing the error message would help.

@achikin
Copy link

@achikin achikin commented May 1, 2018

@purcell @milkypostman you were right. I forgot (package-initialize). Sorry about that.

@manojkumarlinux
Copy link

@manojkumarlinux manojkumarlinux commented May 17, 2019

package refresh contents

@vegvisirh2c
Copy link

@vegvisirh2c vegvisirh2c commented Apr 16, 2020

Update. I discovered the problem, and this particular bug report was helpful in finding the solution. toggle-debug-on-error is very helpful. http://melpa.org/packages vs. http://melpa.org/packages/

It would be nice if emacs was more forgiving in this regard.

For anyone who might come across this thread because of the same error: I had the issue. In my init file it wasn't https instead of http though, that bit was missing completely , with the URL essentially being just "://melpa.org/packages/". As soon as I prepended 'http' the error went away

@JulienPalard
Copy link

@JulienPalard JulienPalard commented Nov 13, 2020

I'm hitting this, Debugger entered--Lisp error: (file-error "https://melpa.org/packages/archive-contents" "Bad Request"), while curl can get it cleanly, I don't understand why and have no idea how to debug it. I'm using Emacs 26.1 from emacs-nox from http://raspbian.raspberrypi.org/raspbian/ buster.

@qorg11
Copy link

@qorg11 qorg11 commented Nov 29, 2020

Same issue as above

@traumschule
Copy link

@traumschule traumschule commented Dec 6, 2020

Edit: looks like the hosting provider is on some gnu/melpa blacklist. Fix: (add-to-list 'package-archives '("melpa" . "http://www.mirrorservice.org/sites/melpa.org/packages/") t)

Why does gnu fail as well?

(package-initialize)
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org") t)
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:443
Failed to download ‘gnu’ archive.
Contacting host: melpa.orgarchive-contents:443
Package refresh done
Failed to download ‘melpa’ archive.
Debugger entered--Lisp error: (file-error "https://elpa.gnu.org/packages/archive-contents" "Bad Request")
  signal(file-error ("https://elpa.gnu.org/packages/archive-contents" "Bad Request"))
  package--download-one-archive(("gnu" . "https://elpa.gnu.org/packages/") "archive-contents" nil)
  package--download-and-read-archives(nil)
  package-refresh-contents()
  funcall-interactively(package-refresh-contents)
  call-interactively(package-refresh-contents record nil)
  command-execute(package-refresh-contents record)
  execute-extended-command(nil "package-refresh-contents" nil)
  funcall-interactively(execute-extended-command nil "package-refresh-contents" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

GNU Emacs 26.1

@dinolivanos
Copy link

@dinolivanos dinolivanos commented Dec 11, 2020

I hit this problem on Rasberry Pi OS, Debian Buster.
I did a
sudo apt install gnutls-bin

and then added this to the top of my init.el file
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

It fixed the issue. I followed the advice from here https://emacs.stackexchange.com/a/51772

@sshaw
Copy link
Contributor

@sshaw sshaw commented Mar 12, 2021

I had this problem as well and while I was not able to resolve it (😿) some things that may help others:

  • Setting gnutls-log-level's log level to 2
  • Changing network-security-level's value, see Network Security
  • Seeing if you can successfully make the request with cURL or wget with debug mode on and if so
    • Toying around with gnutls-algorithm-priority's vast set of options based on what cURL/wget successfully connected with
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet