Skip to content

Notebook does not exist and permalinks #1844

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

4 participants

@mcelrath
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
IPython 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
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
IPython 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
mcelrath commented Jun 4, 2012

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

@ptwobrussell

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
IPython member

The URL scheme was redone with #3166

@ellisonbg ellisonbg closed this Jan 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.