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

Opening notebook with inline image result in error: ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' #121

Closed
fzhang00 opened this issue Jul 5, 2013 · 13 comments · May be fixed by #122
Labels

Comments

@fzhang00
Copy link

fzhang00 commented Jul 5, 2013

Hi,

I had ein 20130611 installed on EMACS 24.3.1 through "marmalade, on 64 bit Windows 7.

When I open a notebook with inline plots, I got the following messages and the notebook would not open in emacs:

Contacting host: 127.0.0.1:8888 [2 times]
ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352
ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352"
ein: [info] Unknown event: status_busy.Kernel [2 times]
ein: [info] Unknown event: status_idle.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel

On the ipython notebook server side, it says

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Notebook without images would open, but server side displays the same error message.

My installed packages are

python 2.7.5
ipython 1.0-dev
pyzmq==13.1.0
tornado==3.1

Any idea which package this error is related to? I had the same configuration on a 32 bit machine, and it works fine. Also the browser interface works fine for the notebook. But I would really like to get the Emacs bit working.

Thanks in advance for any tip.

Fan

@tkf
Copy link
Owner

tkf commented Jul 5, 2013

Please use M-x ein:dev-bug-report-template to write a bug report.

@EvanMisshula
Copy link

For what it is worth...It is working for me. Emacs version 24.3.1 and
ein-20130611.1651/

Python packages
ampl - 0.1 - active
ipdb - 0.7 - active
ipython - 0.13.2 - active
matplotlib - 1.2.1 - active
nose - 1.3.0 - active
numpy - 1.7.1 - active
pandas - 0.11.0 - active
pip - 1.3.1 - active
python-dateutil - 2.1 - active
pytz - 2013b - active
pyzmq - 13.1.0 - active
readline - 6.2.4.1 - active
scipy - 0.12.0 - active
setuptools - 0.6c11 - active
six - 1.3.0 - active
sympy - 0.7.2 - active
tornado - 3.0.2 - active
wsgiref - 0.1.2 - active development
(/home/evan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7)
yolk - 0.4.3 - active
youtube-dl - 2013.06.21 - active

Best,
Evan

On Fri, Jul 5, 2013 at 10:38 AM, Takafumi Arakaki
notifications@github.comwrote:

Please use M-x ein:dev-bug-report-template to write a bug report.


Reply to this email directly or view it on GitHubhttps://github.com//issues/121#issuecomment-20522133
.

Evan Misshula
Doctoral Student (Criminal Justice)
CUNY John Jay
"Let us reform our schools, and we shall find little reform needed in our
prisons."
John Ruskin, Unto This Last, essay 2 (1862)
English critic, essayist, & reformer (1819 - 1900)

"Instruction does much, but encouragement does everything." Johann Wolfgang
Von Goethe
www.snrg-nyc.org

@fzhang00
Copy link
Author

fzhang00 commented Jul 5, 2013

Here is the bug report.

Check list

  • I read "Avoid standard Emacs traps" section in
    https://github.com/tkf/emacs-ipython-notebook/blob/master/CONTRIBUTING.md
  • I checked that IPython works with the browser interface.
  • I checked that the problem was not due to badly compiled
    files. Removing *.elc files from source directory of EIN and
    its dependencies did not solve the problem.
  • I checked that the libraries are loaded from intended place.
    (You can check the location in the "System info" section below)

Description of the problem you have

When I open a notebook with inline plots, I got the following messages and the notebook would not open in emacs:

Contacting host: 127.0.0.1:8888 [2 times]
ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352
ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352"
ein: [info] Unknown event: status_busy.Kernel [2 times]
ein: [info] Unknown event: status_idle.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel

On the ipython notebook server side, it says

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Notebook without images would open, but server side displays the same error message. Running zeroein.el according to the quick try instruction result in the same error

My installed packages are

python 2.7.5
ipython 1.0-dev
pyzmq==13.1.0
tornado==3.1

Steps to reproduce the problem

On Windows 7 Pro x64

  1. Install winPython 2.7.5 for windows 64 bit, and register it to Windows
  2. Install ipython 1.0 dev from github
    $> git clone --recursive git://github.com/ipython/ipython.git
    $> cd ipython
    $> python setup.py install
  3. Start ipython notebook by
    ipython notebook
  4. In Emacs,
    M-x ein:notebooklist-open
    Then click the [open] link in the notebook list
    ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
    2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Expected output

