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

Cannot save notebook in ein #178

Closed
nwieder opened this issue Apr 7, 2016 · 6 comments
Closed

Cannot save notebook in ein #178

nwieder opened this issue Apr 7, 2016 · 6 comments

Comments

@nwieder
Copy link

nwieder commented Apr 7, 2016

Hi,
whenever I am trying to call ein:notebook-save-notebook (with c-x x-s or directly) I get an error message:

ein: [info] Writing notebook Untiteled.ipynb as nbformat 4.
ein:notebook-save-notebook: Wrong type argument: number-or-marker-p, nil

There is no jupyter console output and I can save the notebooks in the web interface.

Setup:

  • ein:ml
  • emacs 24.5.1 (from the debian repos)
  • jupyter 4.0.6

not sure what's going on, any ideas?

@millejoh
Copy link

millejoh commented Apr 7, 2016

You can get better information by enabling debugging. Also note that the official repository is now at https://github.com/millejoh/emacs-ipython-notebook. Do the following:

  1. Restart Emacs.
  2. Execute M-x ein:dev-start-debug
  3. Call ein:notebooklist-open
  4. Open/create a notebook, add some stuff, then try to save.
  5. Hopefully a debug backtrace will open up - send me the contents.
  6. You can also take a look at the ein:log-all buffer. When debugging is enabled websocket debugging info gets written to a separate buffer as well, if you can find it and send me the contents that would be swell.

@nwieder
Copy link
Author

nwieder commented Apr 7, 2016

Thanks for the reply. I attached the debug backtrace!

ein_bug.txt

@millejoh
Copy link

millejoh commented Apr 9, 2016

Not as helpful as I had hoped. I haven't had problems with saving in some time. Could you send a copy of the notebook you are trying to save, also let me know the command line you use to start jupyter?

@nwieder
Copy link
Author

nwieder commented Apr 11, 2016

Thanks for getting back on this.

This is how I start jupyter;
alias pnb='ipython notebook --ip 127.0.0.1'
While I'm writing this I'm realizing that I have been using the ipython command (old .bashrc alias...) instead of the jupyter command. But the error persists either way.

The error appears in every notebook I am using. Find attached an example that I saved through the web interface (just remove the .txt had to add it to append it here).

To be fair, I should mention that I am on debian sid (unstable), even though I don't see how this should affect this matter. The whole issue is not super important to me personally since ein saving on my main working station (OSX 10.11) works flawless.

Keep up the great work, thanks for all the effort!

test.ipynb.txt
.

@millejoh
Copy link

Certainly nothing out of the ordinary there. At this point, if I could recreate the error, I would be using the Lisp debugger to step through the code as it called ein:content-save, but since I don't have any systems to run Debian Sid on I unfortunately cannot reproduce.

This probably won't help much, but my only suggestion is to double check that you have the latest version of ein and its dependencies downloaded from MELPA. For good measure you can also call ein:byte-compile-ein, but again I don't expect it to do much.

Also, was there anything of note in ein:log-all or the websocket log buffer while you had ein in debug mode?

@nwieder nwieder closed this as completed Nov 2, 2017
@lukeorland
Copy link

I needed to disable xsrf, per this: nteract/hydrogen#922 (comment)

The errors I was seeing from the jupyter notebook server were like this:

[W 11:08:28.874 NotebookApp] 403 PUT /api/contents/notebooks/path/to/notebook.ipynb (127.0.0.1): '_xsrf' argument missing from POST                          
[W 11:08:28.874 NotebookApp] '_xsrf' argument missing from POST

disabling xsrf doesn't concern me too much in this case, since I'm running the server on my localhost and not allowing external connections to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants