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

Error (websocket): on-open cannot send message to a closed websocket #179

Open webe3 opened 8 years ago

webe3 commented 8 years ago

I am trying to use ein and I can open the notebook list but if I try to connect to and existing notebook or create a new one I get errors. If I click on "Open In Browser" the notebook works in the browser and I can also open directly in a browser so I know the server is running. Here is what I get for warnings:

Error (websocket): in callback on-open': Cannot send message to a closed websocket: cl-struct-websocket-frame, text, "{\"header\":{\"msg_id\":\"75652a9d-5955-46ed-9342-da406e163bbe\",\"username\":\"username\",\"session\":\"8cb8e144-22d4-4d45-bd09-2cdc19729c85\",\"msg_type\":\"execute_request\"},\"metadata\":{},\"content\":{\"code\":\"__import__('sys').path.append('\\/home\\/brente\\/.emacs.d\\/el-get\\/ein\\/lisp\\/')\",\"silent\":true,\"user_variables\":[],\"user_expressions\":{},\"allow_stdin\":true},\"parent_header\":{}}", nil, t Error (websocket): in callbackon-open': Wrong type argument: arrayp, nil Error (websocket): in callback on-close': Wrong type argument: arrayp, nil Error (websocket): in callbackon-open': Cannot send message to a closed websocket: cl-struct-websocket-frame, text, "{\"header\":{\"msg_id\":\"dcd591ad-f2d9-45d0-9eaf-b541dad261e3\",\"username\":\"username\",\"session\":\"dbabd36f-f558-45c0-be9c-549bfa6bfb72\",\"msg_type\":\"execute_request\"},\"metadata\":{},\"content\":{\"code\":\"import('sys').path.append('\/home\/brente\/.emacs.d\/el-get\/ein\/lisp\/')\",\"silent\":true,\"user_variables\":[],\"user_expressions\":{},\"allow_stdin\":true},\"parent_header\":{}}", nil, t Error (websocket): in callback on-open': Wrong type argument: arrayp, nil Error (websocket): in callbackon-close': Wrong type argument: arrayp, nil

Here is what I get in ein:log-all:

[verbose] Error thrown: (error http 404) @#<buffer scratch> [error] Kernelspc query call failed with status error. @#<buffer scratch> [info] Opened notebook list at 8888 with path @#<buffer ein:notebooklist 8888> [info] Opening notebook Brent Spark.ipynb... @#<buffer ein:notebooklist 8888> [error] Do not currently support nbformat version nil @#<buffer ein:notebooklist 8888> [info] Kernel started: 3c170545-bb91-435e-be4f-e8b9e14f5401 @#<buffer ein:notebooklist 8888> [info] Starting WS channels: "ws://127.0.0.1:8888/api/kernels/3c170545-bb91-435e-be4f-e8b9e14f5401" @#<buffer ein:notebooklist 8888> [verbose] Error thrown: (error http 404) @#<buffer ein:notebooklist 8888> [error] Kernelspc query call failed with status error. @#<buffer ein:notebooklist 8888> [info] Opened notebook list at 8888 with path @#<buffer ein:notebooklist 8888> [verbose] Error thrown: (error http 404) @#<buffer scratch> [error] Kernelspc query call failed with status error. @#<buffer scratch> [info] Opened notebook list at http://localhost:8888 with path @#<buffer ein:notebooklist http://localhost:8888> [info] Opening notebook Brent Spark.ipynb... @#<buffer ein:notebooklist http://localhost:8888> [error] Do not currently support nbformat version nil @#<buffer ein:notebooklist http://localhost:8888> [info] Kernel started: 3c170545-bb91-435e-be4f-e8b9e14f5401 @#<buffer ein:notebooklist http://localhost:8888> [info] Starting WS channels: "ws://localhost:8888/api/kernels/3c170545-bb91-435e-be4f-e8b9e14f5401" @#<buffer ein:notebooklist http://localhost:8888> [verbose] Error thrown: (error http 404) @#<buffer ein:notebooklist http://localhost:8888> [error] Kernelspc query call failed with status error. @#<buffer ein:notebooklist http://localhost:8888> [info] Opened notebook list at http://localhost:8888 with path @#<buffer ein:notebooklist http://localhost:8888> [verbose] Error thrown: (error http 404) @#<buffer ein:notebooklist http://localhost:8888> [error] Kernelspc query call failed with status error. @#<buffer ein:notebooklist http://localhost:8888> [info] Opened notebook list at http://localhost:8888 with path @#<buffer ein:notebooklist http://localhost:8888> [info] Opening notebook Untitled0.ipynb... @#<buffer ein:notebooklist http://localhost:8888> [error] Do not currently support nbformat version nil @#<buffer ein:notebooklist http://localhost:8888> [info] Kernel started: fb1094ba-bced-4e5b-abfc-3c72c90ddac0 @#<buffer ein:notebooklist http://localhost:8888> [info] Starting WS channels: "ws://localhost:8888/api/kernels/fb1094ba-bced-4e5b-abfc-3c72c90ddac0" @#<buffer ein:notebooklist http://localhost:8888> [verbose] Error thrown: (error http 404) @#<buffer ein:notebooklist http://localhost:8888> [error] Kernelspc query call failed with status error. @#<buffer ein:notebooklist http://localhost:8888> [info] Opened notebook list at http://localhost:8888 with path @#<buffer ein:notebooklist http://localhost:8888>

Any idea what is wrong?

emacs version: 24.4.1 ipython version: 2.3.0-2 request.el version:0.2.0 ein version: don't know how to tell I used el-get websocket: don't know how to tell I used el-get

millejoh commented 8 years ago

Yes, it does, thank you for the detailed info. I haven't tested against IPython 2.x is some time and it looks like there have been a number of regressions. Is moving to IPython 3.x or Jupyter an option? I do intend to try to fix this, if nothing else than for my honor, but it might be faster to upgrade than waiting for me to figure out what I broke.

I'm going to move this over to millejoh/emacs-ipython-notebook since that is the official repository in this day and age.

millejoh commented 8 years ago

See millejoh/emacs-ipython-notebook#98.

webe3 commented 8 years ago

On Fri, 2016-04-15 at 11:23 -0700, John Miller wrote:

Yes, it does, thank you for the detailed info. I haven't tested against IPython 2.x is some time and it looks like there have been a number of regressions. Is moving to IPython 3.x or Jupyter an option? I do intend to try to fix this, if nothing else than for my honor, but it might be faster to upgrade than waiting for me to figure out what I broke. I'm going to move this over to millejoh/emacs-ipython-notebook since that is the official repository in this day and age. — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

I am on Debian and I don't think IPython 3.x is even in unstable.  I don't know how easy it would be to get an IPython 3.x .deb.  Jupyter is also not in Debian.  I'm not sure why IPython is so far behind on Debian.  I was really looking forward to using this in emacs since using the notebook as is is lacking.

millejoh commented 8 years ago

I think I fixed this. Easier than I thought it would be. I think el-get pulls directly from Github, so you should see these fixes as soon as you update. Good luck!