millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 123 forks source link

Unable to save notebooks (wrong-type-argument stringp nil) #848

Closed derekperrin closed 2 years ago

derekperrin commented 2 years ago

Problem description

Unable to save notebooks. Gives error (wrong-type-argument stringp nil)

Steps to reproduce the problem

1) ein:run 2) Open a notebook. 3) ein:notebook-save-notebook-command-km.

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0)
 of 2022-07-01"
 :window-system x
 :emacs-variant nil
 :build
 "--prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --disable-silent-rules --docdir=/usr/share/doc/emacs-28.1 --htmldir=/usr/share/doc/emacs-28.1/html --libdir=/usr/lib64 --program-suffix=-emacs-28 --includedir=/usr/include/emacs-28 --infodir=/usr/share/info/emacs-28 --localstatedir=/var --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp --without-compress-install --without-hesiod --without-pop --with-file-notification=inotify --with-pdumper --enable-acl --with-dbus --without-modules --without-gameuser --with-libgmp --with-gpm --with-native-compilation --without-json --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2 --with-mailutils --without-selinux --with-gnutls --without-libsystemd --with-threads --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns --without-gconf --without-gsettings --with-toolkit-scroll-bars --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm --with-imagemagick --with-xft --with-cairo --without-harfbuzz --without-libotf --without-m17n-flt --with-x-toolkit=gtk3 --without-xwidgets --with-dumping=pdumper 'CFLAGS=-march=ivybridge -O2 -pipe' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed'"
 :os
 (:uname
  "Linux xavier 5.18.7-gentoo-2022-07-01 #1 SMP PREEMPT_DYNAMIC Fri Jul 1 10:14:40 NZST 2022 x86_64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz GenuineIntel GNU/Linux
"
  :lsb-release
  "LSB Version: n/a
Distributor ID: Gentoo
Description:    Gentoo Base System release 2.8
Release:    2.8
Codename:   n/a
")
 :jupyter
 "Selected Jupyter core packages...
IPython          : 8.4.0
ipykernel        : 6.15.0
ipywidgets       : 7.7.1
jupyter_client   : 7.3.4
jupyter_core     : 4.10.0
jupyter_server   : 1.18.0
jupyterlab       : not installed
nbclient         : 0.6.4
nbconvert        : 6.5.0
nbformat         : 5.4.0
notebook         : 6.4.12
qtconsole        : not installed
traitlets        : 5.3.0
"
 :image-types
 (svg imagemagick png gif tiff jpeg xpm xbm pbm)
 :image-types-available
 (svg imagemagick png gif tiff jpeg xpm xbm pbm)
 :request-backend curl
 :ein
 (:version "20220618.1101"
       :source-dir "/home/dperrin/dotfiles/emacs/.emacs.d/elpa/ein-20220618.1101/")
 :lib
 ((:name "websocket"
     :path "~/.emacs.d/elpa/websocket-20210110.17/websocket.el"
     :featurep t
     :version-var websocket-version
     :version "1.12")
  (:name "anaphora"
     :path "~/.emacs.d/elpa/anaphora-20180618.2200/anaphora.el"
     :featurep t
     :version-var nil
     :version nil)
  (:name "request"
     :path "~/.emacs.d/elpa/request-20220614.1604/request.el"
     :featurep t
     :version-var request-version
     :version "0.3.3")
  (:name "deferred"
     :path "~/.emacs.d/elpa/deferred-20170901.1330/deferred.el"
     :featurep t
     :version-var deferred:version
     :version "0.5.0")
  (:name "polymode"
     :path "~/.emacs.d/elpa/polymode-20220322.824/polymode.el"
     :featurep t
     :version-var nil
     :version nil)
  (:name "dash"
     :path "~/.emacs.d/elpa/dash-20220608.1931/dash.el"
     :featurep t
     :version-var nil
     :version nil)
  (:name "with-editor"
     :path "~/.emacs.d/elpa/with-editor-20220608.1017/with-editor.elc"
     :featurep nil
     :version-var nil
     :version nil)))

Logs:

ein:log-all:

11:28:17:413: [info] ein:jupyter-server--run: /usr/bin/jupyter notebook --notebook-dir=~/ --no-browser @#<buffer *scratch*>
11:28:21:259: [info] Login to http://127.0.0.1:8888 complete. @#<buffer *scratch*>
11:28:21:524: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer *scratch*>
11:28:39:664: [verbose] Opened notebook Untitled5.ipynb @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
11:28:39:709: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
11:28:39:768: [verbose] ein:kernel-retrieve-session--success: kernel-id=6982d7dd-45dc-4135-9b8c-e16e99eb3fa3 session-id=00e2bd27-3b34-41cd-ac0d-20172cf60539 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
11:28:39:768: [verbose] WS start: ws://127.0.0.1:8888/api/kernels/6982d7dd-45dc-4135-9b8c-e16e99eb3fa3/channels?session_id=00e2bd27-3b34-41cd-ac0d-20172cf60539 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
11:28:41:208: [info] WS action [(wrong-type-argument stringp nil)] on-open (ws://127.0.0.1:8888/api/kernels/6982d7dd-45dc-4135-9b8c-e16e99eb3fa3/channels?session_id=00e2bd27-3b34-41cd-ac0d-20172cf60539) @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
11:29:13:847: [warn] ein:dev-packages: Don’t call me! @#<buffer  *temp*>

ein server:

[I 11:28:18.863 NotebookApp] Loading IPython parallel extension
[I 11:28:18.876 NotebookApp] Serving notebooks from local directory: /home/dperrin
[I 11:28:18.876 NotebookApp] Jupyter Notebook 6.4.12 is running at:
[I 11:28:18.876 NotebookApp] http://localhost:8888/?token=d66c60feffb6370fd01e71bfbfaadcb829d4afe5daa528ff
[I 11:28:18.876 NotebookApp]  or http://127.0.0.1:8888/?token=d66c60feffb6370fd01e71bfbfaadcb829d4afe5daa528ff
[I 11:28:18.876 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:28:18.883 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///home/dperrin/.local/share/jupyter/runtime/nbserver-19207-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=d66c60feffb6370fd01e71bfbfaadcb829d4afe5daa528ff
     or http://127.0.0.1:8888/?token=d66c60feffb6370fd01e71bfbfaadcb829d4afe5daa528ff
[I 11:28:21.146 NotebookApp] 302 POST /login (127.0.0.1) 1.560000ms
[I 11:28:21.147 NotebookApp] 302 GET / (127.0.0.1) 0.440000ms
[W 11:28:21.266 NotebookApp] Serving api spec (experimental, incomplete)
[I 11:28:39.565 NotebookApp] Creating new notebook in 
[I 11:28:39.762 NotebookApp] Kernel started: 6982d7dd-45dc-4135-9b8c-e16e99eb3fa3, name: python3
derekperrin commented 2 years ago

Updated the issue to follow the format according to the README. Apologies for my ignorance in reading how to submit bugs on this project.

dickmao commented 2 years ago

Sorry, the README wasn't right. I just corrected it in 693373b.

Perhaps you could try again with the new instruction? That will show the websocket traffic where the problem appears to reside.

derekperrin commented 2 years ago

For whatever reason, things seem to be working fine now when I follow those instructions. I'm not sure why they didn't before even when I used -Q and started from scratch. I don't recall doing anything besides rebooting.

I tried to narrow down the problem by disabling sections of my init.el, and I can reproduce it only if I have magit enabled. I'm not sure if this is unique to my system or a problem with magit, but that seems to cause the issue for me. I'm not sure if you want a debug log or to mark this as closed since it's another package that might be causing it.

dickmao commented 2 years ago

My OCD finds any excuse to close an issue.