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

Seems still being unable to login: "Failed to login to 8888" #109

Open yarikoptic opened 11 years ago

yarikoptic commented 11 years ago

I am running ipython 0.13.2 notebook server... I wonder how could I trigger EIN to provide more details so you could troubleshoot it, in case it works for you -- any directions would be useful. EIN v0.2.0-59-g203ff99

tkf commented 11 years ago

How did you login? M-x ein:notebooklist-login? http://tkf.github.io/emacs-ipython-notebook/#ein:notebooklist-login

I wonder how could I trigger EIN to provide more details

You can start from M-x ein:dev-bug-report-template :) Fill the section and paste it in the comment.

yarikoptic commented 11 years ago

Check list

Description of the problem you have

Steps to reproduce the problem

  1. $PWD/lisp/zeroein.el
  2. Enter Get "ein: [error] Error (error) while opening notebook list at the server 8888."
  3. M-x ein:notebooklist-login Enter enter password -- get "Failed to login to 8888"

Expected output

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

Your IPython configuration

  1. What is your IPython version? (run ipython --version): 0.13.2
  2. How do you start IPython? (e.g., ipython notebook --port 9999):

ipython notebook --pylab=inline

  1. What is your IPython notebook port number or URL?:

8888

Additional information (if any)

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-09-08 on trouble, modified by Debian"
 :emacs-bzr-version nil
 :window-system x
 :emacs-variant nil
 :os
 (:uname "Linux head1 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux
"
     :lsb-release
     "No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.0 (wheezy)
Release:    7.0
Codename:   wheezy
")
 :image-types
 (svg png gif tiff jpeg xpm postscript xbm pbm)
 :image-types-available
 (svg png gif tiff jpeg xpm postscript xbm pbm)
 :request
 (:backend curl)
 :ein
 (:version "0.2.1alpha2.203ff99"
       :source-dir "/home/yoh/proj/misc/emacs-ipython-notebook/lisp/")
 :lib
 ((:name "websocket"
     :path "~/proj/misc/emacs-ipython-notebook/lib/websocket/websocket.el"
     :featurep t
     :version-var websocket-version
     :version "0.93.1")
  (:name "request"
     :path "~/proj/misc/emacs-ipython-notebook/lib/request/request.el"
     :featurep t
     :version-var request-version
     :version "0.2.0alpha1")
  (:name "auto-complete"
     :path "~/proj/misc/emacs-ipython-notebook/lib/auto-complete/auto-complete.el"
     :featurep t
     :version-var nil
     :version nil)
  (:name "mumamo"
     :path "~/proj/misc/emacs-ipython-notebook/lib/nxhtml/util/mumamo.el"
     :featurep nil
     :version-var nil
     :version nil)
  (:name "auto-complete"
     :path "~/proj/misc/emacs-ipython-notebook/lib/auto-complete/auto-complete.el"
     :featurep t
     :version-var nil
     :version nil)
  (:name "popup"
     :path "~/proj/misc/emacs-ipython-notebook/lib/popup/popup.el"
     :featurep t
     :version-var nil
     :version nil)
  (:name "fuzzy"
     :path "~/proj/misc/emacs-ipython-notebook/lib/fuzzy/fuzzy.el"
     :featurep nil
     :version-var nil
     :version nil)
  (:name "pos-tip"
     :path "~/proj/misc/emacs-ipython-notebook/lib/pos-tip/pos-tip.el"
     :featurep nil
     :version-var nil
     :version nil)
  (:name "python"
     :path "/usr/share/emacs/23.4/lisp/progmodes/python.elc"
     :featurep nil
     :version-var nil
     :version nil)
  (:name "python-mode"
     :path "/usr/share/emacs/23.4/site-lisp/python-mode/python-mode.elc"
     :featurep nil
     :version-var nil
     :version nil)
  (:name "markdown-mode"
     :path "~/proj/misc/emacs-ipython-notebook/lib/markdown-mode/markdown-mode.el"
     :featurep nil
     :version-var nil
     :version nil)
  (:name "smartrep"
     :path "~/proj/misc/emacs-ipython-notebook/lib/smartrep/smartrep.el"
     :featurep nil
     :version-var nil
     :version nil)))
tkf commented 11 years ago

I installed IPython 0.13.2 and tried to reproduce your problem but couldn't. Here is my procedure:

ipython profile create eintest
ipython notebook --port 9999 --profile eintest --NotebookApp.password='sha1:******'

Then in another terminal:

cd PATH/TO/EIN
lisp/zeroein.el

Then in the opened Emacs:

C-g
M-x ein:notebooklist-login RET 9999 RET
M-x ein:notebooklist-open RET

Your profile might contain some stuff that EIN does not support. So, can you create a new profile to localize the problem?

Also, can you check installed version of IPython dependencies, especially tornado? Updating it could help you. I checked with these versions:

% pip search ipython tornado pyzmq jinja2 | grep -B1 INSTALLED
ipython                   - IPython: Productive Interactive Computing
  INSTALLED: 0.13.2 (latest)
--
Jinja2                    - A small but fast and easy to use stand-alone template engine written in pure python.
  INSTALLED: 2.6 (latest)
--
pyzmq                     - Python bindings for 0MQ
  INSTALLED: 13.1.0 (latest)
tornado                   - Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
  INSTALLED: 3.0.1 (latest)
yarikoptic commented 10 years ago

FWIW -- here are the versions of dependencies you have mentioned:

ii  ipython01x                      0.13.2-1~nd70+1      all                  enhanced interactive Python shell
ii  python-jinja2                   2.6-1                amd64                small but fast and easy to use stand-alone template engine
ii  python-tornado                  2.3-2                all                  scalable, non-blocking web server and tools
ii  python-zmq                      2.2.0-1              amd64                Python bindings for 0MQ library

so yes -- some of them are dated ... but I wonder if I could really troubleshoot this case - e.g. get more information from ein on what actually went wrong?

yarikoptic commented 10 years ago

aha -- it might be related also to have ipython server not listening on localhost but rather on some other interface -- in my case 10.0.0.1. So if I enter https://10.0.0.1:8888 then ipython kernel actually reacts and spits an error:

WARNING:root:SSL Error on 7: [Errno 1] _ssl.c:504: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca

Similar situation happens if I run similar build of ipython in Debian sid chroot (so dependencies are freshier). It is all I guess because ipython's SSL certificate is not signed by any known ca... but in a regular browser I just acknowledge all the security hazard associated with using ipython's certificate and proceed forward with authentication -- no such error is spitted out I believe.

tkf commented 10 years ago

I guess you should tell Emacs and curl to ignore CA but I don't know how to... Or maybe you can kind of port forward 10.0.0.1:8888 to 127.0.0.1:8888?

eefire commented 9 years ago

For me (similar setup, server listening on a non-localhost interface), this solves the issues:

$ echo insecure >> ~/.curlrc

HIH