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

Notebook does not exist and permalinks #1844

Closed
mcelrath opened this issue Jun 4, 2012 · 6 comments
Closed

Notebook does not exist and permalinks #1844

mcelrath opened this issue Jun 4, 2012 · 6 comments
Labels
Milestone

Comments

@mcelrath
Copy link

mcelrath commented Jun 4, 2012

When the IPython server is killed, existing Notebook sessions may display the following message:

  • The kernel has died, would you like to restart it? If you do not restart the kernel, you will be able to save the notebook, but running code will not work until the notebook is reopened.

This can leave the user in a very nasty state in which he may still work on his notebook, but be unable to save his work because the server displays the message "Notebook does not exist". This error is only briefly flashed in the upper right of the browser window, easily leaving the user without knowing that his work is not saving properly. (I just did a lot of work on a notebook in this state...) Worse, there is no way to save the file now, as the "save" capability asks the server for the .ipynb file.

This can be simply mitigated by using the same URL/hash for the same notebook, rather than generating a new hash and URL for each notebook, each time IPython is restarted. Why not store this hash in the .ipynb file, so that browser sessions can persist across server restarts? This has the added benefit that links to notebooks ("permalinks") may be stored elsewhere.

Loss of the server shouldn't cause the user to be unable to save his work, under any circumstances.

I'm using the latest git code, updated this morning.

@minrk
Copy link
Member

minrk commented Jun 4, 2012

The kernel shutdown message/behavior is already open as issue #1587, and the persistent URLs is also something we intend to do, as has been discussed in #977.

I am a bit confused about your experience, because the notebook URLs are persistent for the whole lifetime of the notebook server. Can you describe your steps to entering this can't-save state? I cannot reproduce it by opening several windows on the same notebook, and killing it, restarting it, or leaving it dead. Every situation I try, I can still edit and save without issue.

Worse, there is no way to save the file now, as the "save" capability asks the kernel for the .ipynb file.

This is not accurate - the kernel is not involved in saving in any way.

@mcelrath
Copy link
Author

mcelrath commented Jun 4, 2012

Thanks for the info.

I'm confused by it too, but I just hit it again without restarting the kernel, so I'll keep poking at it until I can reproduce it. Fortunately i was trying to fix some of IPython's CSS so didn't have any important work in the notebook... ;)

Regarding inability to save, the File->"Download As" and File->"Make a copy..." menu items both send a request to the server, and do not function if the kernel is disconnected (or the kernel has been restarted, or otherwise doesn't recognize the file's hash). So I don't understand your comment. The only way to save is to request that the kernel write the file, as far as I can see.

If it's possible to save (download) a .ipynb file directly from the browser without contacting the kernel, that would be fantastic! I suspect cross-site restrictions will prevent it...

@minrk
Copy link
Member

minrk commented Jun 4, 2012

Are you referring to the server itself as the kernel? That's the only way your comments make sense to me.

The Kernel is where your code executes (there is one kernel per notebook), and the Server is the webserver that starts/stops Kernels, and handles browser requests. Kernels can segfault all over the place with no effect on saving.

The notebook hash should never change for the lifetime of the notebook server.

@mcelrath
Copy link
Author

mcelrath commented Jun 4, 2012

You are correct, sorry, s/kernel/server/g. I edited the summary.

@ptwobrussell
Copy link

Is this still the issue to watch for progress on getting permalinks into notebooks? e.g. have permalinks that would allow you to link amongst notebooks by doing away with the uuids in the url context?

@ellisonbg
Copy link
Member

The URL scheme was redone with #3166

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

4 participants