Reputation: 153531
This is what I did:
remote.server$ ipython notebook --no-browser --port=8889
local$ ssh -v -N -L localhost:8888:localhost:8889 remote.server
Then I tried to launch it with localhost:8888
. But on the remote server, there is this error:
[E 21:41:40.853 NotebookApp] Uncaught exception in write_error
Traceback (most recent call last):
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/tornado/web.py", line 976, in send_error
self.write_error(status_code, **kwargs)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 315, in write_error
html = self.render_template('%s.html' % status_code, **ns)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 253, in render_template
ns.update(self.template_namespace)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 263, in template_namespace
logged_in=self.logged_in,
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 95, in logged_in
user = self.get_current_user()
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/base/handlers.py", line 83, in get_current_user
return self.login_handler.get_user(self)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/IPython/html/auth/login.py", line 70, in get_user
user_id = handler.get_secure_cookie(handler.cookie_name)
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/tornado/web.py", line 637, in get_secure_cookie
self.require_setting("cookie_secret", "secure cookies")
File "/home/zhxu5194/miniconda/envs/test/lib/python2.7/site-packages/tornado/web.py", line 1294, in require_setting
"application to use %s" % (name, feature))
Exception: You must define the 'cookie_secret' setting in your application to use secure cookies
And nothing showed up in the webpage. I did the same thing for another server and it worked. What is the problem for this server and how to fix it?
I am using virtual environment from miniconda. The versions are:
ipython 3.2.1 py27_0
ipython-notebook 3.2.1 py27_0
jinja2 2.7.3 py27_1
tornado 4.2 py27_0
zeromq 4.0.5 0
Upvotes: 2
Views: 732
Reputation: 31
I've resolve this problem by reading Jupyter notebook official documents.
1.run
jupyter notebook --generate-config
2.Then you will get
jupyter_notebook_config.py
in '.jupyter'.
3.open
jupyter_notebook_config.py
and write
c.NotebookApp.cookie_secret = b'anything'
and it will work
Upvotes: 3
Reputation: 2194
Ok, so I looked into it a bit, seems like the automatic generation of the cookie secret somehow fails. What you can do to resolve this issue though, is to run:
ipython profile create
And then open this file (it shows you the exact location):
[ProfileCreate] Generating default config file: '/home/username/.ipython/profile_default/ipython_config.py'
...
with your favorite text editor. At the end of the file append:
c.NotebookApp.cookie_secret = b"your secret that should not be on the internet"
And it should work.
If the browser still won't load the page, force refresh with Ctrl+F5
Upvotes: 0