Code Monkey home page Code Monkey logo

jupyterhub's Introduction

Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources


Latest PyPI version Latest conda-forge version Documentation build status GitHub Workflow Status - Test Test coverage of code GitHub Discourse Gitter

With JupyterHub you can create a multi-user Hub that spawns, manages, and proxies multiple instances of the single-user Jupyter notebook server.

Project Jupyter created JupyterHub to support many users. The Hub can offer notebook servers to a class of students, a corporate data science workgroup, a scientific research project, or a high-performance computing group.

Technical overview

Three main actors make up JupyterHub:

  • multi-user Hub (tornado process)
  • configurable http proxy (node-http-proxy)
  • multiple single-user Jupyter notebook servers (Python/Jupyter/tornado)

Basic principles for operation are:

  • Hub launches a proxy.
  • The Proxy forwards all requests to Hub by default.
  • Hub handles login and spawns single-user servers on demand.
  • Hub configures proxy to forward URL prefixes to the single-user notebook servers.

JupyterHub also provides a REST API for administration of the Hub and its users.

Installation

Check prerequisites

  • A Linux/Unix based system

  • Python 3.8 or greater

  • nodejs/npm

    • If you are using conda, the nodejs and npm dependencies will be installed for you by conda.

    • If you are using pip, install a recent version (at least 12.0) of nodejs/npm.

  • If using the default PAM Authenticator, a pluggable authentication module (PAM).

  • TLS certificate and key for HTTPS communication

  • Domain name

Install packages

Using conda

To install JupyterHub along with its dependencies including nodejs/npm:

conda install -c conda-forge jupyterhub

If you plan to run notebook servers locally, install JupyterLab or Jupyter notebook:

conda install jupyterlab
conda install notebook

Using pip

JupyterHub can be installed with pip, and the proxy with npm:

npm install -g configurable-http-proxy
python3 -m pip install jupyterhub

If you plan to run notebook servers locally, you will need to install JupyterLab or Jupyter notebook:

python3 -m pip install --upgrade jupyterlab
python3 -m pip install --upgrade notebook

Run the Hub server

To start the Hub server, run the command:

jupyterhub

Visit http://localhost:8000 in your browser, and sign in with your system username and password.

Note: To allow multiple users to sign in to the server, you will need to run the jupyterhub command as a privileged user, such as root. The wiki describes how to run the server as a less privileged user, which requires more configuration of the system.

Configuration

The Getting Started section of the documentation explains the common steps in setting up JupyterHub.

The JupyterHub tutorial provides an in-depth video and sample configurations of JupyterHub.

Create a configuration file

To generate a default config file with settings and descriptions:

jupyterhub --generate-config

Start the Hub

To start the Hub on a specific url and port 10.0.1.2:443 with https:

jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert

Authenticators

Authenticator Description
PAMAuthenticator Default, built-in authenticator
OAuthenticator OAuth + JupyterHub Authenticator = OAuthenticator
ldapauthenticator Simple LDAP Authenticator Plugin for JupyterHub
kerberosauthenticator Kerberos Authenticator Plugin for JupyterHub

Spawners

Spawner Description
LocalProcessSpawner Default, built-in spawner starts single-user servers as local processes
dockerspawner Spawn single-user servers in Docker containers
kubespawner Kubernetes spawner for JupyterHub
sudospawner Spawn single-user servers without being root
systemdspawner Spawn single-user notebook servers using systemd
batchspawner Designed for clusters using batch scheduling software
yarnspawner Spawn single-user notebook servers distributed on a Hadoop cluster
wrapspawner WrapSpawner and ProfilesSpawner enabling runtime configuration of spawners

Docker

A starter docker image for JupyterHub gives a baseline deployment of JupyterHub using Docker.

Important: This quay.io/jupyterhub/jupyterhub image contains only the Hub itself, with no configuration. In general, one needs to make a derivative image, with at least a jupyterhub_config.py setting up an Authenticator and/or a Spawner. To run the single-user servers, which may be on the same system as the Hub or not, Jupyter Notebook version 4 or greater must be installed.

The JupyterHub docker image can be started with the following command:

docker run -p 8000:8000 -d --name jupyterhub quay.io/jupyterhub/jupyterhub jupyterhub

This command will create a container named jupyterhub that you can stop and resume with docker stop/start.

The Hub service will be listening on all interfaces at port 8000, which makes this a good choice for testing JupyterHub on your desktop or laptop.

If you want to run docker on a computer that has a public IP then you should (as in MUST) secure it with ssl by adding ssl options to your docker configuration or by using an ssl enabled proxy.

Mounting volumes will allow you to store data outside the docker image (host system) so it will be persistent, even when you start a new image.

The command docker exec -it jupyterhub bash will spawn a root shell in your docker container. You can use the root shell to create system users in the container. These accounts will be used for authentication in JupyterHub's default configuration.

Contributing

If you would like to contribute to the project, please read our contributor documentation and the CONTRIBUTING.md. The CONTRIBUTING.md file explains how to set up a development installation, how to run the test suite, and how to contribute to documentation.

For a high-level view of the vision and next directions of the project, see the JupyterHub community roadmap.

A note about platform support

JupyterHub is supported on Linux/Unix based systems.

JupyterHub officially does not support Windows. You may be able to use JupyterHub on Windows if you use a Spawner and Authenticator that work on Windows, but the JupyterHub defaults will not. Bugs reported on Windows will not be accepted, and the test suite will not run on Windows. Small patches that fix minor Windows compatibility issues (such as basic installation) may be accepted, however. For Windows-based systems, we would recommend running JupyterHub in a docker container or Linux VM.

Additional Reference: Tornado's documentation on Windows platform support

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

All code is licensed under the terms of the revised BSD license.

Help and resources

We encourage you to ask questions and share ideas on the Jupyter community forum. You can also talk with us on our JupyterHub Gitter channel.

JupyterHub follows the Jupyter Community Guides.


Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources

jupyterhub's People

Contributors

0mar avatar alwasega avatar betatim avatar carreau avatar cbjuan avatar choldgraf avatar christiandike avatar consideratio avatar dependabot[bot] avatar dtaniwaki avatar georgianaelena avatar ivanah8 avatar jgwerner avatar kafonek avatar krassowski avatar manics avatar minrk avatar mouse1203 avatar naatebarber avatar narekairbnb avatar nicorikken avatar pre-commit-ci[bot] avatar rcthomas avatar rgbkrk avatar rkdarst avatar ssanderson avatar tgmachina avatar vladfreeze avatar willingc avatar yuvipanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyterhub's Issues

Cleaning up single-user servers fails under restricted sudo

When shutting down (control+c, or via kill) the jupyterhub doesn't seem to be able to shutdown the singleuser server. Here is an example, showing it trying, timing out, and then manually killing 9049 (different from 9048--- off by one error?):

^C
Interrupted
[I 19:10:04.842 JupyterHubApp] Cleaning up single-user servers...
[I 19:10:04.844 JupyterHubApp] Cleaning up proxy[9039]...
[W 19:10:24.862 JupyterHubApp] Process 9048 never died
[I 19:10:24.862 JupyterHubApp] ...done
dblank@jupyter:~/jupyterhub$ ps
  PID TTY          TIME CMD
 8411 pts/14   00:00:00 bash
 9049 pts/14   00:00:00 jupyterhub-sing
 9065 pts/14   00:00:00 ps
dblank@jupyter:~/jupyterhub$ kill 9049
dblank@jupyter:~/jupyterhub$ [C 19:10:39.735 SingleUserNotebookApp] received signal 15, stopping
[I 19:10:39.735 SingleUserNotebookApp] Shutting down kernels

handle proxy failing to start

if you start two servers on the same port, it's the proxy that fails to start. The Hub should check if the proxy exists, and maybe restart it if it goes down.

migration of sqlite file

Got that doing a demo today, fixed by removing the jupyterhub.sqlite

Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
    context)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such column: users.last_activity

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/jupyterhub", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/bussonniermatthias/jupyterhub/scripts/jupyterhub", line 4, in <module>
    main()
  File "/Users/bussonniermatthias/ipython/IPython/config/application.py", line 563, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/bussonniermatthias/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/bussonniermatthias/jupyterhub/jupyterhub/app.py", line 706, in initialize
    self.init_users()
  File "/Users/bussonniermatthias/jupyterhub/jupyterhub/app.py", line 465, in init_users
    if admins.first() is None:
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2367, in first
    ret = list(self[0:1])
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2228, in __getitem__
    return list(res)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2438, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2453, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 729, in execute
    return meth(self, multiparams, params)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
    context)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1159, in _handle_dbapi_exception
    exc_info
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 188, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 181, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
    context)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) no such column: users.last_activity 'SELECT users.id AS users_id, users.name AS users_name, users._server_id AS users__server_id, users.admin AS users_admin, users.last_activity AS users_last_activity, users.cookie_id AS users_cookie_id, users.state AS users_state \nFROM users \nWHERE users.admin = 1\n LIMIT ? OFFSET ?' (1, 0)

make authentication configurable

A single function ought to be the best, but it's possible that IPython configuration will push us toward classes.

We might want to make customization of the login form easier than it is in single-user IPython, which requires subclassing the application.

Dashboard stopped displaying files and folders

I've been running jupyterhub for a few hours now on a public-facing website on port 80, with a few users logging in. The only major issue I have seen is that for one user the dashboard stopped showing the folder and file listings so that you could not click on them to select to open. If you knew the name of a notebook, you could enter the URL directly, but otherwise couldn't get to existing files and folders.

I started jupyterhub on a different terminal, so I can't get to any error messages right now. I've restarted it to see if it occurs again. Would be great to have a /var/log/jupyterhub output.

TypeError: Cannot read property 'target' of undefined

Attempting to run latest of configurable-http-proxy, ipython, and jupyterhub results in:

$ jupyterhub --LocalProcessSpawner.set_user=sudo --ip=165.106.10.83 --port=80
/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py:573: SAWarning: Unicode type received non-unicodebind param value.
  param.append(processors[key](compiled_params[key]))
[I 14:47:33.387 JupyterHubApp] Starting proxy: [u'configurable-http-proxy', '--ip', u'165.106.10.83', '--port', '80', '--api-ip', u'localhost', '--api-port', '81', '--default-target', 'http://localhost:8081']
Proxying http://165.106.10.83:80 to http://localhost:8081
Proxy API at http://localhost:81/api/routes
Error in handler for GET /hub/login?next=%2Fhub%2F:  [TypeError: Cannot read property 'target' of undefined]

Any ideas?

Running kernel became disassociated from dashboard

After running for about 24 hours, a kernel was still running, but the dashboard no longer showed a "shutdown" button, and no longer listed it under the "Running" tab. Looks like the connection between dashboard and kernel timed out, as everything was still working fine.

Missing zmq and jsonschema

It seems like two additional dependencies are missing.

Traceback (most recent call last):
  File "/home/stanleygu/.virtualenvs/localpy/src/ipython/IPython/utils/zmqrelated.py", line 35, in check_for_zmq
    import zmq
ImportError: No module named 'zmq'
Traceback (most recent call last):
  File "/home/stanleygu/.virtualenvs/localpy/src/ipython/IPython/nbformat/validator.py", line 10, in <module>
    from jsonschema import ValidationError
ImportError: No module named 'jsonschema'

Permission issues in users' .ipython folders

Hello,
Just writing to find out what I can do about the error below. I'm running jupyterhub as root. I think the problem is that Jupyterhub is creating directories in the user's home directory with ownership root.root. When the iPython notebook instance starts up and is running as the local user, in this case, jordantrc, it's unable to read or write to the folders in .ipython with root:root permissions.

# jupyterhub --ip 192.168.9.10 --port 8443 --ssl-key ssl/jupyterhub.key --ssl-cert ssl/jupyterhub.crt
[I 09:36:39.698 JupyterHubApp] Loading cookie_secret from /etc/jupyterhub/jupyterhub_cookie_secret
[W 09:36:39.764 JupyterHubApp]
    Generating CONFIGPROXY_AUTH_TOKEN. Restarting the Hub will require restarting the proxy.
    Set CONFIGPROXY_AUTH_TOKEN env or JupyterHubApp.proxy_auth_token config to avoid this message.

