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 #3914

Closed
hpr opened this issue May 19, 2016 · 23 comments
Closed

Failed to download `melpa' archive #3914

hpr opened this issue May 19, 2016 · 23 comments
Labels

Comments

@hpr
Copy link

hpr commented May 19, 2016

I get the error Failed to download melpa archive. when I try to M-x package-refresh-contents, yet doing a (browse-url-emacs "https://melpa.org/packages/archive-contents" t) from within emacs works just fine and gives me the correct file. Here's my .emacs:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages")))
(package-initialize)

I'm using emacs version 24.4. What can be done to debug / fix this problem?

@xuchunyang
Copy link
Contributor

Not answering your question, but

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

you forget the tailing slash of GNU ELPA URL, as far as I know, it matters.

@hpr
Copy link
Author

hpr commented May 20, 2016

Thank you, I added the trailing slash but I am still getting the same error when trying to download the mepla archive. Any help would be greatly appreciated.

@milkypostman
Copy link
Member

do you have debug-on-error set?

some more logging details might be shown in the *Messages* buffer.

@hhnr
Copy link

hhnr commented May 22, 2016

Hi @milkypostman , here's the error after setting debug-on-error. Emacs version 24.5. But for some reason it works with emacs 25.

Debugger entered--Lisp error: (error "Could not create connection to melpa.org:443")
signal(error ("Could not create connection to melpa.org:443"))
error("Could not create connection to %s:%d" "melpa.org" 443)
url-http([cl-struct-url "https" nil nil "melpa.org" nil "/packages/archive-contents" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240\2$
url-https([cl-struct-url "https" nil nil "melpa.org" nil "/packages/archive-contents" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240$
url-retrieve-internal("https://melpa.org/packages/archive-contents" #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-$
url-retrieve("https://melpa.org/packages/archive-contents" #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug ret$
url-retrieve-synchronously("https://melpa.org/packages/archive-contents")
url-insert-file-contents("https://melpa.org/packages/archive-contents")
package--download-one-archive(("melpa" . "https://melpa.org/packages/") "archive-contents")
#0 "\301\300\302"\207" [("melpa" . "https://melpa.org/packages/") package--download-one-archive "archive-contents"] 3 "\n\n(fn)"
funcall(#[0 "\301\300\302"\207" [("melpa" . "https://melpa.org/packages/") package--download-one-archive "archive-contents"] 3 "\n\n(fn)"])
package-refresh-contents()
(if (package-installed-p (quote use-package)) nil (package-refresh-contents) (package-install (quote use-package)))
eval-buffer() ; Reading at buffer position 789
call-interactively(eval-buffer record nil)
command-execute(eval-buffer record)
execute-extended-command(nil "eval-buffer")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)

@purcell
Copy link
Member

purcell commented May 22, 2016

Are you maybe on Windows? My guess is that 24.4 was relying on an external program such as gnutls or openssl to make an https connection, whereas (I think) 25 has SSL support compiled-in on Windows. The error indicates that your Emacs 24.4 was either incapable of https, or the helper program declined to make the connection. You can test it with other URLs, e.g. by evaluating (url-copy-file "https://www.google.com/" "google.txt").

@hhnr
Copy link

hhnr commented May 23, 2016

I'm using Ubuntu 14.04 @purcell. And with (url-copy-file "https://www.google.com/" "google.txt") from emacs-24.5 -nw -Q i get the same error

Debugger entered--Lisp error: (error "Could not create connection to www.google.com:443")
signal(error ("Could not create connection to www.google.com:443"))
error("Could not create connection to %s:%d" "www.google.com" 443)
url-http([cl-struct-url "https" nil nil "www.google.com" nil "/" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(n$
url-https([cl-struct-url "https" nil nil "www.google.com" nil "/" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [($
url-retrieve-internal("https://www.google.com/" #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Syn$
url-retrieve("https://www.google.com/" #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Synchronous $
url-retrieve-synchronously("https://www.google.com/")
url-copy-file("https://www.google.com/" "google.txt")
eval((url-copy-file "https://www.google.com/" "google.txt") nil)
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)

@hhnr
Copy link

hhnr commented May 23, 2016

I'm using Emacs 24.5 GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 2.24.23) of 2016-03-27

@milkypostman
Copy link
Member

does it work without https?

On Sun, May 22, 2016 at 9:08 PM, rdotdk notifications@github.com wrote:

I'm using Emacs 24.5 GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version
2.24.23) of 2016-03-27


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#3914 (comment)

@lascott
Copy link

lascott commented May 24, 2016

In debug-on-error mode, I tried as https and http, both failed.
grabbing google with url-copy-file works just fine.

emacs --version : 24.3.1
uname -a : Linux Neruda 3.19.0-32-generic #37~14.04.1-Ubuntu
dpkg -l :
ii libssl1.0.0:amd64 1.0.1f-1ubuntu2 amd64 Secure Sockets Layer toolkit - shared libraries
ii libssl1.0.0:i386 1.0.1f-1ubuntu2 i386 Secure Sockets Layer toolkit - shared libraries
ii openssl 1.0.1f-1ubuntu2 amd64 Secure Sockets Layer toolkit - cryptographic ut

(when (>= emacs-major-version 24) (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize))

Loading /home/louis/.emacs.d/init.el (source)...done
Contacting host: elpa.gnu.org:80
Saving file /home/louis/.emacs.d/elpa/archives/gnu/archive-contents...
Wrote /home/louis/.emacs.d/elpa/archives/gnu/archive-contents
Contacting host: melpa.org:80
package-handle-response: Error during download request: Not Found

next I evaluated (url-copy-file "https://www.google.com/" "google.txt")
which read successfully.

Mark set
load-file: Cannot open load file: /home/louis/
Contacting host: www.google.com:443
Wrote /home/louis/google.txt

@hhnr
Copy link

hhnr commented May 24, 2016

@milkypostman it works with http for me.

@milkypostman
Copy link
Member

i think this is a local issue, not a problem with the server.

@haight6716
Copy link

I'm having the same problem. When I visit the recommended package url (https://melpa.org/packages/) with a web browser, I get an "empty" error page with a meta-redirect embedded. Seems like an obvious problem. Looks like someone rejiggered the website for human consumption without thinking about how machines will cope with it?

@milkypostman
Copy link
Member

Emacs doesn't read that address. It reads
http://melpa.org/packages/archive-contents which is the package index which
package.el loads.
On Fri, Jun 10, 2016 at 10:18 Julian Haight notifications@github.com
wrote:

I'm having the same problem. When I visit the recommended package url (
https://melpa.org/packages/) with a web browser, I get an "empty" error
page with a meta-redirect embedded. Seems like an obvious problem. Looks
like someone rejiggered the website for human consumption without thinking
about how machines will cope with it?


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#3914 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AACUsjpDrMBTY59EVY_FNRboFpABdhShks5qKZx_gaJpZM4IiwM2
.

@NJBS
Copy link

NJBS commented Jun 14, 2016

It looks like contents of archive-contents are cut off once again.

@xuchunyang
Copy link
Contributor

xuchunyang commented Jun 14, 2016

and https://melpa.org/#/ website is not working correctly either

@purcell
Copy link
Member

purcell commented Jun 14, 2016

@NJBS / @xuchunyang unrelated. disk is full. see #3985

@tarsius
Copy link
Member

tarsius commented Mar 12, 2017

Since we haven't heard from the affected users in a while, I am going to assume that this no longer is an issue. I also think that this is quite likely the case:

i think this is a local issue, not a problem with the server.

@tarsius tarsius closed this as completed Mar 12, 2017
@abrahamparayil
Copy link

I still have this issue

@tarsius
Copy link
Member

tarsius commented Aug 30, 2018

I still have this issue

What is "this issue"? What error messages do you get?

@abrahamparayil
Copy link

"Failed to download melpa archive." was the error message I got. Then I stayed up through the night and kinda copy pasted package installation code from different init files I found on Github and its working. The melpa link is different and this link seems to work. I'm very new to emacs.
This is what I use in my init file I've added another source too:

(load "package")
(package-initialize)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)

@purcell
Copy link
Member

purcell commented Sep 1, 2018

@guy-fawks The milkbox.net URL is obsolete and you should instead follow the instructions in the MELPA README.

@abrahamparayil
Copy link

@purcell 👍🏻👍🏻👍🏻

@AdanCortes
Copy link

From https://melpa.org/#/getting-started

"Enable installation of packages from MELPA by adding an entry to package-archives after (require 'package) and before the call to package-initialize in your init.el or .emacs file"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests