-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Emacs hangs at contacting host #4453
Comments
Can you try launching emacs with |
Aha, that's how created the |
@syl20bnr Is it possible to install the packages manually from the repository? If so, will that prevent emacs from making that initial network request? |
@danprince I'm also meet this problem, do you solve it ? |
Did anyone find a solution to this? |
I haven't solved this problem yet. I just tried building emacs 24.4 from source and I still have a similar problem with Spacemacs. Running
Running
|
The same issue as OP reported, and the issue is only observed on Linux, no problems on Windows and MacOS. Using latest spacemacs (v0.105.14), and emacs 24.5 for all three platforms. |
I've got the same problem on OSX with Emacs v0.105.19 Running from finder instead of terminal fixed the issue |
Also meeting this issue, even though I've replaced |
@myme5261314 Try to disable https? |
Yes
But the funny thing is that the @zilongshanren don't make it wrong, it's not caused by the mirror, the problem exists while using melpa outside China, refer to the issue author. |
Similar issue here. I wanted to bootstrap spacemacs on a new ubuntu 14.04 machine.
And becomes unresponsive (5 sec timeout in |
Actually, don't know why, after a long holiday, my issue described above was gone and it exists before the holiday. Using the china mirrors won't hang up. Just for reference. |
Hi. I have an emacs config that remained almost the same through several emacs updates and I did not change how emacs contact melpa repositories. So checking melpa documentation I noticed that my config was pointing to http://melpa.milkbox.net/packages as shown in the following code snippet
Changing this config to as recommended in melpa.org solved the issue to me:
Hope this helps |
I had the same issue just now. It happened after I added When I next started Spacemacs, it hung. Above the mode line, it said:
Below the mode line, it said: After several minutes, Spacemacs gave the following messages above the mode line:
and the following below the mode line:
I tried restarting Spacemacs a couple of times, with similar results. Update: A day later, and restarting Spacemacs worked fine, without any of the warnings above. |
The reason is mepla.org is not stable. I use an agent based in US, still can't open page Multiple-Cursors from melpa. Got an Error: |
It's true that melpa.org is sometimes down. Additionally, it might sometimes be unreachable for other reasons outside the melpa maintainers' control, e.g. client misconfiguration, or unreliable internet connectivity. But even if Spacemacs can't reach melpa.org, or if melpa.org returns an error when Spacemacs does reach it, Spacemacs ideally ought not to hang :) |
@sampablokuper Indeed it should hang. I've sent PR that advocates this issue. |
I'm not yet sufficiently literate in Emacs Lisp to grok your PR, but I think it means that if Spacemacs can't reach a repository (e.g. Melpa), then it will hang with the following error:
That's definitely more helpful than the current feedback, but it would be nice if the feedback would additionally give the user a clearly stated means to bypass the hang, deferring whatever it was that Spacemacs was trying to do with the currently-unreachable repository until the next time Spacemacs is started. E.g.
I'm not sure what the most user-friendly key binding would be, which is why I just wrote Anyhow, it's great that you're working to improve the issue. Thanks! |
@sampablokuper :
Yes, you understood it correctly.
I don't see any way to help with connectivity problem without looking into specific case. Bad internet connection, walls and other stuff can't be and should not be fixed from Spacemacs side. That's why it states
In some cases it makes no sense. I mean, if it's fresh install and MELPA is not available - Spacemacs can't function anyway. Because core itself uses a lot of third-party packages. If you let people pass though this error - they'll get messages like 'package-*** is not available' and it will be even more misleading. When Spacemacs tries to install package - package is required somehow. Not having this package installed is undefined behaviour. Trying to be as friendly as possible also means mitigating undefined behaviour 😸 At least in my opinion.
There is room for improvement 😸 Ideally I would like to have fallback package archive to be used when one of third-party package archives is down. So ideally user should never see that error (except for missing internet connection). |
@d12frosted thanks for the clarifications.
Agreed. But even if the user's internet connection (or Melpa, etc) is down, that should never prevent the user from running Spacemacs, if Spacemacs and its core dependencies are already installed on the user's computer. Right? A key reason to use locally installed software like Spacemacs rather than a "cloud" service is to be able to get work done without being dependent upon having a good connection to some remote server. |
Nor will it, unless you have changed the configuration somehow so that additional packages are needed. I don't mean to suggest that the current state of affairs is fine, but do please understand that Spacemacs hangs because it's trying to install stuff that you told it to install. |
In my opinion - not. If Spacemacs tries to install something - then this something is missing, so Spacemacs can't operate correctly. But I wonder what @TheBB and @syl20bnr think about it 💃
If everything is installed you don't have to be online anymore. If you wish additional functionality that has dependencies that are not yet installed - you need internet connection again :( Oh, @TheBB is fast 😸
Yeah, exactly. 😸 💯 |
I agree that Spacemacs must be operational with or without Internet connection. If it is not the first launch, then it should keep the latest working setup, and if the repo is unavailable - backup to the latest working setup. |
Since user configuration can be arbitrarily complex, there's no truly reliable way for us to keep track of the last working setup. I'm interested to hear suggestions as to what that could look like. |
Weird, I fixed my very similar problem (on OS X) by just installing |
I encounter such problem, and I |
Did anyone ever find a work around for this? Because watching my network connections it doesn't even look like emacs is trying to reach any host Edit: Adding the line |
@mwillsey wrote:
Interesting, but the machine it occurred on for me was one that did have |
Also having this issue on Ubuntu 16.04 with Emacs 24.5 |
Same issue, but under Windows 10. This issue touches not only packages install, but also other https connections, emacs simple hang up when "Contacting host". btw. Emacs under Cygwin works pretty fine with https with the same .spacemacs file and the same .emacs.d folder. |
I have also the same issue under windows 10. spacemacs hangs at "refreshing package archive:org... [2/3]" |
Same issue here, Windows 10, normal |
[SOLVED] (for me) Try pinging the site that emacs is trying to reach. For example, my .emacs config file contained the following lines: (require 'package)
(setq package-archives
'( ("melpa-stable" . "http://stable.melpa.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) I tried ("melpa" . "http://www.melpa.milkbox.net/packages/") and now emacs starts up quickly, without hanging on I hope this helps others. This was a very frustrating, longstanding problem for me, but apparently has a very simple solution, which I haven't seen suggested anywhere else... weird. |
The solution is, evalutate |
Cygwin worked like a charm. Thank you so much. |
@i-schuetz It occurs because of this line: (package-refresh-contents) If you comment it out or remove it: ;; (package-refresh-contents) Then it won't contact the host on startup. |
@duianto meanwhile I was able to figure that out 🙂, I just wonder, are those lines missing a conditional? Or are they not supposed to go in the init file? It seems weird to have to put it in the init to download it only the first time. |
The docstring for
It might just make sure that the latest version is installed. You will probably get the best answer why it's suggested, if you ask the source: https://github.com/emacs-evil/evil |
I updated my Emacs to 26.3 from 25.3 and since then every time I want to install a package, Emacs hangs. I've tried starting it with My workaround was to replace the line |
Any news on that? I am facing the same issue. |
Same to me. Version 25.x works (using HTTP, I think), where 26.2/26.3 don't. Emacs simply hangs when trying to play with package manager, e.g. trying to install packages. |
As a note: running emacs 16.3 on MacOS (installed via brew) works as expected. So it's probably not related to server side. |
I still see this behaviour on Emacs 27.1 and 28.0.50 on Linux with the develop branch, regardless of whether using HTTP or HTTPS. In my case it's due to MELPA currently being down or inaccessible. In those cases you can still open http://melpa.org in a web browser, so the test with You can work around this by telling Spacemacs to use a different set of mirrors, e.g. by putting something like this in your
The |
The issue is most certainly with verifying the certificates.
|
tks |
I was seeing a hang on |
(when (not package-archive-contents) |
2022 this problem still exists. This worked for me. |
Is this still happening for any recent user? If not I would like to close it |
No response therefore I assume this is gone |
Sorry for late reply - didn't notice info till now. In my case, Emacs (version 29.4, running on Win 10) does not hang any longer using latest spacemacs. Thanks for providing this nice peace of software! |
Trying to install spacemacs on Ubuntu 15.04.
I've moved the spacemacs files to
~/.emacs.d/
, but when I start emacs I get a flash of the initial emacs window, then a black screen withOnce it opened with
orgmode.org:80
instead, but I haven't been able to recreate that.emacs -q
).emacs --debug-init
produces no outputcurl https://melpa.org
so not a network restrictionI've tried a fresh install of both emacs and spacemacs as well as using
emacs
,emacs24
andemacs24-x
(but I'm not exactly sure what the differences are).I've been writing Clojure for the last few months and I'm keen to beat some of the struggles I've been having with Lisp + Vim, but after five or six attempts, I've given in and resorted to putting in an issue. Any ideas?
The text was updated successfully, but these errors were encountered: