-
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. |
@sampablokuper (re: hanging and skipping connectivity errors)
Just to clarify. I don't think that this is desired behaviour. That's why I am working on improving it. And thanks for bringing that up 😸
While that sounds right, users should be responsible for the changes they do in their configurations (which can be scattered across many different files). Using your example, if I want to edit html file, but I am offline and We probably should add suggestions when it's impossible to download required packages. E. g. ask user to disable specific layer or remove package from list of additional packages. So Spacemacs can start properly. Also, probably lazy installation flow should not propose user to enable layer if package archives are not reachable. (re: rollback to last working config) @TheBB nice examples you bring up here. Also in some cases some packages depend on And as another example - Spacemacs actually can be loaded manually. I store Spacemacs in
Exactly. |
@d12frosted wrote:
You're welcome, and thanks to you, too!
That's different to my example. In my example, before I added
Maybe at the moment, but not necessarily. The solution is to define the behaviour of Spacemacs in such a case. That would be much better than having Spacemacs just hang, which doesn't help the user at all. The first bit of behaviour to implement would be better feedback: inform the user of the trouble Spacemacs has encountered. It's great that you're working on this! The next bit of behaviour to implement would be to give the user a good way to get out of that trouble. A common user interface pattern for this is "safe mode". Windows used to have this; maybe it still does. Some web browsers, likewise. The idea of a "safe mode" is that it won't give you all the functionality you would ideally have, but it will dependably give you enough functionality to get basic things done (e.g. edit text files) until you have finished troubleshooting whatever it is that was preventing the full desired functionality from being achieved. That is the essence of what I advocated in my earlier comment, but I hope that giving a name to it (i.e. "safe mode") will make my suggestion clearer. By "an option to bypass the hang", I essentially mean "an option to enter Spacemacs Safe Mode". The more functional that safe mode is, the better, as long as Safe Mode is dependable. Invoking Safe Mode should never cause Spacemacs to hang: it should always provide at least the functionality offered by an unmodified Spacemacs install. One way to achieve this might be to ship Spacemacs with a read-only "safe mode" configuration in addition to the user-editable configuration. The former would contain comments explaining its purpose and advising the user not to modify or delete it. Upon invocation of Safe Mode, Spacemacs would then load that "safe mode" configuration instead of the user's configuration. There, that's it; that would provide an adequate fix for this issue :) A more sophisticated refinement of that idea, if anyone got really keen, would be for Spacemacs to tentatively load each part of the user's configuration after having loaded the "safe mode" configuration. By "tentatively", I mean something like, "For each function in the user's configuration, attempt to run that function, but if it returns an error or takes more than a few seconds to return, then skip it and move on to the next function." If that worked robustly, then even if the whole of the user's config couldn't be loaded, at least the end result would work and it would also be configured as closely to the user's desired behaviour as possible without hanging.
Sure, but if the user is unaware of what is causing Spacemacs to hang or how to stop it hanging, then (a) this resolution might not be obvious to them, and (b) they had better have another text editor handy, because while Spacemacs is hanging, they can't use Spacemacs to revert the addition they made to their
If this were implemented entirely within Spacemacs, that would be great: much better than hanging! Ideally, the user should not have to invoke another text editor in order to fix the problem.
I see where you're coming from here, but I disagree with this specific implementation suggestion. There is a temporal consideration here. When a user adds a layer's name to their config, they are not saying to Spacemacs, "Download and install this layer right now!" What they are instead saying to Spacemacs is, "Next time you load this config, please try to download and install this layer; and if at that point you can't download or install it, then don't hang or otherwise interrupt my productivity, just inform me what it was that you couldn't do and why, and give me the option to ask you to try again next time you load this config." Thanks again :) |
Possible solution:
My environment: The bootstrap failed message of spacemacs. error: Package ‘evil-’ is unavailable To ensure normal operation, you should investigate and remove the I reproduce the procedure 3 times. |
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. |
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: