-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
can't conda update because phantom notebook server running #2829
Comments
Here's some of the error output:
|
Another update after much detective work: checked runtime info in
I'll delete this file, but I suspect there's some kind of caching/clean-up issue at play here. Update: running |
So looking at the linked code: notebook/notebook/notebookapp.py Lines 1525 to 1532 in d4c6fe4
It would be nice to have the cleanup functionality separated from the listing functionality. That way we could define a separate app just to handle this kind of use case. Telling people that the only way to clean up these files automatically is via the "list" functionality which magically cleans stuff up in the background seems confusing at best. At the least we should have a way to raise an explicit error rather than silently pass if removing a file fails. Ideally, that error would include a message informing the user of which file they might need to |
The "cannot upgrade" should also be fixed in the contrib repository. There should be a way to force upgrade, and not track that file down manually. The file not being deleted is likely because PID are reused – they are assigned in sequence –, we could – for example – store in the json file the date at which the server was started, and check if that was before ( |
There seem to be an uptime package on PyPI that provides a |
I wanted to say "Couldn't we also check the process name currently attached to the PID?" and then proceed to suggest appropriate logic to handle watching for "jupyter/ipython" named processes (though that wouldn't be foolproof)… however I just spent some time looking at how you would get the name of a process given it's PID… and it seems pretty hard to do in an OS independent way… and even if we continued our OS dependence in (our code) it seems like it's hard to do without introducing a new dependency like this SO post suggests with a package like psutil. |
Yes, and in many case we could not even find "jupyter" or "ipython" in the process name, we would just get |
This ought to work. It should identify itself as a tornado server in the headers, at least. We do have something tricky in this particular case because there are two leftover runtime files, each claiming to be on the same http endpoint (unsurprising, since it's the default). That's probably pretty common, come to think of it. @eseiver I think you're exactly right that a runtime file was leftover after a server stopped, for whatever reason. Removing it by hand is an AOK workaround while we figure out why the file was leftover and how we can do better cleaning up after this event occurs. In general, the runtime directory should be safe to delete in its entirety if no Jupyter processes are running. |
any news on this? It's 2021 and I have this problem! |
I couldn't update my Python 3 conda environment today and the
NotebookRunningError
messages indicated it was because a Jupyter notebook server was running. I had just booted up my machine within the last hour and had not launched a notebook server. I'm on a MBP running macOS Sierra.Here's the result of my command line tests:
Checking what notebook servers are "running"
[also weird b/c I am using miniconda now not anaconda]
Checking if there is a background process in screen
Check all processes
[though I understand this doesn't work on Macs?]
Check that it is accessible in browser
http://localhost:8888/
tested in the browser; connection refused.@mpacer @minrk @Carreau
The text was updated successfully, but these errors were encountered: