tkf / emacs-ipython-notebook

IPython notebook client in Emacs
tkf.github.com/emacs-ipython-notebook/
GNU General Public License v3.0
548 stars 51 forks source link

ein: [error] Content list call failed with status error. #197

Closed casouri closed 6 years ago

casouri commented 6 years ago

When I try to use ein:notebooklist-open-notebook-by-file-name to open a notebook buffer, error in title pops up.

Command I run: (ein:notebooklist-open-notebook-by-file-name "main.ipynb)

Expected behavier: a notebook buffer opens.

Observed behavier: Error occurs.

Log: Emacs:

ein: [info] Opening notebook main.ipynb/main.ipynb...
ein: [error] Content list call http://127.0.0.1:8888/api/contents/main.ipynb/main.ipynb failed with status error.

Server:

[W 01:35:37.320 NotebookApp] No such file or directory: main.ipynb/main.ipynb
[W 01:35:37.322 NotebookApp] 404 GET /api/contents/main.ipynb/main.ipynb (127.0.0.1) 4.77ms referer=None

For some reason ein repeated filename twice. The correct filename is main.ipynb

Some test:

Evaluating

(ein:notebooklist-find-server-by-notebook-name "main.ipynb)
=> ("http://127.0.0.1:8888" "main.ipynb/main.ipynb")

(ein:notebooklist-list)
=> (#s(ein:$notebooklist "http://127.0.0.1:8888" "" ((:name "main.ipynb" :path "main.ipynb" :last_modified "2018-03-08T02:07:06.819303Z" :created "2018-03-08T02:07:06.819303Z" :content nil :format nil ...) (:name "after_sub_1.png" :path "after_sub_1.png" :last_modified "2018-03-02T06:24:41.272237Z" :created "2018-03-02T06:24:41.272237Z" :content nil :format nil ...) (:name "after_sub_2.png" :path "after_sub_2.png" :last_modified "2018-03-02T06:24:41.278780Z" :created "2018-03-02T06:24:41.278780Z" :content nil :format nil ...) (:name "after_sub_3.png" :path "after_sub_3.png" :last_modified "2018-03-02T06:24:41.287719Z" :created "2018-03-02T06:24:41.287719Z" :content nil :format nil ...) (:name "after_sub_4.png" :path "after_sub_4.png" :last_modified "2018-03-02T06:24:41.294832Z" :created "2018-03-02T06:24:41.294832Z" :content nil :format nil ...) (:name "Archive.zip" :path "Archive.zip" :last_modified "2018-02-27T19:33:43.310200Z" :created "2018-02-27T19:33:43.310200Z" :content nil :format nil ...) (:name "bg.png" :path "bg.png" :last_modified "2018-02-12T05:23:19.578146Z" :created "2018-02-12T05:23:23.811331Z" :content nil :format nil ...) (:name "bg2.png" :path "bg2.png" :last_modified "2018-02-15T03:53:34.441790Z" :created "2018-02-15T03:54:15.751011Z" :content nil :format nil ...) (:name "detect_human.py" :path "detect_human.py" :last_modified "2018-03-01T19:04:58.792211Z" :created "2018-03-01T19:04:58.792211Z" :content nil :format nil ...) (:name "detect_human_1.png" :path "detect_human_1.png" :last_modified "2018-03-01T21:48:56.841279Z" :created "2018-03-01T21:48:56.984416Z" :content nil :format nil ...) (:name "detect_human_2.png" :path "detect_human_2.png" :last_modified "2018-03-01T22:08:11.317501Z" :created "2018-03-01T22:08:11.470305Z" :content nil :format nil ...) (:name "detect_human_reault_3.png" :path "detect_human_reault_3.png" :last_modified "2018-03-02T07:26:39.496720Z" :created "2018-03-02T07:26:39.704420Z" :content nil :format nil ...) ...) 5))

Note that in the first notebook(and the rest of notebooks), both :name and :path are main.ipynb.

I'm guessing that in ein:notebooklist-find-server-by-notebook-name, (format "%s/%s" (plist-get note :path) (plist-get note :name)) formats the return string into main.ipynb/main.ipynb.

Is it a bug or I did something wrong?

Thanks 😄

millejoh commented 6 years ago

Sounds like a bug to me. Could you do me a favor and open an issue at millejoh/emacs-ipython-notebook? That is where all the active EIN development is happening these days. Thank you!

John

On Mar 8, 2018, at 12:54 AM, Yuan Fu notifications@github.com wrote:

When I try to use ein:notebooklist-open-notebook-by-file-name to open a notebook buffer, error in title pops up.

Command I run: (ein:notebooklist-open-notebook-by-file-name "main.ipynb)

Expected behavier: a notebook buffer opens.

Observed behavier: Error occurs.

Log: Emacs:

ein: [info] Opening notebook main.ipynb/main.ipynb... ein: [error] Content list call http://127.0.0.1:8888/api/contents/main.ipynb/main.ipynb failed with status error. Server:

[W 01:35:37.320 NotebookApp] No such file or directory: main.ipynb/main.ipynb [W 01:35:37.322 NotebookApp] 404 GET /api/contents/main.ipynb/main.ipynb (127.0.0.1) 4.77ms referer=None For some reason ein repeated filename twice. The correct filename is main.ipynb

Some test:

Evaluating

(ein:notebooklist-find-server-by-notebook-name "main.ipynb) => ("http://127.0.0.1:8888" "main.ipynb/main.ipynb")

(ein:notebooklist-list) => (#s(ein:$notebooklist "http://127.0.0.1:8888" "" ((:name "main.ipynb" :path "main.ipynb" :last_modified "2018-03-08T02:07:06.819303Z" :created "2018-03-08T02:07:06.819303Z" :content nil :format nil ...) (:name "after_sub_1.png" :path "after_sub_1.png" :last_modified "2018-03-02T06:24:41.272237Z" :created "2018-03-02T06:24:41.272237Z" :content nil :format nil ...) (:name "after_sub_2.png" :path "after_sub_2.png" :last_modified "2018-03-02T06:24:41.278780Z" :created "2018-03-02T06:24:41.278780Z" :content nil :format nil ...) (:name "after_sub_3.png" :path "after_sub_3.png" :last_modified "2018-03-02T06:24:41.287719Z" :created "2018-03-02T06:24:41.287719Z" :content nil :format nil ...) (:name "after_sub_4.png" :path "after_sub_4.png" :last_modified "2018-03-02T06:24:41.294832Z" :created "2018-03-02T06:24:41.294832Z" :content nil :format nil ...) (:name "Archive.zip" :path "Archive.zip" :last_modified "2018-02-27T19:33:43.310200Z" :created "2018-02-27T19:33:43.310200Z" :content nil :format nil ...) (:name "bg.png" :path "bg.png" :last_modified "2018-02-12T05:23:19.578146Z" :created "2018-02-12T05:23:23.811331Z" :content nil :format nil ...) (:name "bg2.png" :path "bg2.png" :last_modified "2018-02-15T03:53:34.441790Z" :created "2018-02-15T03:54:15.751011Z" :content nil :format nil ...) (:name "detect_human.py" :path "detect_human.py" :last_modified "2018-03-01T19:04:58.792211Z" :created "2018-03-01T19:04:58.792211Z" :content nil :format nil ...) (:name "detect_human_1.png" :path "detect_human_1.png" :last_modified "2018-03-01T21:48:56.841279Z" :created "2018-03-01T21:48:56.984416Z" :content nil :format nil ...) (:name "detect_human_2.png" :path "detect_human_2.png" :last_modified "2018-03-01T22:08:11.317501Z" :created "2018-03-01T22:08:11.470305Z" :content nil :format nil ...) (:name "detect_human_reault_3.png" :path "detect_human_reault_3.png" :last_modified "2018-03-02T07:26:39.496720Z" :created "2018-03-02T07:26:39.704420Z" :content nil :format nil ...) ...) 5)) Note that in the first notebook(and the rest of notebooks), both :name and :path are main.ipynb.

I'm guessing that in ein:notebooklist-find-server-by-notebook-name, (format "%s/%s" (plist-get note :path) (plist-get note :name)) formats the return string into main.ipynb/main.ipynb.

Is it a bug or I did something wrong?

Thanks 😄

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

casouri commented 6 years ago

Done in millejoh/emacs-ipython-notebook#278