[I 09:36:39.774 JupyterHubApp] Not using whitelist. Any authenticated user will be allowed.
[I 09:36:39.793 JupyterHubApp] Starting proxy @ http://192.168.9.10:8443/
09:36:39.979 - info: [ConfigProxy] Proxying https://192.168.9.10:8443 to http://localhost:8081
09:36:39.983 - info: [ConfigProxy] Proxy API at http://localhost:8444/api/routes
[I 09:36:46.262 JupyterHubApp] 302 GET / (127.0.0.1) 2.30ms
[E 09:36:46.315 JupyterHubApp] Could not open static file '/usr/local/share/jupyter/static/images/favicon.ico'
[I 09:36:46.318 JupyterHubApp] 200 GET /hub/ (127.0.0.1) 39.36ms
[I 09:36:46.404 JupyterHubApp] 200 GET /hub/static/css/style.min.css?v=26e5175f4cc7d7926dbab73d043d6fbe (127.0.0.1) 6.81ms
[I 09:36:46.406 JupyterHubApp] 200 GET /hub/static/images/jupyterlogo.png?v=68cb965d07a1e888b7b0bfc4914f2ec7 (127.0.0.1) 1.02ms
[I 09:36:46.408 JupyterHubApp] 200 GET /hub/static/components/requirejs/require.js?v=640929dac3c23a448d2eebc37bc32062 (127.0.0.1) 1.45ms
[W 09:36:46.552 JupyterHubApp] 404 GET /hub/static/images/favicon.ico (127.0.0.1) 0.84ms
[I 09:36:47.532 JupyterHubApp] 200 GET /hub/login (127.0.0.1) 14.50ms
[I 09:36:52.878 JupyterHubApp] Spawning ['jupyterhub-singleuser', '--user=jordantrc', '--port=54014', '--cookie-name=jupyter-hub-token-jordantrc', '--base-url=/user/jordantrc', '--hub-prefix=/hub/', '--hub-api-url=http://localhost:8081/hub/api']
Traceback (most recent call last):
  File "/usr/local/bin/jupyterhub-singleuser", line 4, in <module>
    main()
  File "/usr/local/lib/python3.4/dist-packages/jupyterhub/singleuser.py", line 128, in main
    return SingleUserNotebookApp.launch_instance()
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/config/application.py", line 563, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/html/notebookapp.py", line 870, in initialize
    super(NotebookApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/application.py", line 374, in initialize
    self.init_profile_dir()
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/application.py", line 281, in init_profile_dir
    p = ProfileDir.find_profile_dir_by_name(self.ipython_dir, self.profile, self.config)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/profiledir.py", line 230, in find_profile_dir_by_name
    return cls(location=profile_dir, config=config)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/config/configurable.py", line 83, in __init__
    super(Configurable, self).__init__(**kwargs)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/utils/traitlets.py", line 544, in __init__
    setattr(self, key, value)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/utils/traitlets.py", line 430, in __set__
    obj._notify_trait(self.name, old_value, new_value)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/utils/traitlets.py", line 581, in _notify_trait
    c(name, old_value, new_value)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/profiledir.py", line 68, in _location_changed
    self.check_dirs()
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/profiledir.py", line 159, in check_dirs
    self.check_static_dir()
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/profiledir.py", line 143, in check_static_dir
    self._mkdir(custom)
  File "/usr/local/lib/python3.4/dist-packages/src/ipython/IPython/core/profiledir.py", line 98, in _mkdir
    os.mkdir(path)
PermissionError: [Errno 13] Permission denied: '/home/jordantrc/.ipython/profile_default/static/custom'

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

Here is the directory listing:
root@walrus:/home/jordantrc/.ipython# ls -l
total 28
drwx------ 2 root root 4096 Nov 12 11:47 extensions
-rw------- 1 root root 2733 Nov 13 10:50 jupyterhub_cookie_secret
-rw------- 1 root root 8192 Nov 13 10:51 jupyterhub.sqlite
drwx------ 2 root root 4096 Nov 12 11:47 nbextensions
drwx------ 8 jordantrc domain users 4096 Nov 13 15:12 profile_default
-rw------- 1 jordantrc domain users 100 Nov 12 11:10 README

Jupyterhub and nbviewer - need some guidance

So I now have Jupyterhub running internally at eBay. That is cool - thanks @dsblank for help getting install issues sorted. I will keep testing with my small team and see how we get on.

I also installed nbviewer - another mini-adventure since it turns out there is a bug in pip that ships with 14.04 ;-)

I would like to be able to publish notebooks from the jupyterhub to nbviewer - is this possible? It appears that the jupyterhub URL is not publicly visible and I get a 404 error in nbviewer - is the best workaround to create a publicly visible www directory for each user and just copy the notebooks over when I want to publish to nbviewer? Or is there some easier way to achieve this from within nbviewer?

Any plans to have git integration in Jupyterhub?

Thanks in advance,
Matt

Jupyterhub Run via Sudo Tries to Create File

Hi,

We are attempting to run the jupyterhub as rhea, and we are getting this permission error, because rhea doesn't have a home to write this file in.

$ jupyterhub --LocalProcessSpawner.set_user=sudo --JupyterHubApp.ip=xxxxxx.xxxx --JupyterHubApp.port=80
Traceback (most recent call last):
  File "/usr/local/bin/jupyterhub", line 4, in <module>
    main()
  File "/home/ychen07/src/ipython/IPython/config/application.py", line 548, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/ychen07/src/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py", line 594, in initialize
    self.init_db()
  File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py", line 349, in init_db
    **self.db_kwargs
  File "/usr/local/lib/python2.7/dist-packages/jupyterhub/orm.py", line 381, in new_session
    Base.metadata.create_all(engine)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 3352, in create_all
    tables=tables)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1616, in _run_visitor
    with self._optional_conn_ctx_manager(connection) as conn:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1609, in _optional_conn_ctx_manager
    with self.contextual_connect() as conn:
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1799, in contextual_connect
    self.pool.connect(),
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 338, in connect
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 641, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 440, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 1118, in _do_get
    return self.connection
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 725, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 1090, in connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 411, in __init__
    self.connection = self.__connect()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 537, in __connect
    connection = self.__pool._creator()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 96, in connect
    connection_invalidated=invalidated
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 90, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 377, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None

Can't run multiuser

Should this repository be able to run? I ran the npm and pip commands, but where is requests?

$ python -m multiuser
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/dblank/jupyter/multiuser-server/multiuser/__main__.py", line 1, in <module>
    from .app import main
  File "multiuser/app.py", line 27, in <module>
    from .user import UserManager
  File "multiuser/user.py", line 11, in <module>
    import requests
ImportError: No module named requests

Too many redirects when trying to access my server

I successfully installed and logged in to the Jupyter Hub as an admin (using Python 3.4), but when I try and access 'My Server' I get a 'too many redirects' error in the browser. Every time I try and access it, the log output is:

[I 19:11:02.041 tornado.access] 302 GET /hub/user/tom/ (::1) 10.50ms
[I 19:11:02.075 tornado.access] 302 GET /user/tom/ (::1) 0.46ms
[I 19:11:02.086 tornado.access] 302 GET /hub/user/tom/ (::1) 8.38ms
[I 19:11:02.089 tornado.access] 302 GET /user/tom/ (::1) 0.34ms
[I 19:11:02.099 tornado.access] 302 GET /hub/user/tom/ (::1) 8.10ms
[I 19:11:02.101 tornado.access] 302 GET /user/tom/ (::1) 0.33ms
[I 19:11:02.113 tornado.access] 302 GET /hub/user/tom/ (::1) 8.10ms
[I 19:11:02.116 tornado.access] 302 GET /user/tom/ (::1) 0.33ms
[I 19:11:02.127 tornado.access] 302 GET /hub/user/tom/ (::1) 9.07ms
[I 19:11:02.130 tornado.access] 302 GET /user/tom/ (::1) 0.48ms
[I 19:11:02.140 tornado.access] 302 GET /hub/user/tom/ (::1) 7.72ms
[I 19:11:02.142 tornado.access] 302 GET /user/tom/ (::1) 0.31ms
[I 19:11:02.152 tornado.access] 302 GET /hub/user/tom/ (::1) 8.02ms
[I 19:11:02.155 tornado.access] 302 GET /user/tom/ (::1) 0.34ms
[I 19:11:02.164 tornado.access] 302 GET /hub/user/tom/ (::1) 8.03ms
[I 19:11:02.168 tornado.access] 302 GET /user/tom/ (::1) 0.67ms
[I 19:11:02.178 tornado.access] 302 GET /hub/user/tom/ (::1) 8.21ms

configurable-http-proxy crash: ETIMEDOUT

After many days of use, the configurable-http-proxy just crashed for the first time. This from the log:

[I 08:55:52.950 SingleUserNotebookApp] Kernel started: 91f587ab-0c01-4eae-81a3-9cf05e15e494
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing kernel-91f587ab-0c01-4eae-81a3-9cf05e15e494.json
Proxy error:  { [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect' }

/usr/local/lib/node_modules/configurable-http-proxy/lib/configproxy.js:239
        res.writeHead(502);
            ^
TypeError: Object #<Socket> has no method 'writeHead'
    at /usr/local/lib/node_modules/configurable-http-proxy/lib/configproxy.js:239:13
    at ClientRequest.onOutgoingError (/usr/local/lib/node_modules/configurable-http-proxy/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js:117:9)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at Socket.socketErrorListener (http.js:1547:9)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)

I don't know of anything special that was going on, or that happened.

Get some actual HTML

currently there are no HTML pages, just a toy login form. We need to do all the templating, etc. that IPython does, perhaps even inheriting it.

Multi-server setup

Am I correct in assuming that there are long-term plans to support multiple jupyterhub servers running as a single instance? I don't believe that this is possible right now unless I am missing something (please correct me if I'm wrong). It would be nice to have this for load balancing. Cheers!

Address family not supported by protocol

Hi, I am having trouble connecting after installing jupyterhub with my current config. This may just be a bad interaction with pyenv, or i have a misconfigured 'localhost' definition in my hosts file, however a plan run gives me the following error:

(jupyter)kotfic@carasgaladon:~/jupyter$ jupyterhub --log=DEBUG
[D 03:16:07.605 JupyterHubApp] Connecting to db: sqlite:///jupyterhub.sqlite
[I 03:16:07.659 JupyterHubApp] Not using whitelist. Any authenticated user will be allowed.
[D 03:16:07.661 JupyterHubApp] Loaded users: 
      kotfic admin
[C 03:16:07.674 JupyterHubApp] Failed to start proxy
    Traceback (most recent call last):
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/jupyterhub/app.py", line 727, in start
        IOLoop().run_sync(self.start_proxy)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/ioloop.py", line 418, in run_sync
        return future_cell[0].result()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/concurrent.py", line 109, in result
        raise_exc_info(self._exc_info)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/gen.py", line 175, in wrapper
        yielded = next(result)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/jupyterhub/app.py", line 522, in start_proxy
        if self.proxy.public_server.is_up() and \
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/jupyterhub/orm.py", line 109, in is_up
        socket.create_connection((self.ip or 'localhost', self.port))
      File "/home/kotfic/.pyenv/versions/2.7.8/lib/python2.7/socket.py", line 571, in create_connection
        raise err
    error: [Errno 97] Address family not supported by protocol

If i specify the IP on the command line the server appears to start, but I get some of these address family not supported errors when launching the actual notebook. The weird thing is the notebook appears to work fine despite these errors.

(jupyter)kotfic@carasgaladon:~/jupyter$ jupyterhub --ip=127.0.0.1 --log=DEBUG
[D 03:17:13.776 JupyterHubApp] Connecting to db: sqlite:///jupyterhub.sqlite
[I 03:17:13.844 JupyterHubApp] Not using whitelist. Any authenticated user will be allowed.
[D 03:17:13.846 JupyterHubApp] Loaded users: 
      kotfic admin
[I 03:17:13.856 JupyterHubApp] Starting proxy: [u'configurable-http-proxy', '--ip', u'127.0.0.1', '--port', '8000', '--api-ip', u'localhost', '--api-port', '8001', '--default-target', 'http://localhost:8081']
03:17:13.941 - info: [ConfigProxy] Proxying http://127.0.0.1:8000 to http://localhost:8081
03:17:13.944 - info: [ConfigProxy] Proxy API at http://localhost:8001/api/routes
[D 03:17:13.963 JupyterHubApp] Proxy started and appears to be up
[I 03:17:35.062 JupyterHubApp] 302 GET / (127.0.0.1) 0.67ms
[E 03:17:35.091 JupyterHubApp] Could not open static file u'/home/kotfic/.pyenv/versions/jupyter/share/jupyter/static/images/favicon.ico'
[I 03:17:35.092 JupyterHubApp] 200 GET /hub/ (127.0.0.1) 19.04ms
[I 03:17:35.206 JupyterHubApp] 200 GET /hub/static/images/jupyterlogo.png?v=68cb965d07a1e888b7b0bfc4914f2ec7 (127.0.0.1) 9.41ms
[I 03:17:35.210 JupyterHubApp] 200 GET /hub/static/css/style.min.css?v=0557022b5c4d60842f9b5d3fab57cff2 (127.0.0.1) 3.07ms
[I 03:17:35.213 JupyterHubApp] 200 GET /hub/static/components/requirejs/require.js?v=640929dac3c23a448d2eebc37bc32062 (127.0.0.1) 1.82ms
[W 03:17:35.261 JupyterHubApp] 404 GET /hub/static/images/favicon.ico (127.0.0.1) 0.81ms
[I 03:17:37.703 JupyterHubApp] 200 GET /hub/login (127.0.0.1) 17.53ms
[I 03:17:45.759 JupyterHubApp] Spawning [u'jupyterhub-singleuser', u'--user=kotfic', '--port=39866', u'--cookie-name=jupyter-hub-token-kotfic', u'--base-url=/user/kotfic', u'--hub-prefix=/hub/', '--hub-api-url=http://localhost:8081/hub/api']
[D 03:17:45.763 JupyterHubApp] Polling subprocess every 30s
[E 03:17:45.783 JupyterHubApp] Uncaught exception, closing connection.
    Traceback (most recent call last):
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 461, in _handle_events
        self._handle_connect()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 1095, in _handle_connect
        self.close()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 388, in close
        self._maybe_run_close_callback()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 412, in _maybe_run_close_callback
        future.set_exception(self.error or StreamClosedError())
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/concurrent.py", line 150, in set_exception
        self._set_done()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/concurrent.py", line 177, in _set_done
        cb(self)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 114, in on_connect_done
        self.on_timeout()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 129, in on_timeout
        self.try_connect(iter(self.secondary_addrs))
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 96, in try_connect
        future = self.connect(af, addr)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 176, in _create_stream
        stream = IOStream(socket.socket(af),
      File "/home/kotfic/.pyenv/versions/2.7.8/lib/python2.7/socket.py", line 187, in __init__
        _sock = _realsocket(family, type, proto)
    error: [Errno 97] Address family not supported by protocol
[E 03:17:45.784 JupyterHubApp] Exception in callback None
    Traceback (most recent call last):
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/ioloop.py", line 837, in start
        handler_func(fd_obj, events)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
        return fn(*args, **kwargs)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 461, in _handle_events
        self._handle_connect()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 1095, in _handle_connect
        self.close()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 388, in close
        self._maybe_run_close_callback()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/iostream.py", line 412, in _maybe_run_close_callback
        future.set_exception(self.error or StreamClosedError())
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/concurrent.py", line 150, in set_exception
        self._set_done()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/concurrent.py", line 177, in _set_done
        cb(self)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 114, in on_connect_done
        self.on_timeout()
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 129, in on_timeout
        self.try_connect(iter(self.secondary_addrs))
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 96, in try_connect
        future = self.connect(af, addr)
      File "/home/kotfic/.pyenv/versions/jupyter/lib/python2.7/site-packages/tornado/tcpclient.py", line 176, in _create_stream
        stream = IOStream(socket.socket(af),
      File "/home/kotfic/.pyenv/versions/2.7.8/lib/python2.7/socket.py", line 187, in __init__
        _sock = _realsocket(family, type, proto)
    error: [Errno 97] Address family not supported by protocol
2014-10-24 03:17:46.048 [SingleUserNotebookApp] Using existing profile dir: u'/home/kotfic/.ipython/profile_default'
2014-10-24 03:17:46.057 [SingleUserNotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
2014-10-24 03:17:46.070 [SingleUserNotebookApp] Serving notebooks from local directory: /home/kotfic
2014-10-24 03:17:46.071 [SingleUserNotebookApp] 0 active kernels 
2014-10-24 03:17:46.071 [SingleUserNotebookApp] The IPython Notebook is running at: http://localhost:39866/user/kotfic/
2014-10-24 03:17:46.071 [SingleUserNotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 03:17:46.083 JupyterHubApp] Failed to connect to http://localhost:39866/user/kotfic ([Errno 97] Address family not supported by protocol)
INFO:tornado.access:302 GET /user/kotfic (127.0.0.1) 1.63ms
[D 03:17:46.343 JupyterHubApp] Server at http://localhost:39866/user/kotfic responded with 302
[I 03:17:46.344 JupyterHubApp] Adding user kotfic to proxy /user/kotfic => http://localhost:39866
[D 03:17:46.349 JupyterHubApp] Fetching POST http://localhost:8001/api/routes/user/kotfic
[I 03:17:46.399 JupyterHubApp] 302 POST /hub/login?next= (127.0.0.1) 708.86ms
[I 03:17:46.416 JupyterHubApp] 302 GET /hub/ (127.0.0.1) 5.43ms
[I 03:17:46.438 JupyterHubApp] 200 GET /hub/home (127.0.0.1) 14.02ms
[I 03:17:46.529 JupyterHubApp] 200 GET /hub/static/js/home.js (127.0.0.1) 1.37ms
[I 03:17:46.548 JupyterHubApp] 200 GET /hub/static/components/jquery/jquery.min.js (127.0.0.1) 0.95ms
[I 03:17:46.550 JupyterHubApp] 200 GET /hub/static/js/jhapi.js (127.0.0.1) 0.93ms
[I 03:17:46.590 JupyterHubApp] 200 GET /hub/static/js/utils.js (127.0.0.1) 0.65ms
[I 03:17:55.429 JupyterHubApp] 200 GET /hub/admin (127.0.0.1) 39.32ms
[I 03:17:55.561 JupyterHubApp] 200 GET /hub/static/js/admin.js (127.0.0.1) 1.09ms
[I 03:17:55.582 JupyterHubApp] 200 GET /hub/static/components/moment/moment.js (127.0.0.1) 1.09ms
[I 03:17:55.594 JupyterHubApp] 200 GET /hub/static/components/bootstrap/js/bootstrap.min.js (127.0.0.1) 0.85ms
[I 03:18:18.882 JupyterHubApp] 302 GET /hub/user/kotfic/ (127.0.0.1) 38.77ms
[I 03:18:18.901 JupyterHubApp] 200 GET /hub/api/authorizations/3990f48cd635485aa884100a867deb7f (127.0.0.1) 5.14ms
INFO:tornado.access:302 GET /user/kotfic/ (127.0.0.1) 10.09ms
2014-10-24 03:18:39.377 [SingleUserNotebookApp] Kernel started: 6b7f1e6f-9eba-453f-8076-63d7552041ca

Please let me know if you need additional information!
Thanks!
/kotfic

SudoSpawner fails to start subprocess

I believe that everything is setup as to the new sudo spawner config:

  • went through checklist in wiki
  • not using whitelist
  • rhea can execute sudo spawner fine
  • can log in
  • error when bringing up dashboard
  • works fine when run as root
# cd /etc/jupyterhub
# sudo -u rhea jupyterhub --JupyterHub.spawner=sudospawner.SudoSpawner
[I 12:15:52.083 JupyterHub] Loading cookie_secret from /etc/jupyterhub/jupyterhub_cookie_secret
[W 12:15:52.111 JupyterHub] 
    Generating CONFIGPROXY_AUTH_TOKEN. Restarting the Hub will require restarting the proxy.
    Set CONFIGPROXY_AUTH_TOKEN env or JupyterHub.proxy_auth_token config to avoid this message.

[I 12:15:52.117 JupyterHub] Not using whitelist. Any authenticated user will be allowed.
[I 12:15:52.127 JupyterHub] Starting proxy @ http://*:8000/
12:15:52.220 - info: [ConfigProxy] Proxying http://*:8000 to http://localhost:8081
12:15:52.223 - info: [ConfigProxy] Proxy API at http://localhost:8001/api/routes
[I 12:16:08.428 JupyterHub] 302 GET / (127.0.0.1) 1.13ms
[I 12:16:08.443 JupyterHub] 302 GET /hub (127.0.0.1) 0.79ms
[E 12:16:08.473 JupyterHub] Could not open static file '/usr/local/share/jupyter/static/images/favicon.ico'
[I 12:16:08.475 JupyterHub] 304 GET /hub/ (127.0.0.1) 22.78ms
[I 12:16:10.049 JupyterHub] 304 GET /hub/login (127.0.0.1) 12.52ms
[I 12:16:13.378 JupyterHub] Spawning jupyterhub-singleuser --user=dblank --port=33560 --cookie-name=jupyter-hub-token-dblank --base-url=/user/dblank --hub-prefix=/hub/ --hub-api-url=http://localhost:8081/hub/api
[E 12:16:13.381 JupyterHub] Uncaught exception POST /hub/login?next= (127.0.0.1)
    HTTPServerRequest(protocol='http', host='jupyter.physics.brynmawr.edu:8000', method='POST', uri='/hub/login?next=', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Referer': 'http://jupyter.physics.brynmawr.edu:8000/hub/login', 'Content-Length': '32', 'Cookie': 'jupyter-hub-token="2|1:0|10:1418403800|17:jupyter-hub-token|44:OTFjMDM2YTIwOWZhNDFiNTlhYjI1MWE0MGQ3NTAxMGI=|a8b6016dca567168be0377732c133f3ed894e97a3eb3fa36fbf0897f93075449"', 'X-Forwarded-Port': '8000', 'X-Forwarded-Proto': 'http', 'Accept-Language': 'en-US,en;q=0.5', 'Host': 'jupyter.physics.brynmawr.edu:8000', 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Connection': 'close', 'X-Forwarded-For': '165.106.10.85', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0', 'Accept-Encoding': 'gzip, deflate'})
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 1334, in _execute
        result = yield result
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 628, in run
        value = future.result()
      File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 109, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 631, in run
        yielded = self.gen.throw(*sys.exc_info())
      File "/usr/local/lib/python3.4/dist-packages/jupyterhub/handlers/login.py", line 60, in post
        yield self.spawn_single_user(user)
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 628, in run
        value = future.result()
      File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 109, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 631, in run
        yielded = self.gen.throw(*sys.exc_info())
      File "/usr/local/lib/python3.4/dist-packages/jupyterhub/handlers/base.py", line 173, in spawn_single_user
        config=self.config,
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 628, in run
        value = future.result()
      File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 109, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 631, in run
        yielded = self.gen.throw(*sys.exc_info())
      File "/usr/local/lib/python3.4/dist-packages/jupyterhub/orm.py", line 313, in spawn
        yield spawner.start()
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 628, in run
        value = future.result()
      File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 109, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 160, in wrapper
        result = func(*args, **kwargs)
      File "/usr/local/lib/python3.4/dist-packages/jupyterhub/spawner.py", line 324, in start
        preexec_fn=self.make_preexec_fn(self.user.name),
      File "/usr/lib/python3.4/subprocess.py", line 848, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.4/subprocess.py", line 1447, in _execute_child
        raise child_exception_type(err_msg)
    subprocess.SubprocessError: Exception occurred in preexec_fn.

julia with jupyterhub

Hi all,

I am interested in using jupyterhub principally as a Julia environment for a small group. I have installed on our machine IJulia and jupyterhub successfully just by following the instructions, but I can't seem to figure out how to set jupyterhub to work in Julia.

I have installed Python 2.7.6, Ipython 2.3.0, Julia 0.3.1.

I also have python3, ipython3 installed but the normal python/ipython commands are for python 2.

If anybody can offer some instruction it would be most appreciated.

Thanks
David

proxying on port 8080

When jupyterhub is set to proxy on port 8080, it apparently blocks itself out and fails with a "listen EADDRINUSE" error. The solution is to tell it to use another port for the hub. E.g.:

jupyterhub --JupyterHubApp.ip='spgr.stanford.edu' --JupyterHubApp.port=8080 --JupyterHubApp.hub_port=8000

It would be nice if this situation were detected and the hub automatically choose another port to use.

Install problem

I am trying to install Jupyter Hub on an Ubuntu 14.04 server. I followed exact instructions in the README.

I get this error when running "pip install ."

moment#2.7.0 share/jupyter/static/components/moment

running css

error: [Errno 2] No such file or directory

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-3k3Avh-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-jqPTEE-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-3k3Avh-build
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4: ordinal not in range(128)

My pip version is:

pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

and my bower version is

1.3.12

and my python version is

Python 2.7.6

Any idea what is going on? What should I try? Thanks in advance!
Matt

An active Jupyterhub session locks Postgres tables from writes.

Noticed while testing permissions issues on #83. It looks like maintaining a single open session for the entire lifetime of the App results in transactions never being closed, which causes Postgres to write-lock any tables being used by Jupyterhub. From reading the SQLAlchemy docs, it looks like the expected pattern for webapps is to create a Session class at global scope, but create and tear down instances of the session on each request.

minimum Python, IPython versions

By the time IPython 3 is released, that will be the minimum version of the notebook server. There won't be a release of JupyterHub that supports IPython 2. I'm considering doing that now, so that I don't need to keep adding workarounds for IPython 2.

Related to that, I'm also considering bumping the minimum Python version for JupyterHub to Python 3.3 or 3.4. Since almost everything in JupyterHub is either passing text around or async code, several things would be simplified, and the whole project would be easier to develop and maintain.

Part of the reason I feel comfortable doing both of these things is that it affects JupyterHub deployment, but does not affect the end users of IPython, where the kernel does not need to use the same version of Python (or even IPython, technically) as the notebook server or the Hub.

I'd like to hear from @dsblank, @ssanderson, and @rgbkrk before doing one or both of these. Would Python 3.4 be too aggressive (e.g. Ubuntu 14.04 is the first Ubuntu to ship with 3.4)? Is anyone planning to pin IPython to 2.x?

Jupyterhub stores sensitive data in plaintext in its database.

Jupyterhub stores access tokens and encryption keys in unencrypted plaintext in
its database. This is a security concern when running with a remote database,
because an attacker who breaks into the database can use the unencrypted data
to forge access tokens. Depending on your database configuration, even
obtaining access to the database logs could expose sensitive tokens.

Sensitive data that's currently stored in the DB:

  • Server.cookie_secret
    • Encryption key shared between the Hub and the SU Server.
    • Used by both the Hub and the single-user server to encrypt access tokens
      sent to browser. (Question: Is there a reason these need to share an
      encryption key? The SU Server loads a cookie that's set by the Hub, but
      it never decrypts; it always sends the cookie to the Hub for
      verification.)
    • Ultimately passed to each application's tornado server and used by
      get_cookie and set_cookie to decrypt/encrypt tokens from the user's
      browser.
  • Proxy.auth_token
    • Access token shared between the Proxy and the Hub.
    • Used to ensure that only the Hub is allowed to reconfigure the proxy's
      routing table.
  • User.api_tokens
    • Access token shared between the Hub and the SU Server.
    • Used to authenticate requests made by the SU Server to Hub (passed as part
      of an Authorization header, not stored in browser). In particular, used
      when the SU Server redirects to the hub's /login page.
    • Created in User.spawn every time a new single-user server is created.
    • Passed to single-user server by the spawner via the JPY_API_TOKEN environment
      variable.
    • Passed back to the hub by the verify_token method of the SingleUserApp's
      AuthenticatedHandler.
    • (Note: This is also stored unencrypted in the state column of the User table.)
  • User.cookie_tokens
    • Used by the Hub to verify that users are logged in.
    • Always created and verified by the Hub, not by the SU Server (when it
      encounters a new token, the SU Server forwards it to the Hub to verify
      it's validity).
    • Encrypted by the Hub using cookie_secret when sent to the user's browser.

I've got a half-baked version of encryption working for the APIToken and
CookieToken tables, but I feel myself going down a deep enough rabbit hole on
this that it seems worth having a conversation about Jupyterhub's expectations
and goals are w/r/t security. As far as I know I'm the only person currently
attempting to use Jupyterhub with something other than the default SQLite
setup, and I'm also designing for a much more hostile environment security
profile than most people who will use this project.

It's also possible that the right solution to some of these issues is to not
store secure fields in the database at all (my gut is that the cookie_secret
falls into this category). At any rate this is a tricky enough problem that I
wanted to get some more feedback from @minrk and co before continuing on.

Failed to start proxy

sudo jupyterhub give me:

[I 13:37:56.187 JupyterHubApp] Not using whitelist. Any authenticated user will be allowed.
[I 13:37:56.199 JupyterHubApp] Starting proxy: [u'configurable-http-proxy', '--ip', u'', '--port', '8000', '--api-ip', u'localhost', '--api-port', '8001', '--default-target', 'http://localhost:8081']
[C 13:37:56.206 JupyterHubApp] Failed to start proxy
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py", line 704, in start
IOLoop().run_sync(self.start_proxy)
File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 418, in run_sync
return future_cell[0].result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 109, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 175, in wrapper
yielded = next(result)
File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py", line 524, in start_proxy
self.proxy_process = Popen(cmd, env=env)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Any ideas? What info can I share to help narrow this down?

Thanks,
Matt

pip3 install fails during bower install

pip3's logging borks on bower logging output └── jquery#2.0.3, making installation not exit cleanly.

...
    bower requirejs#~2.1           install requirejs#2.1.15
    bower jquery#~2.0              install jquery#2.0.3
    bower moment#~2.7              install moment#2.7.0

    font-awesome#4.1.0 share/jupyter/static/components/font-awesome

    bootstrap#3.1.1 share/jupyter/static/components/bootstrap
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 706, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python3/dist-packages/pip/util.py", line 681, in call_subprocess
    logger.log(level, line)
  File "/usr/lib/python3/dist-packages/pip/log.py", line 170, in log
    raise(e)
  File "/usr/lib/python3/dist-packages/pip/log.py", line 163, in log
    consumer.write(write_content)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-6: ordinal not in range(128)

Storing debug log for failure in /.pip/pip.log

Feature ideas for jupyterhub

Organizing some ideas for the jupyterhub. These are not necessarily prioritized.

  1. For public served pages, it would be nice to keep track of hits over time. And the main page. This suggests persistent counts for pages. (This is useful to provide to funding agencies, to show impact for materials developed for dissemination.)

  2. Logs showing referrers (like apache's). This would also be useful in reporting stats like ("our site was visited by people from 31 countries, 2.1 million pages hits from 650k unique visitors"). If the log file had the same format as other web servers, then there are already tools available for creating reports.

Jupyterhub doesn't have an extra_template_paths?

It appears that jupyterhub doesn't support an extra_templates_path parameter like NotebookApp does. This makes it difficult to easily customize the pages.

Also, it would be nice if there were additional blocks defined in the provided html to allow places for custom code.

Only working on Chrome: fails on Safari and Firefox

Ran into a major problem: three different computers, three different operating systems failed, browsers other than Chrome (Safari and Firefox). They actually only fail at one point:

  • works in talking to hub
  • works in talking to dashboard
  • fails in trying to evaluate any expression (say "1 + 1") in notebook

After you run a cell, it shows [*] and never continues. Never able to talk to kernel. No log messages.

favion.ico has wrong path or is in wrong place

Running jupyterhub:

$ jupyterhub 
[E 10:33:12.586 JupyterHub] Could not open static file '/usr/local/share/jupyter/static/images/favicon.ico'

But there is one in a different place:

cp /usr/local/share/jupyter/static/favicon.ico /usr/local/share/jupyter/static/images/favicon.ico

Invalid argument: '--cookie-name=jupyter-hub-token-MYUSERNAME'

I can't run cells in py notebooks, I got a popup The kernel appears to have died

Here's the log running jupyterhub from master branch

[IPKernelApp] CRITICAL | Bad config encountered during initialization:
[IPKernelApp] CRITICAL | Invalid argument: '--cookie-name=jupyter-hub-token-ben'
2014-09-14 20:53:59.865 [SingleUserNotebookApp] WARNING | KernelRestarter: restart failed
2014-09-14 20:53:59.866 [SingleUserNotebookApp] WARNING | Kernel ec8afdad-2a1e-47f2-8202-d3644832c13e died, removing from map.
ERROR:root:kernel ec8afdad-2a1e-47f2-8202-d3644832c13e restarted failed!

Public interfacing for sharing, etc.

Sorry that I got cut off from the ipython-dev discussion this afternoon... my house lost internet access.

Anyway, I'll make some notes here about the public/sharing aspects of the jupyterhub:

The public handler should be able to:

  1. render as html
  2. give json of .ipynb
  3. allow downloading .ipynb
  4. allow copying from public directory to a logged in user's space

Here is a prototype of some of the ideas:

https://gist.github.com/dsblank/29fb53ff27966268208a

Basically:

  • any file in /home/USER/Public/ is shared as /public/USER/
  • does a directory listing if no file is requested
  • serves any file in Public (zip files, images, whatever)
  • default view is raw json
  • can get different versions:
    • /public/USER/file.ipynb?copy
    • /public/USER/file.ipynb?download
    • /public/USER/file.ipynb?view
  • no security here (allows ".." in paths)
  • not sure how to handle requests for .css, .js, etc.

IPython priorities, from my perspective:

  1. logout
  2. sharing/distributing files to class

I have some other aspects I need to wrestle with (how do they get a kernel installed easily, how do they get some nbextensions), but that is mostly me figuring out details to instruct the class).

Issue with the sudo spawner ...

Hi,

I tried to install jupyterhub with the help of Matthias today and we could-not get the sudo spawner working. Apparently it is using the wrong spawner (and hence fails in "os.setuid" with the default one). Of course running this as "root" works perfectly but it is not the idea.

Thanks again to Matthias for his great introduction and his help

Cheers

Jérôme

Logout is not implemented

Should I list items like this, or is such a list just too long? Or will this help identify priorities of what needs to be done?

Canno't connect with my username and password on ubuntu 14.04

Hi, I'm a french physic teacher and I'm trying to serve ipython notebooks for my students.
I'd like to serve all my notebooks from a single port, and I think that's what jupyterhub does.

However, I don't really understand how to login and add users to the app.
Using my unix username and password, I get:{'error': 'Invalid username or password'}

In advance thanks for your help.

Can a Handler on the hub app know the logged in user?

I am attempting to write a handler in the App that can handle serving rendered notebooks. It works fine, except that I can't determine if the user has logged in. get_current_user() returns None and there is nothing in app.settings related to current_user. It appears that the handlers that do have current_user set are in the notebook server (the proxy server). Is that correct?

How can the hub app know what the current logged in user is?

Database connection fails when connecting to PostgreSQL

Running jupyterhub --db=postgresql://jupyterhub@localhost/jupyterhub --debug results in a stack trace that terminates with:

OperationalError: (OperationalError) invalid connection option "check_same_thread"
None None

If I comment out kwargs.setdefault('connect_args', {'check_same_thread': False}) from new_session in orm.py, everything seems to work as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.