For notebook with saved inline plots, it would not open in emacs.
Minibuffer shows
Contacting host: 127.0.0.1:8888 [2 times]
ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352
ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352"
ein: [info] Unknown event: status_busy.Kernel [2 times]
ein: [info] Unknown event: status_idle.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel
In ipython notebook server, it shows
ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Your EIN configuration (in .emacs.d/init.el or somewhere else)

; use ein
(require 'request)
(require 'ein)

Your IPython configuration

  1. What is your IPython version? (run ipython --version):
    ipython 1.0-dev
  2. How do you start IPython? (e.g., ipython notebook --port 9999):
    on command prompt: ipython notebook
  3. What is your IPython notebook port number or URL?:
    8888

Additional information (if any)

System info:

("EIN system info"
 :emacs-version "GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN"
 :emacs-bzr-version nil
 :window-system w32
 :emacs-variant nil
 :os
 (:uname nil
         :lsb-release nil)
 :image-types
 (png gif tiff jpeg xpm xbm pbm)
 :image-types-available
 (xpm xbm pbm)
 :request
 (:backend url-retrieve)
 :ein
 (:version "0.2.1alpha2"
           :source-dir "d:/HOME/.emacs.d/elpa/ein-20130611.1651/")
 :lib
 ((:name "websocket"
         :path "~/.emacs.d/elpa/websocket-20130508.2229/websocket.elc"
         :featurep t
         :version-var websocket-version
         :version "1.0")
  (:name "request"
         :path "~/.emacs.d/elpa/request-20130526.1915/request.elc"
         :featurep t
         :version-var request-version
         :version "0.2.0")
  (:name "auto-complete"
         :path "~/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "auto-complete"
         :path "~/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "popup"
         :path "~/.emacs.d/elpa/popup-20130324.1305/popup.elc"
         :featurep t
         :version-var popup-version
         :version "0.5.0")
  (:name "fuzzy"
         :path "~/.emacs.d/elpa/fuzzy-20120323.1044/fuzzy.elc"
         :featurep nil
         :version-var nil
         :version nil)
  (:name "python"
         :path "c:/emacs-24.3/lisp/progmodes/python.elc"
         :featurep t
         :version-var nil
         :version nil)))

@tkf
Copy link
Owner

tkf commented Jul 5, 2013

@EvanMisshula Thanks for the info.
@fzhang00 Thanks for the report.

This is a tough one. I can only guess.

  • I am wondering why you have Contacting host: 127.0.0.1:8888 [2 times]. In any case you double clicked the [open] link? Or you focus it by cursor and hit enter?
  • As you are using dev version of IPython, I want to know if you tried EIN with stable version like 0.13.2. But I don't think it makes difference as I am running test with IPython dev versions and recent builds are all green . There could be something incompatible only for windows, though.
  • Is it possible to use curl command line program in windows?
    Using curl is always better than using url.el (default Emacs library).
    You may need to tweak request-curl:
    http://tkf.github.io/emacs-request/manual.html#request-curl

@fzhang00
Copy link
Author

fzhang00 commented Jul 5, 2013

  • I check the variable request-curl, and it is set to "curl".
  • Yes. I hit [open] twice. But not a double click. I clicked it once, saw the message in minibuffer, then tried a second time. Same message show again, but in *Message* buffer, it displayed the Contacting host: 127.0.0.1:8888 [2 times] and [info] message once only.

@EvanMisshula
Copy link

Fan, How are you starting ipython? (eg, $ipython notebook --pylab=inline)

Thanks,
Evan

On Fri, Jul 5, 2013 at 12:42 PM, Fan Zhang notifications@github.com wrote:

Here is the bug report.
Check list

  • I read "Avoid standard Emacs traps" section in
    https://github.com/tkf/emacs-ipython-notebook/blob/master/CONTRIBUTING.md
  • I checked that IPython works with the browser interface.
  • I checked that the problem was not due to badly compiled files.
    Removing *.elc files from source directory of EIN and its dependencies
    did not solve the problem.
  • I checked that the libraries are loaded from intended place. (You
    can check the location in the "System info" section below)

Description of the problem you have

When I open a notebook with inline plots, I got the following messages and
the notebook would not open in emacs:

Contacting host: 127.0.0.1:8888 [2 times]
ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352
ein: [info] Starting WS: "ws://
127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352"
ein: [info] Unknown event: status_busy.Kernel [2 times]
ein: [info] Unknown event: status_idle.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel

On the ipython notebook server side, it says

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Notebook without images would open, but server side displays the same
error message. Running zeroein.el according to the quick try instruction
result in the same error

My installed packages are

python 2.7.5
ipython 1.0-dev
pyzmq==13.1.0
tornado==3.1
Steps to reproduce the problem

On Windows 7 Pro x64

  1. Install winPython 2.7.5 for windows 64 bit, and register it to Windows
  2. Install ipython 1.0 dev from github
    $> git clone --recursive git://github.com/ipython/ipython.git
    $> cd ipython
    $> python setup.py install
  3. Start ipython notebook by
    ipython notebook
  4. In Emacs,
    M-x ein:notebooklist-open
    Then click the [open] link in the notebook list

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Expected output

For notebook with saved inline plots, it would not open in emacs.
Minibuffer shows
Contacting host: 127.0.0.1:8888 [2 times]
ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352
ein: [info] Starting WS: "ws://
127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352"
ein: [info] Unknown event: status_busy.Kernel [2 times]
ein: [info] Unknown event: status_idle.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel
In ipython notebook server, it shows

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - ''
2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Your EIN configuration (in .emacs.d/init.el or somewhere else)

; use ein
(require 'request)
(require 'ein)
Your IPython configuration

  1. What is your IPython version? (run ipython --version): ipython
    1.0-dev
  2. How do you start IPython? (e.g., ipython notebook --port 9999): on
    command prompt: ipython notebook
  3. What is your IPython notebook port number or URL?: 8888

Additional information (if any) System info:

("EIN system info"
:emacs-version "GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN"
:emacs-bzr-version nil
:window-system w32
:emacs-variant nil
:os
(:uname nil
:lsb-release nil)
:image-types
(png gif tiff jpeg xpm xbm pbm)
:image-types-available
(xpm xbm pbm)
:request
(:backend url-retrieve)
:ein
(:version "0.2.1alpha2"
:source-dir "d:/HOME/.emacs.d/elpa/ein-20130611.1651/")
:lib
((:name "websocket"
:path "/.emacs.d/elpa/websocket-20130508.2229/websocket.elc"
:featurep t
:version-var websocket-version
:version "1.0")
(:name "request"
:path "
/.emacs.d/elpa/request-20130526.1915/request.elc"
:featurep t
:version-var request-version
:version "0.2.0")
(:name "auto-complete"
:path "/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc"
:featurep t
:version-var nil
:version nil)
(:name "auto-complete"
:path "
/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc"
:featurep t
:version-var nil
:version nil)
(:name "popup"
:path "/.emacs.d/elpa/popup-20130324.1305/popup.elc"
:featurep t
:version-var popup-version
:version "0.5.0")
(:name "fuzzy"
:path "
/.emacs.d/elpa/fuzzy-20120323.1044/fuzzy.elc"
:featurep nil
:version-var nil
:version nil)
(:name "python"
:path "c:/emacs-24.3/lisp/progmodes/python.elc"
:featurep t
:version-var nil
:version nil)))


Reply to this email directly or view it on GitHubhttps://github.com//issues/121#issuecomment-20528165
.

Evan Misshula
Doctoral Student (Criminal Justice)
CUNY John Jay
"Let us reform our schools, and we shall find little reform needed in our
prisons."
John Ruskin, Unto This Last, essay 2 (1862)
English critic, essayist, & reformer (1819 - 1900)

"Instruction does much, but encouragement does everything." Johann Wolfgang
Von Goethe
www.snrg-nyc.org

@fzhang00
Copy link
Author

fzhang00 commented Jul 5, 2013

Just simply
ipython notebook

Update:

I checked my emacs, and there seems to be no curl.el anywhere. So I downloaded it from emacs-curl and placed the curl.el under site-lisp. I also downloaded curl.exe and placed it in my emacs bin folder. This folder is on my system path. Now the ipython notebook server shows

2013-07-05 13:47:31.806 [NotebookApp] Connecting to: tcp://127.0.0.1:50694
ERROR:root:First ws message didn't have the form 'identity:[cookie]' - 'username
-127.0.0.1-8889=; username-127.0.0.1-8888=; username='

emacs give me

ein: [info] Opened notebook list at 8888
ein: [info] Opening notebook 64ad8477-fe5f-4926-8fee-8ff2f541bab0...
ein: [info] Kernel started: 61420779-35d3-418f-bf1a-ef21d5a99850
ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/61420779-35d3-418f-bf1a-ef21d5a99850"
ein: [info] Unknown event: status_busy.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel

@EvanMisshula
Copy link

No that should still work.

:-(

On Fri, Jul 5, 2013 at 1:59 PM, Fan Zhang notifications@github.com wrote:

Just simply
ipython notebook

Update:

I checked my emacs, and there seems to be no curl.el anywhere. So I
downloaded it from emacs-curl and placed the curl.el under site-lisp. I
also downloaded curl.exe and placed it in my emacs bin folder. This folder
is on my system path. Now the ipython notebook server shows

2013-07-05 13:47:31.806 [NotebookApp] Connecting to: tcp://127.0.0.1:50694
ERROR:root:First ws message didn't have the form 'identity:[cookie]' -
'username
-127.0.0.1-8889=; username-127.0.0.1-8888=; username='

emacs give me

ein: [info] Opened notebook list at 8888
ein: [info] Opening notebook 64ad8477-fe5f-4926-8fee-8ff2f541bab0...
ein: [info] Kernel started: 61420779-35d3-418f-bf1a-ef21d5a99850
ein: [info] Starting WS: "ws://
127.0.0.1:8888/kernels/61420779-35d3-418f-bf1a-ef21d5a99850"

ein: [info] Unknown event: status_busy.Kernel
ein: [info] Unknown event: execution_count.Kernel
ein: [info] Unknown event: status_idle.Kernel

Reply to this email directly or view it on GitHubhttps://github.com//issues/121#issuecomment-20531527
.

Evan Misshula
Doctoral Student (Criminal Justice)
CUNY John Jay
"Let us reform our schools, and we shall find little reform needed in our
prisons."
John Ruskin, Unto This Last, essay 2 (1862)
English critic, essayist, & reformer (1819 - 1900)

"Instruction does much, but encouragement does everything." Johann Wolfgang
Von Goethe
www.snrg-nyc.org

@fzhang00
Copy link
Author

An update:

I re-install winpython 64bit, which comes with ipython 0.13.2, and it worked. Notebook can be opened in Emacs, and plots displayed properly.

However, I really love to have ipython 1.0 dev working, which allow for switching plotting backend.

@tkf
Copy link
Owner

tkf commented Jul 10, 2013

Great. Thanks for checking that. I'll try to infer the bug from the error log you posted. But as I said it is working fine in Linux I don't know if I can find the fix. Give me sometime.

BTW, reqeust.el does not use curl.el. It uses curl command line program directly.

tkf added a commit that referenced this issue Jul 10, 2013
IPython changed the way to start channel [1].
fixes #121

[1] see commit ipython/ipython@24dcb6b
in ipython/ipython#3089
@tkf
Copy link
Owner

tkf commented Jul 10, 2013

Actually the error log was informative. I think #122 fixed the problem. However, if we pull #122 it will stop working for IPython < 1.0 if you use password protected connection. As IPython 1.0 is not released yet, I am not sure if we want to pull it now. It is simple to add an option to switch 1.0/pre-1.0, though. But I'd like to know if it really fixes the problem.

@fzhang00 Can you check that #122 fixes your problem? You can (1) download ein-kernel.el from #122, (2) replace it with your ein-kernel.el, (3) remove ein-kernel.elc if you have it and (4) restart Emacs.

@fzhang00
Copy link
Author

The fix from #122 is working with the ipython 1.0 dev downloaded today.

@tkf
Copy link
Owner

tkf commented Jul 12, 2013

Thank you for checking!

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

Successfully merging a pull request may close this issue.

3 participants