Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Notebook does not exist and permalinks #1844
When the IPython server is killed, existing Notebook sessions may display the following message:
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.
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.
This is not accurate - the kernel is not involved in saving in any way.
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...
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.