Giter Site home page Giter Site logo

jupyterhub / dockerspawner Goto Github PK

View Code? Open in Web Editor NEW
474.0 27.0 306.0 658 KB

Spawns JupyterHub single user servers in Docker containers

Home Page: https://jupyterhub-dockerspawner.readthedocs.io

License: BSD 3-Clause "New" or "Revised" License

Python 99.24% Shell 0.76%
docker-container jupyterhub spawner jupyter dockerspawner spawn-notebook-servers

dockerspawner'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

dockerspawner's People

Contributors

alexstrat avatar bigzachattack avatar choldgraf avatar cnydw avatar consideratio avatar danielballan avatar deephorizons avatar dependabot[bot] avatar dhirschfeld avatar edwardjkim avatar floriandeboissieu avatar georgianaelena avatar jhamrick avatar jtpio avatar manics avatar minrk avatar mohirio avatar nicolas-gibelin avatar pre-commit-ci[bot] avatar rgbkrk avatar richafrank avatar robnagler avatar ryanlovett avatar sheila-nk avatar ssanderson avatar stefanoborini avatar whitead avatar willingc avatar yuvipanda avatar zeehio 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

dockerspawner's Issues

Non-unique user id causes problem in systemuserspawner

It looks like the useradd fails if the UID conflicts with the docker image UID's. I'm not sure if there is a fix for this beyond "don't use conflicting user ids", but maybe the docker image could clean up UID 1000 at least. I don't know docker well enough to know if this is possible or easy...

Here is the docker logs output for the issue:

Creating user jupyter (1000)
useradd: UID 1000 is not unique
sudo: unknown user: jupyter
sudo: unable to initialize policy plugin

Docker layout

This kind of belongs across several repositories, but I'll post it here since it's very Docker centric.

Earlier @minrk and I talked about how we would layout containers for JupyterHub. While talking with Min over chat, we laid them out as diagrams.

These may be wrong from the current state, so I'll update these to show where we were at and where we're going.

OAuthenticator example

Spawns single user servers, independent of each other

screen shot 2014-09-27 at 4 03 30 pm

JupyterHub Dockerfile

Just JupyterHub basics: no special packages everyone operates on the same file system in the container

screen shot 2014-09-27 at 4 03 35 pm

JupyterHub

Note: This doesn't exist, is an illustration of what @rgbkrk is leaning towards for a shared environment

Run on Host or Docker using the base jupyter/jupyterhub image, allow for configuration with OAuth, allow users to choose what image they're grouped.

This needs access to the Docker Unix socket or API access to Docker.

screen shot 2014-09-27 at 4 03 40 pm

500 / 404 error on using docker spawner

Hello!

(First, thanks for the awesome work!)

I'm trying to set up a publicly accessible jupyterhub setup on Wikimedia Labs (jupyter.wmflabs.org). Would like to use docker to provide isolation as well as resource quotas / clustering (later on). Jupyterhub works with the default spawner, but with dockerspawner I get a '500 server error' when I click 'my server'. And if I ssh tunnel through and hit the proxied docker endpoint directly, I get a 404. No errors in jupyterhub stdout, so I'm not sure what's happening.

Thoughts?

Dealing with sqlite on NFS mounts

I'm using a setup where the user's home directory is in an NFS mount (heavily inspired by https://github.com/compmodels). Everything works fine up to the point when I want to create a new notebook, then a "filesystem error" occurs, which I've tracked down to something that looks like this:

ipython/ipython#2426

before trying to reinvent the wheel, how are you guys dealing with this?

Running Docker daemon on a different machine?

I am using the SystemSpawner. It correctly launches a Docker daemon on a different machine. But then it tries to contact that machine on 127.0.0.1:32842 which obviously is not correct as it is a different machine!

Any hints on how to give it the correct IP?

'NoneType' object is not subscriptable getting container port

I went from 0.0.1.dev to 0.2.0.dev and get the following traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/tornado/web.py", line 1445, in _execute
    result = yield result
  File "/usr/local/jupyterhub/jupyterhub/handlers/login.py", line 72, in post
    yield self.spawn_single_user(user)
  File "/usr/local/jupyterhub/jupyterhub/handlers/base.py", line 296, in spawn_single_user
    yield gen.with_timeout(timedelta(seconds=self.slow_spawn_timeout), f)
  File "/usr/local/jupyterhub/jupyterhub/user.py", line 202, in spawn
    raise e
  File "/usr/local/jupyterhub/jupyterhub/user.py", line 183, in spawn
    yield gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
  File "/usr/local/jupyterhub/swarmspawner.py", line 59, in start
    extra_host_config=extra_host_config)
  File "/usr/local/lib/python3.5/site-packages/dockerspawner/dockerspawner.py", line 391, in start
    ip, port = yield from self.get_ip_and_port()
  File "/usr/local/lib/python3.5/site-packages/dockerspawner/dockerspawner.py", line 407, in get_ip_and_port
    port = resp[0]['HostPort']
TypeError: 'NoneType' object is not subscriptable

It seems (looking at the Docker image logs) that none of the JupyterHub info such as $USER and $USER_ID are getting passed into the container and the container then fails to start.

Support usernames that do not conform to docker container names

Some authentication providers (cough mediawiki) allow a lot more characters classes than they should (mediawiki allows (, spaces, ), etc). Hashing or seperating 'userid' from 'username' would allow people with such special characters in their username to use jupyterhub.

make it easier to switch base image

@carolynvs wrote a great post about mixing jupyter-stacks with JupyterHub.

in the section about the Dockerfile, the source from the single-user dockerfile is copied, which makes perfect sense given how docker works, but it gave me an idea. Since the single-user stuff shouldn't be sensitive to the base image as long as jupyter is installed somewhere, maybe we should provide an official rebase-image command to do this, so it's easy for people to build their single-user images without maintaining copies of code that could get stale.

Rather than doing a one-time copy of the single-user image, you do rebase-singleuser jupyter/<stack> that does:

  1. copy singleuser -> my-singleuser
  2. modify FROM
  3. docker build -t singleuser my-singleuser

Hopefully removing the need to copy implementation details of the single-user image.

The only fiddly bit I can see is the user and permission stuff, which broke when I switched it to our docker stacks because of the jovyan user.

cc @rgbkrk

Pull images

While trying out jupyterhub + dockerspawner I found this rather surprising behaviour: it doesn't pull images automatically. Is there a reason for this or is it just something that's not implemented yet?
See jupyterhub/jupyterhub#590 for some context.
Thanks!

Dockerspawner 500 error with the volume is not

when in jupyterhub_config.py
I used the following config, the docker singleuser can start when a new user login success.

c.DockerSpawner.volumes = {'/tmp/qq22{username}':'/home/jovyan/work'}

but when I use the following config,

c.DockerSpawner.volumes = {'/tmp/qq22{username}':'/home/admin''}
--------------------------------------------------------------------------------------------
**I get the error, why the volume must be /home/jovyan/work ?**
[W 2016-12-26 08:03:53.316 JupyterHub web:1545] 500 GET /hub/user/aa1/logout (192.168.197.1): Spawner failed to start [status=ExitCode=1, Error='', FinishedAt=2016-12-26T13:03:45.278000309Z]
[E 2016-12-26 08:03:53.340 JupyterHub log:99] {
      "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0",
      "Connection": "close",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
      "Referer": "https://192.168.197.131:8000/user/3232/tree?",
      "If-None-Match": "\"bed6ff513da5ed05c43b58cee72c33ed2198891d\"",
      "Cache-Control": "max-age=0",
      "Cookie": "jupyter-hub-token=\"2|1:0|10:1482757286|17:jupyter-hub-token|44:OTI3ZDY0ZWZkNDliNDc0NGFiM2NjODljNThhYzVjYzg=|162c7295b274bb4cba99f03254cfcc21e8af96c2c811e07008ed448437d59abb\"; _xsrf=2|1394e5e1|1094794fe344d29590b9f8939e1fc0ab|1482710245",
      "X-Forwarded-Proto": "https",
      "Host": "192.168.197.131:8000",
      "X-Forwarded-For": "192.168.197.1",
      "X-Forwarded-Host": "192.168.197.131:8000",
      "Upgrade-Insecure-Requests": "1",
      "X-Forwarded-Port": "8000"
    }


my own docker image 's Dockerfile is here:
---------------------------------------------------------------
[admin@localhost python3_base_nb]$ cat Dockerfile
FROM python3_base
RUN adduser -h /home/admin -D admin

USER root
RUN wget -q https://raw.githubusercontent.com/jupyterhub/jupyterhub/0.6.1/scripts/jupyterhub-singleuser -O /usr/local/bin/jupyterhub-singleuser && \
    chmod 755 /usr/local/bin/jupyterhub-singleuser


ADD singleuser.sh /srv/singleuser/singleuser.sh
ADD requirement.txt .
RUN pip3 install -r requirement.txt

RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix
COPY token_notebook.py /usr/local/bin/token_notebook.py
RUN chmod +x /usr/local/bin/token_notebook.py

RUN ln -s /usr/bin/python3 /usr/bin/python
EXPOSE 8888
USER admin
RUN mkdir /home/admin/.jupyter &&  mkdir -p -m 770 /home/admin/.local/share/jupyter

# Add local files
COPY jupyter_notebook_config.py /home/admin/.jupyter/

# smoke test that it's importable at least
RUN sh /srv/singleuser/singleuser.sh -h
CMD ["sh", "/srv/singleuser/singleuser.sh"]

-----------------------------------------------------------
[admin@localhost python3_base]$ cat Dockerfile
FROM alpine:3.4

RUN apk add --no-cache bash gawk sed grep bc coreutils python3-dev g++  bzip2-dev gcc gdbm-dev libc-dev linux-headers make ncurses-dev openssl openssl-dev pax-utils readline-dev sqlite-dev tcl-dev tk tk-dev zlib-dev linux-pam-dev

RUN apk add --no-cache python3 && \
    python3 -m ensurepip && \
    rm -r /usr/lib/python*/ensurepip && \
    pip3 install --upgrade pip setuptools && \
    rm -r /root/.cache

RUN mkdir -p /home/admin
ENV HOME /home/admin
WORKDIR  $HOME

JupyterHub with Docker Spawner and Docker Swarm

Hello,

So I'm trying to run JupyterHub using Docker Spawner and Docker Swarm and running it locally. I'm following your workshop tutorial here : dockerspawner. I want to run it locally without using carina, in order to deploy laterly to other cloud services using Docker Swarm. So I started my own Docker Swarm as it explained here : dockerswarm.

Based own your explanation, I've got this configuration files:

  • launch.sh
#!/bin/sh
set -euo pipefail

export DNSNAME=localhost
export JUPYTERHUB_USERS=myself
export JUPYTERHUB_ADMINS=myself

export OAUTH_CLIENT_ID=<my_oauth_client_id>
export OAUTH_CLIENT_SECRET=<my_oauth_client_secret>
#export OAUTH_CALLBACK_URL=http://localhost:8000/hub/oauth_callback

docker build -t myjupyterhub .
#docker pull jupyterhub/singleuser

docker run --detach \
  --name jupyterhub \
  -p 80:8000 \
  -p 8081:8081 \
  -e DOCKER_CERT_PATH=${DOCKER_CERT_PATH} \
  -e JUPYTERHUB_USERS=${JUPYTERHUB_USERS} \
  -e JUPYTERHUB_ADMINS=${JUPYTERHUB_USERS} \
  -e DOCKER_HOST=https://${DOCKER_HOST#tcp://} \
  -e HUB_IP_CONNECT=${DNSNAME} \
  -e OAUTH_CALLBACK_URL=http://${DNSNAME}/hub/oauth_callback \
  -e OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID} \
  -e OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET} \
  myjupyterhub

open http://$(docker port jupyterhub 8000)
  • jupyter_config.py
import os
import re

c = get_config()

c.JupyterHub.hub_ip = "0.0.0.0"

c.JupyterHub.spawner_class = "dockerspawner.DockerSpawner"
c.DockerSpawner.tls_verify = True
c.DockerSpawner.tls_ca = "/etc/docker/ca.pem"
c.DockerSpawner.tls_cert = "/etc/docker/server-cert.pem"
c.DockerSpawner.tls_key = "/etc/docker/server-key.pem"
c.DockerSpawner.container_ip = "0.0.0.0"
c.DockerSpawner.hub_ip_connect = os.environ["HUB_IP_CONNECT"]

c.JupyterHub.authenticator_class = "oauthenticator.GoogleOAuthenticator"

c.JupyterHub.login_url = "/hub/oauth_login"

def userlist(varname):
    """
    Intercept an environment variable as a whitespace-separated list of GitHub
    usernames.
    """

    parts = re.split("\s*,\s*", os.environ[varname])
    return set([part for part in parts if len(part) > 0])

c.Authenticator.whitelist = userlist("JUPYTERHUB_USERS")
c.Authenticator.admin_users = userlist("JUPYTERHUB_ADMINS")

c.GitHubOAuthenticator.oauth_callback_url = os.environ["OAUTH_CALLBACK_URL"]
c.GitHubOAuthenticator.client_id = os.environ["OAUTH_CLIENT_ID"]
c.GitHubOAuthenticator.client_secret = os.environ["OAUTH_CLIENT_SECRET"]
  • Dockerfile
FROM jupyterhub/jupyterhub

RUN pip install --upgrade pip
RUN pip install dockerspawner oauthenticator

The container with the JupyterHub and DockerSpawner is created in the swarm, it launches the JupyterHub login page but with the System User authentification, and not the Google authentification sign up as I thought. So here come my questions.

I made the changes to try to make it works locally (without carina) like here jupyterhub-tutorial. I don't see when the jupyter_config.py is called by JupyterHub. Do I have to add this file to the Dockerfile (and in the same way, the certificate and server key) ? So the created image is the container that launches the JupyterHub with DockerSpawner.

Where do I have to call the image with the notebook I want to spawn by Docker Spawner ? I have already created another docker image with Jupyter and my notebook (the singleuser image).

Conda directory issue with dockerspawner

Hi, I'm trying to use a local conda with my user.

I'm using ldap auth so I mount de users files from other server to the docker container. The path to home in the server is /mnt/users/home/my_user that is where the files are mounted. In the user directory i set my own conda dir witch is /mnt/user/home/my_user/Anaconda3 and the path of the binaries is /mnt/user/home/my_user/Anaconda3/bin.

When i opened a terminal in the notebook from the jupyterhub server and tried to use conda the command used the container's system conda so y put in the .bashrc of my_user the path to my conda.
.bashrc:

if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

export CONDA_DIR=$HOME/anaconda3
export PATH=$HOME/anaconda3/bin:$PATH

The $HOME variable in the container is /home/my_user, and conda in the container show this output:

madiaz@3272e9e51b3e:~$ conda
bash: /home/madiaz/anaconda3/bin/conda: /mnt/users/home/madiaz/anaconda3/bin/python: bad interpreter: No such file or directory

In the server conda works fine but in the container i don't know why it try to searh its files in /mnt/users/home. There is a way to specify to the spawner where will be all the conda files?

Here is the env output in the container

madiaz@3272e9e51b3e:~$ env
HOSTNAME=3272e9e51b3e
NB_USER=jovyan
TERM=xterm
SHELL=/bin/bash
JPY_USER=madiaz
JPY_BASE_URL=/user/madiaz
LC_ALL=en_US.UTF-8
USER=madiaz
SUDO_USER=root
SUDO_UID=0
JUPYTER_SERVER_URL=http://0.0.0.0:8888/user/madiaz/
USERNAME=madiaz
COLUMNS=138
PATH=/home/madiaz/anaconda3/bin:/opt/conda/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/home/madiaz
JPY_HUB_PREFIX=/hub/
USER_ID=1005
JPY_HUB_API_URL=http://10.6.91.207:8081/hub/api
LANG=en_US.UTF-8
LINES=39
JPY_COOKIE_NAME=jupyter-hub-token-madiaz
SHLVL=1
HOME=/home/madiaz
SUDO_COMMAND=/usr/local/bin/jupyterhub-singleuser --port=8888 --ip=0.0.0.0 --user=madiaz --cookie-name=jupyter-hub-token-madiaz --base-url
=/user/madiaz --hub-prefix=/hub/ --hub-api-url=http://10.6.91.207:8081/hub/api
LANGUAGE=en_US.UTF-8
JUPYTER_SERVER_ROOT=/home/madiaz
XDG_CACHE_HOME=/home/jovyan/.cache/
LOGNAME=madiaz
DEBIAN_FRONTEND=noninteractive
CONDA_DIR=/home/madiaz/anaconda3
SUDO_GID=0
PYXTERM_DIMENSIONS=80x25
NB_UID=1000
_=/usr/bin/env

And this is the jupyterhub_config.py:

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = '#CENSORED'
c.LDAPAuthenticator.bind_dn_template = '#CENSORED'
c.LDAPAuthenticator.use_ssl = False
c.JupyterHub.confirm_no_ssl = True
c.LDAPAuthenticator.server_port = 389
c.JupyterHub.spawner_class = 'dockerspawner.SystemUserSpawner'
c.SystemUserSpawner.host_homedir_format_string = '/mnt/users/home/{username}'
docker0 = netifaces.ifaddresses('docker0')
docker0_ipv4 = docker0[netifaces.AF_INET][0]
c.JupyterHub.hub_ip = docker0_ipv4['addr']
c.PAMAuthenticator.open_sessions = False

Group is not preserved in systemuserspawner

I can't figure out how to preserve the user's group in the systemuserspawner. It just ends up being the same as the UID and that isn't good. I'm putting some work into trying to figure this out but any hints would be appreciated.

Thanks.

Included singleuser and systemuser Docker images fail to start jupyterhub-singleuser

When I build the Docker images included in the repo and use either DockerSpawner or SystemUserSpawner, JupyterHub will create a container on login and wait for it to come up, but it never does:

[I 2015-03-31 20:13:06.497 JupyterHub dockerspawner:289] Created container 'jupyter-user1' (id: 0331384) from image jupyter/singleuser
[I 2015-03-31 20:13:06.498 JupyterHub dockerspawner:299] Starting container 'jupyter-user1' (id: 0331384)
[W 2015-03-31 20:13:16.417 JupyterHub base:238] User user server is slow to start
[I 2015-03-31 20:13:16.426 JupyterHub log:100] 302 GET /hub/user/user1/ ([email protected]) 10037.15ms
[I 2015-03-31 20:13:16.529 JupyterHub log:100] 302 GET /user/user1/ (@10.0.0.137) 0.73ms
[I 2015-03-31 20:13:16.574 JupyterHub log:100] 200 GET /hub/user/user1/ ([email protected]) 5.93ms
[W 2015-03-31 20:13:37.026 JupyterHub orm:395] user1's server never showed up at http://localhost:49176/user/user1 after 30 seconds. Giving up
[E 2015-03-31 20:13:37.037 JupyterHub gen:673] Exception in Future <tornado.concurrent.Future object at 0x7f04637bff98> after timeout
    Traceback (most recent call last):
      File "/home/user1/venv3/lib/python3.4/site-packages/tornado/gen.py", line 669, in error_callback
        future.result()
      File "/home/user1/venv3/lib/python3.4/site-packages/jupyterhub/orm.py", line 411, in spawn
        raise e
      File "/home/user1/venv3/lib/python3.4/site-packages/jupyterhub/orm.py", line 387, in spawn
        yield self.server.wait_up(http=True, timeout=spawner.http_timeout)
      File "/home/user1/venv3/lib/python3.4/site-packages/jupyterhub/orm.py", line 110, in wait_up
        yield wait_for_http_server(self.url, timeout=timeout)
      File "/home/user1/venv3/lib/python3.4/site-packages/jupyterhub/utils.py", line 83, in wait_for_http_server
        **locals()
    TimeoutError: Server at http://localhost:49176/user/user1 didn't respond in 30 seconds

Examining the container's logs shows the problem:

$ sudo docker logs jupyter-user1
Traceback (most recent call last):
  File "/usr/local/bin/jupyterhub-singleuser", line 8, in <module>
    from urllib.parse import quote
ImportError: No module named parse

urllib.parse is a Python 3 module, and the default 'python' version on the Docker image (and most Ubuntu setups) is 2.7. The /usr/local/bin/jupyterhub-singleuser script in the Docker container needs to be run with python3 instead of python.

Add info about hub_ip and connect_ip to README

From conversation in the Gitter channel:

@edsu Can you set c.JupyterHub.hub_ip = 'a.b.c.d' to an IP address for your host that the containers can see?
You can view the IPs with ifconfig -a inet

Ed Summers @edsu Jul 20 13:03
It does look like adding c.DockerSpawner.hub_ip_connect did the trick. Not sure if the DockerSpawner docs reflect that you need to do this.

Min RK @minrk Jul 20 13:03
If they do, it could probably be more prominent.

Ed Summers @edsu Jul 20 13:04
well actually i did that and then i also set c.JupyterHub.hub_ip

@minrk no worries at all, you are always incredibly helpful in here

Min RK @minrk Jul 20 13:04
hub_ip should be sufficient unless the two values are different (i.e. hub binds on one interface, but that's reflected as a different IP from the perspective of the container)

Ed Summers @edsu Jul 20 13:05

Min RK @minrk Jul 20 13:05
connect_ip is often used with hub_ip = 0.0.0.0, or all interfaces, then the connect_ip needs a specific address to connect to.

Ed Summers @edsu Jul 20 13:31
@minrk is there a place where people share docker containers for notebook environments?

Min RK @minrk Jul 20 13:32
Not that I'm aware of

Ed Summers @edsu Jul 20 13:33
@minrk ok, it looks like it's built off of jupyter/scipy-notebook
in theory it could be a docker image with other languages available i guess?

Min RK @minrk Jul 20 13:34
Yes, any image with the notebook installed should work.

Cleaning the servers table when stopped

If remove_containers is set, should the spawner remove the entry in the 'servers' table? This table seems to grow quite large if servers are culled and restarted as the port changes, and with swarmspawner the IP may change as well.

Passing certain arguments to start_container is all-but-deprecated

Many arguments to start_container get translated by docker-py under the hood to entries in a host_config dictionary that's effectively deprecated in the latest docker. From looking at https://github.com/docker/docker-py/pull/593/files, it looks like the following parameters are technically legal inputs to start_container, but are effectively deprecated:

start_config = utils.create_host_config(
             binds=binds, port_bindings=port_bindings, lxc_conf=lxc_conf,
             publish_all_ports=publish_all_ports, links=links, dns=dns,
             privileged=privileged, dns_search=dns_search, cap_add=cap_add,
             cap_drop=cap_drop, volumes_from=volumes_from, devices=devices,
             network_mode=network_mode, restart_policy=restart_policy,
             extra_hosts=extra_hosts, read_only=read_only, pid_mode=pid_mode,
             ipc_mode=ipc_mode, security_opt=security_opt, ulimits=ulimits
         )

         if isinstance(container, dict):
             container = container.get('Id')

         url = self._url("/containers/{0}/start".format(container))
         if not start_config:
             start_config = None
        elif utils.compare_version('1.15', self._version) > 0:
            warnings.warn(
                'Passing host config parameters in start() is deprecated. '
                'Please use host_config in create_container instead!',
                DeprecationWarning
            )

of these, I think the only ones we might be using are binds and port_binds, but volumes_from, links, and extra_hosts would be nice additions.

jupyterhub_config.py

This file is no longer in the top directory (i.e. DockerSpawner). Should it be in examples/oauth or should it be in DockerSpawner?

jupyter/systemuser permission error

Hi - I am setting up a jupyterhub and dockerspawner on the same machine. I have it all working, but cannot connect to the launched docker image. My config looks like this:

c.DockerSpawner.hub_ip_connect = 'xxx'
c.JupyterHub.hub_ip = 'xxx'
c.JupyterHub.port = 443
c.JupyterHub.cookie_secret_file = '/home/jupyter/jupyterhub_cookie_secret'
c.JupyterHub.log_level = 'DEBUG'
c.Spawner.debug = True
c.JupyterHub.spawner_class = 'dockerspawner.SystemUserSpawner'
c.SystemUserSpawner.host_homedir_format_string = '/volumes/user/{username}'
c.DockerSpawner.hub_ip_connect = 'xxx'
c.JupyterHub.proxy_auth_token = 'xxx'
c.Authenticator.whitelist = {'jupyter'}
c.Authenticator.admin_users = {'jupyter'}
c.JupyterHub.ssl_cert = '/home/jupyter/mycert.pem'
c.JupyterHub.ssl_key = '/home/jupyter/mykey.k

The server starts, and I can login (via local authentication), but then I get a 500 error on the web.
I have DEBUG logging:

[D 2016-02-02 19:16:13.921 JupyterHub dockerspawner:309] Getting container 'jupyter-jupyter'
[I 2016-02-02 19:16:13.928 JupyterHub dockerspawner:374] Found existing container 'jupyter-jupyter' (id: 5f6551a)
[I 2016-02-02 19:16:13.928 JupyterHub dockerspawner:379] Starting container 'jupyter-jupyter' (id: 5f6551a)
[D 2016-02-02 19:16:14.124 JupyterHub spawner:261] Polling subprocess every 30s
[D 2016-02-02 19:16:23.927 JupyterHub dockerspawner:309] Getting container 'jupyter-jupyter'
[D 2016-02-02 19:16:23.934 JupyterHub dockerspawner:295] Container 5f6551a status: {'Dead': False,
     'Error': '',
     'ExitCode': 9,
     'FinishedAt': '2016-02-03T00:16:14.190673324Z',
     'OOMKilled': False,
     'Paused': False,
     'Pid': 0,
     'Restarting': False,
     'Running': False,
     'StartedAt': '2016-02-03T00:16:14.111710525Z'}
[W 2016-02-02 19:16:23.935 JupyterHub web:1521] 500 POST /hub/login?next= (67.249.20.25): Spawner failed to start [status=ExitCode=9, Error='', FinishedAt=2016-02-03T00:16:14.190673324Z]
[D 2016-02-02 19:16:23.939 JupyterHub base:415] No template for 500
[E 2016-02-02 19:16:23.989 JupyterHub log:99] {
      "X-Forwarded-Proto": "https",
      "Host": "128.153.6.128",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "Connection": "close",
      "X-Forwarded-For": "67.249.20.25",
      "Origin": "https://128.153.6.128",
      "Content-Type": "application/x-www-form-urlencoded",
      "Upgrade-Insecure-Requests": "1",
      "Accept-Language": "en-US,en;q=0.8",
      "Referer": "https://128.153.6.128/hub/login?next=",
      "Content-Length": "37",
      "Cache-Control": "max-age=0",
      "Accept-Encoding": "gzip, deflate",
      "X-Forwarded-Port": "443",
      "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"
    }
[E 2016-02-02 19:16:23.990 JupyterHub log:100] 500 POST /hub/login?next= (@67.249.20.25) 10667.63ms


I looked into the docker log (I assumed the problem was here) and found:
Creating user jupyter (1001)
/opt/conda/lib/python3.4/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets package.")
/opt/conda/lib/python3.4/site-packages/IPython/paths.py:69: UserWarning: IPython parent '/home/jupyter' is not a writable location, using a temp directory.
  " using a temp directory.".format(parent))
Traceback (most recent call last):
  File "/usr/local/bin/jupyterhub-singleuser", line 237, in <module>
    main()
  File "/usr/local/bin/jupyterhub-singleuser", line 233, in main
    return SingleUserNotebookApp.launch_instance()
  File "/opt/conda/lib/python3.4/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.4/site-packages/traitlets/config/application.py", line 588, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-114>", line 2, in initialize
  File "/opt/conda/lib/python3.4/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/opt/conda/lib/python3.4/site-packages/notebook/notebookapp.py", line 1017, in initialize
    super(NotebookApp, self).initialize(argv)
  File "<decorator-gen-113>", line 2, in initialize
  File "/opt/conda/lib/python3.4/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/opt/conda/lib/python3.4/site-packages/jupyter_core/application.py", line 243, in initialize
    self.migrate_config()
  File "/opt/conda/lib/python3.4/site-packages/jupyter_core/application.py", line 169, in migrate_config
    migrate()
  File "/opt/conda/lib/python3.4/site-packages/jupyter_core/migrate.py", line 238, in migrate
    ensure_dir_exists(env['jupyter_config'])
  File "/opt/conda/lib/python3.4/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/opt/conda/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/jupyter/.jupyter'
Creating user jupyter (1001)
useradd: user 'jupyter' already exists
Creating user jupyter (1001)
useradd: user 'jupyter' already exists
Creating user jupyter (1001)
useradd: user 'jupyter' already exists

I don't know if that is helpful - it looks like I had the error once but now it is just appending useradd: user 'jupyter' already exists.

I just need a nudge in the right direction - as I am not sure if the problem is with the container image or my install.

Docker registry image broken

The image released on the docker registry seems to be broken. When pulling the image, the following error message is displayed:

$ docker pull jupyter/systemuser
Pulling repository jupyter/systemuser
de9dd2e506c0: Error pulling image (latest) from jupyter/systemuser, HTTP code 400 
428b411c28f0: Download complete 
435050075b3f: Download complete 
9fd3c8c9af32: Download complete 
6d4946999d4f: Download complete 
9bd2d4fa7079: Download complete 
d6d97543cd83: Download complete 
7f13ac159046: Download complete 
a15e944e9b19: Download complete 
ee69352e1c03: Error pulling dependent layers 
FATA[0012] Error pulling image (latest) from jupyter/systemuser, HTTP code 400

Mapping github users to system users

I'm running JupyterHub on the host and using SystemUserSpawner with GitHub authentication. All of the whitelisted GitHub users also have a system user on the host, but the user names are not the same. I'd like bind-mount their home directories into their containers. Is there some easy way to do this?

Config option `open_browser` not recognized by `SingleUserNotebookApp`

The jupyter_notebook_config.py that comes with jupyter/singleuser has

c.NotebookApp.open_browser = False

However, that doesn't work, because SingleUserNotebookApp does not define open_browser as a trailet.

This causes a warning when the container starts up:

[W 2016-04-21 17:06:23.553 robnagler configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`

Stop / Delete container on use logout / inactivy

After reading the documentation and doing all possible config, after a user is logged out, or a socket not active anymore, the container is still running. How can I make it to be stopped/delete automatically?

Default folder recreates with root owner

JupyterHub 0.6.1 is installing on Ubuntu 14.04, using DockerSpawner, custom Authenticator.
Authentication technic: Jupyter opens from another application with temporal code, LoginHandler get code from URL, connects to common application and check code, if success, user authorization is success, so no login form provides.

jupyterhub_configuration.py:

# Configuration file for jupyterhub.
c.JupyterHub.admin_access = True
c.JupyterHub.authenticator_class = 'MyAuthenticator'

c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
import os
notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan/work'
c.DockerSpawner.notebook_dir = notebook_dir
c.DockerSpawner.volumes = { '/home/me/volumes/{username}': notebook_dir }
c.DockerSpawner.extra_host_config = {'network_mode': 'host'}
c.DockerSpawner.http_timeout = 90
c.DockerSpawner.debug = True

from jupyter_client.localinterfaces import public_ips
print(public_ips())
first_ip = public_ips()[0]
c.JupyterHub.hub_ip = first_ip
c.DockerSpawner.hub_ip_connect = first_ip

A problem is '/home/jovyan/work' folder belongs to root when new Spawner server created.
If I setting another folder, for example, '/notebooks', then '/notebooks' folder will be under root owner, but '/home/jovyan/work' will owned by jovyan. So it looks like folder automatically recreates by root user.
As a result I can't create any notebooks or files because of insufficient privileges and result is 'permission denied' error.

Add Support for Singleton Containers/Processes

In the Quantopian codebase, we've implemented subclasses of JupyterHub and DockerSpawner that provide support for one-per-hub services. We use this feature for things like database connection pooling and for containers that manage data volumes, and we've found it pretty useful.

Two interesting questions:

  1. Is this only a Docker feature, or could/should JupyterHub support a notion of additional managed processes? One way of thinking about this would be as a generalization of the NodeJS proxy to allowing additional configured processes.
  2. If it's only a Docker feature, is there a sane way to do this that doesn't require support from the Hub. (Our current implementation adds an init_singleton_containers method to the Hub startup that ensures the singletons exist before any new Notebook servers are created.)

Jupyterhub stops all docker containers when it is shutdown

Hi guys,

I just want to understand if it is required that all docker containers being stopped when jupyterhub is shutdown?

If we only want to stop jupyterhub but let all containers continue to run,, can we reattach jupyterhub to all existing running containers?

Thanks!

Multiple Node Environment for Jupyterhub

I am having two hosts over which I am planning to build up an environment with Jupyterhub running on 2 nodes. Out of this, one node will be a docker server and the other to be base jupyerhub server. The main idea behind configuring this, is to establish a load balancing mechanism as well as clustering. Based on average load on the server, the user will be routed to a dedicated host for routing.

Can you please guide me on this configuration.

Is this on one host, I shall be configuring docker spawner and on the other node normal Jupyerhub server. If so how the configuration will be define. Also do I need to define Clustering at Unix OS level also?

Please suggest on this.

Regards,
Sudipta.

jupyterhub server error 500 Spawner failed to start [status=ExitCode=1

When running jupyterhub with swarm I got this error

I 2016-05-11 05:39:37.015 JupyterHub dockerspawner:402] Found existing container 'jupyter-jhuser1' (id: c564bba)
[I 2016-05-11 05:39:37.015 JupyterHub dockerspawner:407] Starting container 'jupyter-jhuser1' (id: c564bba)
[W 2016-05-11 05:39:47.028 JupyterHub web:1521] 500 POST /hub/login?next= (93.47.117.171): Spawner failed to start [status=ExitCode=1, Error='', FinishedAt=2016-05-11T05:39:37.695787745Z]
[E 2016-05-11 05:39:47.041 JupyterHub log:99] {
"X-Forwarded-Port": "80",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8",
"Host": "jupyterhub.ddns.net",
"X-Forwarded-Proto": "http",
"Content-Type": "application/x-www-form-urlencoded",
"Connection": "close",
"Accept-Language": "en-us",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17",
"Referer": "http://jupyterhub.ddns.net/hub/login",
"Accept-Encoding": "gzip, deflate",
"Content-Length": "33",
"Origin": "http://jupyterhub.ddns.net",
"X-Forwarded-For": "93.47.117.171"
}
[E 2016-05-11 05:39:47.042 JupyterHub log:100] 500 POST /hub/login?next= (@93.47.117.171) 10144.62ms
[W 2016-05-11 05:40:17.387 JupyterHub user:264] jhuser1's server never showed up at http://172.31.15.174:32771/user/jhuser1 after 30 seconds. Giving up
[E 2016-05-11 05:40:17.402 JupyterHub gen:871] Exception in Future <tornado.concurrent.Future object at 0x7f8c81097588> after timeout
Traceback (most recent call last):
File "/opt/conda/lib/python3.5/site-packages/tornado/gen.py", line 867, in error_callback
future.result()
File "/opt/conda/lib/python3.5/site-packages/jupyterhub/user.py", line 280, in spawn
raise e
File "/opt/conda/lib/python3.5/site-packages/jupyterhub/user.py", line 256, in spawn
yield self.server.wait_up(http=True, timeout=spawner.http_timeout)
File "/opt/conda/lib/python3.5/site-packages/jupyterhub/orm.py", line 108, in wait_up
yield wait_for_http_server(self.url, timeout=timeout)
File "/opt/conda/lib/python3.5/site-packages/jupyterhub/utils.py", line 94, in wait_for_http_server
**locals()
TimeoutError: Server at http://172.31.15.174:32771/user/jhuser1 didn't respond in 30 seconds

Issue defining custom volume binds

I'm trying to define custom mount points for a spawner and ran into an issue. Following the SystemUserSpawner source, I inherited from DockerSpawner and defined by my own versions of volume_mount_points and volume_binds. Unfortunately, in order for the volumes to actually bind to the resulting container, I had to construct/return a native dict in volume_binds instead of the result of calling super().volume_binds

Unable to start Jupyter NB from dockerized JHub

I am trying to set up a Jupyterhub server based on Jessica Hamrick's blog (https://developer.rackspace.com/blog/deploying-jupyterhub-for-education/) and I have an issue during the spawning of the Jupyter Notebook.

My set up is very similar to the one described by Jessica: Jupyterhub running inside a Docker container, configured with dockerspawner (at the moment the single user). When successful, it is supposed to spawn a Jupyter NB (also in a Docker container) on the same machine as the JHub container. In addition, I also use the GitHub oauthentication authenticator.

The authentication works fine. Unfortunately when trying to create a NB, I got these errors on my JHub logging:

[I 2016-06-10 08:50:01.963 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 9.74ms
[I 2016-06-10 08:50:02.004 JupyterHub dockerspawner:400] Found existing container 'jupyter-hans-permana' (id: cf2fb1d)
[I 2016-06-10 08:50:02.004 JupyterHub dockerspawner:405] Starting container 'jupyter-hans-permana' (id: cf2fb1d)
[W 2016-06-10 08:50:12.004 JupyterHub base:327] User hans-permana server is slow to become responsive
[I 2016-06-10 08:50:12.019 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 10047.97ms
[I 2016-06-10 08:50:12.025 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.53ms
[I 2016-06-10 08:50:12.046 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 11.31ms
[I 2016-06-10 08:50:12.052 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.47ms
[I 2016-06-10 08:50:12.073 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 13.45ms
[I 2016-06-10 08:50:12.081 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.90ms
[I 2016-06-10 08:50:12.100 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 11.70ms
[I 2016-06-10 08:50:12.106 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.54ms
[I 2016-06-10 08:50:12.126 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 11.70ms
[I 2016-06-10 08:50:12.132 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.46ms
[I 2016-06-10 08:50:12.152 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 12.03ms
[I 2016-06-10 08:50:12.157 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.44ms
[I 2016-06-10 08:50:12.176 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 10.72ms
[I 2016-06-10 08:50:12.183 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.61ms
[I 2016-06-10 08:50:12.202 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 10.50ms
[I 2016-06-10 08:50:12.207 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.00ms
[I 2016-06-10 08:50:12.226 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 10.04ms
[I 2016-06-10 08:50:12.231 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 1.00ms
[I 2016-06-10 08:50:12.249 JupyterHub log:100] 302 GET /hub/user/hans-permana ([email protected]) 9.98ms
[I 2016-06-10 08:50:12.255 JupyterHub log:100] 302 GET /user/hans-permana (@10.3.14.133) 0.95ms
[W 2016-06-10 08:50:32.306 JupyterHub user:264] hans-permana's server never showed up at http://127.0.0.1:32812/user/hans-permana after 30 seconds. Giving up
[I 2016-06-10 08:50:32.310 JupyterHub dockerspawner:472] Stopping container jupyter-hans-permana (id: cf2fb1d)
[E 2016-06-10 08:50:32.574 JupyterHub gen:871] Exception in Future <tornado.concurrent.Future object at 0x7f838e1dc780> after timeout
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/gen.py", line 867, in error_callback
        future.result()
      File "/opt/conda/lib/python3.5/site-packages/jupyterhub/user.py", line 280, in spawn
        raise e
      File "/opt/conda/lib/python3.5/site-packages/jupyterhub/user.py", line 256, in spawn
        yield self.server.wait_up(http=True, timeout=spawner.http_timeout)
      File "/opt/conda/lib/python3.5/site-packages/jupyterhub/orm.py", line 108, in wait_up
        yield wait_for_http_server(self.url, timeout=timeout)
      File "/opt/conda/lib/python3.5/site-packages/jupyterhub/utils.py", line 94, in wait_for_http_server
        **locals()
    TimeoutError: Server at http://127.0.0.1:32812/user/hans-permana didn't respond in 30 seconds

The Jupyter NB container was initially running, and then just died.

Based on reading some other issues, I am guessing that it is something to do with configuring the IP address of the Hub. I have experimented with it, especially with the property c.JupyterHub.hub_ip and c.DockerSpawner.hub_ip_connect, but so far I have been unsuccessful.

Could someone shed some light?

Remind admins to be careful with secrets

It would be good to update admins that to be careful that the secrets is not checked into version control and publicly viewable. A comment in the examples env file seems a reasonable solution. This should also be done for jupyterhub/oauthenticator example.

Use `inspect_container` instead of `containers` for polling.

DockerSpawner.get_container currently uses the containers api from docker-py to poll containers. This has three issues:

  1. It pulls far more information than it needs to. We get info on ALL containers, iterate over them, find the one that matches the container we care about, then throw it away.
  2. We have to parse the result to extract useful information, which can lead to bugs in corner cases (c.f. 4e23b6f).
  3. The information actually returned by container is fairly limited compared to the information actually available from the docker daemon.

A far better alternative, IMO, would be to use inspect_container to request detailed information on the specific container we actually care about.

500 : Internal Server Error

and I can't figure out what is causing it. This is what I get in the logs:

[I 2015-06-08 06:37:31.845 JupyterHub log:100] 302 GET /user/nicolas (@192.168.0.114) 1.10ms
[E 2015-06-08 06:37:31.859 JupyterHub web:1496] Uncaught exception GET /hub/user/nicolas (192.168.0.114)
    HTTPServerRequest(protocol='http', host='qucitserver:8000', method='GET', uri='/hub/user/nicolas', version='HTTP/1.1', remote_ip='192.168.0.114', headers={'Host': 'qucitserver:8000', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'X-Forwarded-Port': '8000', 'Cookie': 'jupyter-hub-token="2|1:0|10:1433513499|17:jupyter-hub-token|44:MzI3YmNjODNmYTM3NDFmODk3N2Y5ZjJlMmQ5YjkwNGU=|bfaa7de51740b5d383ed9cb7e40f3dcf3204c62b35a3361d37e6664c23baf68a"', 'Connection': 'close', 'X-Forwarded-Proto': 'http', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36', 'X-Forwarded-For': '192.168.0.114', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8,fr;q=0.6,it;q=0.4'})
    Traceback (most recent call last):
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/tornado/web.py", line 1415, in _execute
        result = yield result
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/jupyterhub/handlers/base.py", line 416, in get
        status = yield current_user.spawner.poll()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 219, in poll
        container = yield self.get_container()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 245, in get_container
        'inspect_container', self.container_name
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 395, in result
        return self.__get_result()
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 354, in __get_result
        raise self._exception
      File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 207, in _docker
        return m(*args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/utils/decorators.py", line 15, in wrapped
        return f(self, resource_id, *args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 745, in inspect_container
        self._get(self._url("/containers/{0}/json".format(container))),
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 106, in _get
        return self.get(url, **self._set_request_timeout(kwargs))
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 477, in get
        return self.request('GET', url, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 465, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 573, in send
        r = adapter.send(request, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/adapters.py", line 415, in send
        raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Beside, after that I needed to delete my ~/.ipython/profile_default, otherwise I would get

[E 2015-06-08 06:32:09.094 JupyterHub orm:376] Unhandled error starting nicolas's server: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[E 2015-06-08 06:32:09.096 JupyterHub orm:384] Failed to cleanup nicolas's server that failed to start
    Traceback (most recent call last):
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/jupyterhub/orm.py", line 380, in spawn
        yield self.stop()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/jupyterhub/orm.py", line 434, in stop
        status = yield self.spawner.poll()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 219, in poll
        container = yield self.get_container()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 245, in get_container
        'inspect_container', self.container_name
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 395, in result
        return self.__get_result()
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 354, in __get_result
        raise self._exception
      File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 207, in _docker
        return m(*args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/utils/decorators.py", line 15, in wrapped
        return f(self, resource_id, *args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 745, in inspect_container
        self._get(self._url("/containers/{0}/json".format(container))),
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 106, in _get
        return self.get(url, **self._set_request_timeout(kwargs))
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 477, in get
        return self.request('GET', url, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 465, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 573, in send
        r = adapter.send(request, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/adapters.py", line 415, in send
        raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

It's a cool project, by the way! :-)

No Attribute _cross_validation_lock

I am trying to launch JupyterHub with the Github Authenticator and I am running into the following issue. Any suggestions as to what might be causing this?

Traceback (most recent call last):
File "/path/to/dir/jupyterhub/jupyterhub/app.py", line 1063, in launch_instance_async
yield self.initialize(argv)
File "/path/to/dir/jupyterhub/jupyterhub/app.py", line 882, in initialize
yield self.init_spawners()
File "/path/to/dir/jupyterhub/jupyterhub/app.py", line 682, in init_spawners
user=user, hub=self.hub, config=self.config, db=self.db,
File "/path/to/dir/jupyterhub/jupyterhub/spawner.py", line 114, in init
self.load_state(self.user.state)
File "/usr/local/lib/python3.4/dist-packages/dockerspawner/dockerspawner.py", line 165, in load_state
self.container_id = state.get('container_id', '')
File "/usr/local/lib/python3.4/dist-packages/src/traitlets/traitlets/traitlets.py", line 450, in set
new_value = self._validate(obj, value)
File "/usr/local/lib/python3.4/dist-packages/src/traitlets/traitlets/traitlets.py", line 472, in _validate
if obj._cross_validation_lock is False:
AttributeError: 'DockerSpawner' object has no attribute '_cross_validation_lock'

systemuser docker won't build

When running sudo docker build -t jupyter/systemuser systemuser I run into the following error:

Removing intermediate container c469ee26fc12
Step 4 : RUN chmod 755 /usr/local/bin/jupyterhub-singleuser
 ---> Running in 4bb14b3b8391
chmod: changing permissions of โ€˜/usr/local/bin/jupyterhub-singleuserโ€™: Operation not permitted
The command '/bin/sh -c chmod 755 /usr/local/bin/jupyterhub-singleuser' returned a non-zero code: 1

I got around this by putting USER root before the chmod command in the Dockerfile but I don't feel like that is the proper solution...

EDIT: This is on Ubuntu 14.04 with docker 1.9.1, I also tried it with the ubuntu repository version of docker (not sure what version that was) but that failed as well, so I upgraded hoping that was my issue but it wasn't

{username} in container mount point

Assuming my username is eschlon, my goal was to mount /home/eschlon on the host to /home/eschlon inside the container. It seemed relatively straightforward, this seems to mostly work fine:

c.DockerSpawner.volumes = {'/home/{username}': '/home/{username}'}

However, I noticed that in addition to /home/eschlon I ended up with an additional literal _/home/{username}_. It seems that while user.name is interpolated into both the local and container paths in volume_binds the same is not true when local volumes are created in volume_mount_points.

I've overridden that method in my custom Spawner like so:

    @property
    def volume_mount_points(self):
        """
        Override of the DockerSpawner method.

        The parent method fails to handle cases where internal docker mount points have {username} in them. Thus
        something like {'/home/{username}': '/home/{username}'} will end up creating a literal "{username}".
        """
        return [value.format(username=self.user.name) for value in list(self.volumes.values()) +
                                                                   list(self.read_only_volumes.values())]

Things work as expected, though it does seem like it might properly belong here. I can submit a pull request if you think it'd be useful (or an owner can just make the change, as it's pretty small).

cannot access Lab directly (ignoring Spawner.default_url)

I tried to test jupyterhub + dockerspawner with JupyterLab .

I can access Lab page if I type the URL (such that /user/%U/lab)
but I cannot access directly from Login Screen.

And I can access Lab directly when I don't use dockerspawner.

There are no logs to GET /lab or /user/%U/lab on the logs of jupyterhub and docker container.
I'm wondering if dockerspawner ignores or overwrites Spawner.default_url setting.

I use
jupyterhub 0.6.1 (installed by conda)
dockerspawner 0.5.0

The Dockerfile when I tried to build image is here.

FROM jupyterhub/singleuser:latest

USER root
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y htop
RUN conda update --all -c defaults --yes
RUN conda config --set channel_priority false
RUN conda install -c conda-forge jupyterlab --yes
RUN jupyter serverextension enable --py jupyterlab --sys-prefix

And extract from my jupyterhub_config.py is here.

c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.DockerSpawner.hub_ip_connect = '172.17.0.1'
c.JupyterHub.hub_ip = '172.17.0.1'
c.DockerSpawner.container_image = "oooooooooo"
c.Spawner.default_url = '/lab'

``500: Internal Server Error`` on Centos 7 VM

I met a problem trying to run dockerspawner on a Centos 7 (VM made through Virtual Box).
We're using VM to test our setups before deploying them on a production servers.

jupyterhub_config.py is the same as dockerspawner example

jupyterhub was installed from following requirments.txt

ipython[all]
jupyter[all]
jupyter_client
-e git+https://github.com/jupyter/jupyterhub#egg=jupyterhub
-e git+https://github.com/jupyter/oauthenticator#egg=oauthenticator
-e git+https://github.com/jupyter/dockerspawner#egg=dockerspawner

with following ansible playbook (assuming that docker is already installed on a vm)

---
# Deploy the jupyterhub instance. I know that file will be long so it will
# need be split into roles. Right now I put everything into one folder, it will
# have to be fix later.
- hosts: tnw-tn3
  become: true
  vars:
    - which_user: ansible
    # - which_user: rskolasinski
    - hub_folder: /home/{{ which_user }}/test_hub
    - venv_folder: "{{ hub_folder }}/venv"
    # - hub_name: march_meeting
    # - hub_folder: /srv/hubs/{{ hub_name }}
    # - venv_folder: /usr/local/jupyterhub
  tasks:
    - name: create folder for jupyterhub
      file:
        path: "{{ hub_folder }}"
        owner: "{{ which_user }}"
        group: "{{ which_user }}"
        state: directory
        mode: 'u=rwx,go='

    - name: copy required files
      copy:
        src: dockerspawner/
        dest: "{{ hub_folder }}"
        owner: "{{ which_user }}"
        group: "{{ which_user }}"

    - name: upgrade all packages
        yum: name=* state=latest

    - name: Install epel-release (needed for pip)
      yum: name=epel-release state=present

    - name: install the 'Development tools' package group
      yum: name="@Development tools" state=present

    - name: various requirments from yum
      yum: name={{ item }} state=present
      with_items:
        - htop
        - git
        - python34
        - python34-devel
        - python34-setuptools
        - npm
        - nodejs
        - supervisor

    - name: Install configurable-http-proxy from npm
      npm: name=configurable-http-proxy state=present global=yes

    - name: Get pip3.4
      shell: curl https://bootstrap.pypa.io/get-pip.py | python3.4

    - name: Make sure that virtualenv is up to date
      pip: name=virtualenv executable=pip3.4

    - name: Make sure that virtualenv-clone is up to date
      pip: name=virtualenv-clone executable=pip3.4

    - name: install jupyterhub into venv
      remote_user: "{{ which_user }}"
      become: false
      pip: requirements={{ hub_folder }}/requirements.txt virtualenv={{ venv_folder }} executable=pip3.4

Logs from jupyterhub:

(venv) vm3-rskolasinski:test_hub> bash run.sh --no-ssl
/home/rskolasinski/test_hub/venv/lib/python3.4/site-packages/IPython/utils/localinterfaces.py:3: UserWarning: IPython.utils.localinterfaces has moved to jupyter_client.localinterfaces
  warn("IPython.utils.localinterfaces has moved to jupyter_client.localinterfaces")
[I 2016-03-04 00:32:00.069 JupyterHub app:563] Loading cookie_secret from /home/rskolasinski/test_hub/jupyterhub_cookie_secret
[W 2016-03-04 00:32:00.141 JupyterHub app:297] 
    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 2016-03-04 00:32:00.225 JupyterHub app:1119] Hub API listening on http://10.0.2.15:8081/hub/
[W 2016-03-04 00:32:00.230 JupyterHub app:856] Running JupyterHub without SSL. There better be SSL termination happening somewhere else...
[I 2016-03-04 00:32:00.230 JupyterHub app:865] Starting proxy @ http://*:8000/
00:32:00.332 - info: [ConfigProxy] Proxying http://*:8000 to http://10.0.2.15:8081
00:32:00.336 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
[I 2016-03-04 00:32:00.356 JupyterHub app:1142] JupyterHub is now running at http://127.0.0.1:8000/
[I 2016-03-04 00:32:08.769 JupyterHub log:100] 302 GET / (@127.0.0.1) 2.67ms
[I 2016-03-04 00:32:08.797 JupyterHub log:100] 302 GET /hub (@127.0.0.1) 0.60ms
[W 2016-03-04 00:32:08.807 JupyterHub base:157] Invalid or expired cookie token
[W 2016-03-04 00:32:08.811 JupyterHub base:157] Invalid or expired cookie token
[I 2016-03-04 00:32:08.812 JupyterHub log:100] 302 GET /hub/ (@127.0.0.1) 1.91ms
[I 2016-03-04 00:32:10.525 JupyterHub oauth2:36] oauth redirect: 'http://localhost:8000/hub/oauth_callback'
[I 2016-03-04 00:32:10.530 JupyterHub log:100] 302 GET /hub/oauth_login (@127.0.0.1) 2.40ms
[I 2016-03-04 00:32:11.992 JupyterHub log:100] 302 GET /hub/oauth_callback?code=0ba5d6fd0f24b5bc1a2d (@127.0.0.1) 853.29ms
[I 2016-03-04 00:32:13.105 JupyterHub log:100] 302 GET /hub/spawn ([email protected]) 6.17ms
[I 2016-03-04 00:32:13.121 JupyterHub log:100] 302 GET /user/RafalSkolasinski (@127.0.0.1) 1.07ms
[I 2016-03-04 00:32:13.176 JupyterHub dockerspawner:399] Found existing container 'jupyter-RafalSkolasinski' (id: e1b0998)
[I 2016-03-04 00:32:13.176 JupyterHub dockerspawner:404] Starting container 'jupyter-RafalSkolasinski' (id: e1b0998)
[I 2016-03-04 00:32:14.423 JupyterHub base:301] User RafalSkolasinski server took 1.285 seconds to start
[I 2016-03-04 00:32:14.423 JupyterHub orm:179] Adding user RafalSkolasinski to proxy /user/RafalSkolasinski => http://127.0.0.1:32775
[I 2016-03-04 00:32:14.445 JupyterHub log:100] 302 GET /hub/user/RafalSkolasinski ([email protected]) 1308.97ms
^C
Interrupted
[I 2016-03-04 00:32:34.909 JupyterHub app:1011] Cleaning up single-user servers...
[I 2016-03-04 00:32:34.918 JupyterHub app:1022] Cleaning up proxy[17620]...
[I 2016-03-04 00:32:34.936 JupyterHub dockerspawner:332] Container 'jupyter-basnijholt' is gone
[I 2016-03-04 00:32:34.936 JupyterHub dockerspawner:332] Container 'jupyter-rafalskolasinski' is gone
[I 2016-03-04 00:32:34.936 JupyterHub dockerspawner:332] Container 'jupyter-akhmerov' is gone
[I 2016-03-04 00:32:34.936 JupyterHub dockerspawner:332] Container 'jupyter-michaelwimmer' is gone
[W 2016-03-04 00:32:34.937 JupyterHub dockerspawner:303] container not found
[W 2016-03-04 00:32:34.937 JupyterHub dockerspawner:303] container not found
[W 2016-03-04 00:32:34.937 JupyterHub dockerspawner:303] container not found
[W 2016-03-04 00:32:34.937 JupyterHub dockerspawner:303] container not found
[I 2016-03-04 00:32:34.987 JupyterHub dockerspawner:457] Stopping container jupyter-RafalSkolasinski (id: e1b0998)
[I 2016-03-04 00:32:35.379 JupyterHub app:1048] ...done

and logs from inside of docker container (docker logs container_id)

(venv) vm3-rskolasinski:test_hub> docker logs e1b0998087d3
[W 2016-03-03 19:37:43.158 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:37:43.161 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:37:43.164 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[I 2016-03-03 19:37:43.179 RafalSkolasinski notebookapp:505] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 2016-03-03 19:37:43.370 RafalSkolasinski notebookapp:1079] Serving notebooks from local directory: /home/jovyan/work
[I 2016-03-03 19:37:43.370 RafalSkolasinski notebookapp:1079] 0 active kernels 
[I 2016-03-03 19:37:43.370 RafalSkolasinski notebookapp:1079] The Jupyter Notebook is running at: http://0.0.0.0:8888/user/RafalSkolasinski/
[I 2016-03-03 19:37:43.370 RafalSkolasinski notebookapp:1080] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2016-03-03 19:37:43.393 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (172.17.0.1) 1.12ms
[I 2016-03-03 19:37:43.422 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (127.0.0.1) 0.59ms
[E 2016-03-03 19:37:44.435 RafalSkolasinski web:1524] Uncaught exception GET /user/RafalSkolasinski/tree (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/user/RafalSkolasinski/tree', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'X-Forwarded-Proto': 'http', 'Upgrade-Insecure-Requests': '1', 'Connection': 'close', 'Cookie': 'jupyter-hub-token-RafalSkolasinski="2|1:0|10:1457033863|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|cce098474f52012451198478913de68e1adc8f1b083953530cbda25470c98516"', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36', 'Accept-Encoding': 'gzip, deflate, sdch', 'X-Forwarded-Port': '8000', 'Referer': 'http://localhost:8000/hub/home', 'Host': 'localhost:8000', 'Accept-Language': 'en-GB,en;q=0.8,pl;q=0.6', 'X-Forwarded-For': '127.0.0.1', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'})
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 137, in _new_conn
        (self.host, self.port), self.timeout, **extra_kw)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
        raise err
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
        sock.connect(sa)
    OSError: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
        body=body, headers=headers)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/opt/conda/lib/python3.5/http/client.py", line 1083, in request
        self._send_request(method, url, body, headers)
      File "/opt/conda/lib/python3.5/http/client.py", line 1128, in _send_request
        self.endheaders(body)
      File "/opt/conda/lib/python3.5/http/client.py", line 1079, in endheaders
        self._send_output(message_body)
      File "/opt/conda/lib/python3.5/http/client.py", line 911, in _send_output
        self.send(msg)
      File "/opt/conda/lib/python3.5/http/client.py", line 854, in send
        self.connect()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 162, in connect
        conn = self._new_conn()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 146, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f632c4d4828>: Failed to establish a new connection: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
        timeout=timeout
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
        _stacktrace=sys.exc_info()[2])
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 273, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457033863%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7Ccce098474f52012451198478913de68e1adc8f1b083953530cbda25470c98516 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f632c4d4828>: Failed to establish a new connection: [Errno 113] No route to host',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2787, in wrapper
        if not self.current_user:
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1095, in current_user
        self._current_user = self.get_current_user()
      File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 82, in get_current_user
        return self.login_handler.get_user(self)
      File "/usr/local/bin/jupyterhub-singleuser", line 90, in get_user
        auth_data = JupyterHubLoginHandler.verify_token(self, self.cookie_name, encrypted_cookie)
      File "/usr/local/bin/jupyterhub-singleuser", line 59, in verify_token
        headers = {'Authorization' : 'token %s' % hub_api_key},
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 67, in get
        return request('get', url, params=params, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 437, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457033863%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7Ccce098474f52012451198478913de68e1adc8f1b083953530cbda25470c98516 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f632c4d4828>: Failed to establish a new connection: [Errno 113] No route to host',))
[E 2016-03-03 19:37:44.478 RafalSkolasinski log:46] {
      "X-Forwarded-Proto": "http",
      "Upgrade-Insecure-Requests": "1",
      "Connection": "close",
      "Cookie": "jupyter-hub-token-RafalSkolasinski=\"2|1:0|10:1457033863|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|cce098474f52012451198478913de68e1adc8f1b083953530cbda25470c98516\"",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36",
      "Accept-Encoding": "gzip, deflate, sdch",
      "X-Forwarded-Port": "8000",
      "Referer": "http://localhost:8000/hub/home",
      "Host": "localhost:8000",
      "Accept-Language": "en-GB,en;q=0.8,pl;q=0.6",
      "X-Forwarded-For": "127.0.0.1",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
    }
[E 2016-03-03 19:37:44.478 RafalSkolasinski log:47] 500 GET /user/RafalSkolasinski/tree (127.0.0.1) 1047.74ms referer=http://localhost:8000/hub/home
[C 2016-03-03 19:38:13.838 RafalSkolasinski notebookapp:984] received signal 15, stopping
[I 2016-03-03 19:38:13.839 RafalSkolasinski notebookapp:1034] Shutting down kernels
[W 2016-03-03 19:42:40.984 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:42:40.987 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:42:40.991 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[I 2016-03-03 19:42:41.352 RafalSkolasinski notebookapp:1079] Serving notebooks from local directory: /home/jovyan/work
[I 2016-03-03 19:42:41.353 RafalSkolasinski notebookapp:1079] 0 active kernels 
[I 2016-03-03 19:42:41.353 RafalSkolasinski notebookapp:1079] The Jupyter Notebook is running at: http://0.0.0.0:8888/user/RafalSkolasinski/
[I 2016-03-03 19:42:41.353 RafalSkolasinski notebookapp:1080] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2016-03-03 19:42:41.378 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (172.17.0.1) 1.91ms
[E 2016-03-03 19:42:42.423 RafalSkolasinski web:1524] Uncaught exception GET /user/RafalSkolasinski/tree (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/user/RafalSkolasinski/tree', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Cache-Control': 'max-age=0', 'Referer': 'http://localhost:8000/hub/home', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Connection': 'close', 'X-Forwarded-For': '127.0.0.1', 'Accept-Encoding': 'gzip, deflate, sdch', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36', 'Cookie': 'jupyter-hub-token-RafalSkolasinski="2|1:0|10:1457034161|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|078d6148cc9a34bdf04c94fe8f70f8bbf8eb896a6f3c63c3fa80387496c938d6"', 'Accept-Language': 'en-GB,en;q=0.8,pl;q=0.6', 'Host': 'localhost:8000', 'X-Forwarded-Port': '8000', 'X-Forwarded-Proto': 'http'})
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 137, in _new_conn
        (self.host, self.port), self.timeout, **extra_kw)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
        raise err
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
        sock.connect(sa)
    OSError: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
        body=body, headers=headers)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/opt/conda/lib/python3.5/http/client.py", line 1083, in request
        self._send_request(method, url, body, headers)
      File "/opt/conda/lib/python3.5/http/client.py", line 1128, in _send_request
        self.endheaders(body)
      File "/opt/conda/lib/python3.5/http/client.py", line 1079, in endheaders
        self._send_output(message_body)
      File "/opt/conda/lib/python3.5/http/client.py", line 911, in _send_output
        self.send(msg)
      File "/opt/conda/lib/python3.5/http/client.py", line 854, in send
        self.connect()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 162, in connect
        conn = self._new_conn()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 146, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7fba2c3e7390>: Failed to establish a new connection: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
        timeout=timeout
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
        _stacktrace=sys.exc_info()[2])
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 273, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457034161%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7C078d6148cc9a34bdf04c94fe8f70f8bbf8eb896a6f3c63c3fa80387496c938d6 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fba2c3e7390>: Failed to establish a new connection: [Errno 113] No route to host',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2787, in wrapper
        if not self.current_user:
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1095, in current_user
        self._current_user = self.get_current_user()
      File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 82, in get_current_user
        return self.login_handler.get_user(self)
      File "/usr/local/bin/jupyterhub-singleuser", line 90, in get_user
        auth_data = JupyterHubLoginHandler.verify_token(self, self.cookie_name, encrypted_cookie)
      File "/usr/local/bin/jupyterhub-singleuser", line 59, in verify_token
        headers = {'Authorization' : 'token %s' % hub_api_key},
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 67, in get
        return request('get', url, params=params, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 437, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457034161%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7C078d6148cc9a34bdf04c94fe8f70f8bbf8eb896a6f3c63c3fa80387496c938d6 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fba2c3e7390>: Failed to establish a new connection: [Errno 113] No route to host',))
[E 2016-03-03 19:42:42.584 RafalSkolasinski log:46] {
      "Cache-Control": "max-age=0",
      "Referer": "http://localhost:8000/hub/home",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "Connection": "close",
      "X-Forwarded-For": "127.0.0.1",
      "Accept-Encoding": "gzip, deflate, sdch",
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36",
      "Cookie": "jupyter-hub-token-RafalSkolasinski=\"2|1:0|10:1457034161|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|078d6148cc9a34bdf04c94fe8f70f8bbf8eb896a6f3c63c3fa80387496c938d6\"",
      "Accept-Language": "en-GB,en;q=0.8,pl;q=0.6",
      "Host": "localhost:8000",
      "X-Forwarded-Port": "8000",
      "X-Forwarded-Proto": "http"
    }
[E 2016-03-03 19:42:42.584 RafalSkolasinski log:47] 500 GET /user/RafalSkolasinski/tree (127.0.0.1) 1169.53ms referer=http://localhost:8000/hub/home
[C 2016-03-03 19:42:52.862 RafalSkolasinski notebookapp:984] received signal 15, stopping
[I 2016-03-03 19:42:52.864 RafalSkolasinski notebookapp:1034] Shutting down kernels
[W 2016-03-03 19:42:55.626 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:42:55.629 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:42:55.633 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[I 2016-03-03 19:42:55.739 RafalSkolasinski notebookapp:1079] Serving notebooks from local directory: /home/jovyan/work
[I 2016-03-03 19:42:55.740 RafalSkolasinski notebookapp:1079] 0 active kernels 
[I 2016-03-03 19:42:55.740 RafalSkolasinski notebookapp:1079] The Jupyter Notebook is running at: http://0.0.0.0:8888/user/RafalSkolasinski/
[I 2016-03-03 19:42:55.740 RafalSkolasinski notebookapp:1080] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2016-03-03 19:42:55.746 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (172.17.0.1) 0.97ms
[I 2016-03-03 19:42:55.799 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski/ (127.0.0.1) 1.05ms
[E 2016-03-03 19:42:56.820 RafalSkolasinski web:1524] Uncaught exception GET /user/RafalSkolasinski/tree (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/user/RafalSkolasinski/tree', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Encoding': 'gzip, deflate, sdch', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'X-Forwarded-For': '127.0.0.1', 'Referer': 'http://localhost:8000/hub/home', 'X-Forwarded-Proto': 'http', 'Connection': 'close', 'Accept-Language': 'en-GB,en;q=0.8,pl;q=0.6', 'Cookie': 'jupyter-hub-token-RafalSkolasinski="2|1:0|10:1457034175|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|98b403070f5eec17bf5bef5d9a9d91d157a05e3648ed77dc678dcfb1744a8d03"', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36', 'X-Forwarded-Port': '8000', 'Host': 'localhost:8000'})
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 137, in _new_conn
        (self.host, self.port), self.timeout, **extra_kw)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
        raise err
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
        sock.connect(sa)
    OSError: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
        body=body, headers=headers)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/opt/conda/lib/python3.5/http/client.py", line 1083, in request
        self._send_request(method, url, body, headers)
      File "/opt/conda/lib/python3.5/http/client.py", line 1128, in _send_request
        self.endheaders(body)
      File "/opt/conda/lib/python3.5/http/client.py", line 1079, in endheaders
        self._send_output(message_body)
      File "/opt/conda/lib/python3.5/http/client.py", line 911, in _send_output
        self.send(msg)
      File "/opt/conda/lib/python3.5/http/client.py", line 854, in send
        self.connect()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 162, in connect
        conn = self._new_conn()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 146, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f61297c5390>: Failed to establish a new connection: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
        timeout=timeout
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
        _stacktrace=sys.exc_info()[2])
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 273, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457034175%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7C98b403070f5eec17bf5bef5d9a9d91d157a05e3648ed77dc678dcfb1744a8d03 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f61297c5390>: Failed to establish a new connection: [Errno 113] No route to host',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2787, in wrapper
        if not self.current_user:
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1095, in current_user
        self._current_user = self.get_current_user()
      File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 82, in get_current_user
        return self.login_handler.get_user(self)
      File "/usr/local/bin/jupyterhub-singleuser", line 90, in get_user
        auth_data = JupyterHubLoginHandler.verify_token(self, self.cookie_name, encrypted_cookie)
      File "/usr/local/bin/jupyterhub-singleuser", line 59, in verify_token
        headers = {'Authorization' : 'token %s' % hub_api_key},
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 67, in get
        return request('get', url, params=params, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 437, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457034175%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7C98b403070f5eec17bf5bef5d9a9d91d157a05e3648ed77dc678dcfb1744a8d03 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f61297c5390>: Failed to establish a new connection: [Errno 113] No route to host',))
[E 2016-03-03 19:42:56.890 RafalSkolasinski log:46] {
      "Accept-Encoding": "gzip, deflate, sdch",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "X-Forwarded-For": "127.0.0.1",
      "Referer": "http://localhost:8000/hub/home",
      "X-Forwarded-Proto": "http",
      "Connection": "close",
      "Accept-Language": "en-GB,en;q=0.8,pl;q=0.6",
      "Cookie": "jupyter-hub-token-RafalSkolasinski=\"2|1:0|10:1457034175|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|98b403070f5eec17bf5bef5d9a9d91d157a05e3648ed77dc678dcfb1744a8d03\"",
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36",
      "X-Forwarded-Port": "8000",
      "Host": "localhost:8000"
    }
[E 2016-03-03 19:42:56.890 RafalSkolasinski log:47] 500 GET /user/RafalSkolasinski/tree (127.0.0.1) 1078.22ms referer=http://localhost:8000/hub/home
[C 2016-03-03 19:43:07.740 RafalSkolasinski notebookapp:984] received signal 15, stopping
[I 2016-03-03 19:43:07.741 RafalSkolasinski notebookapp:1034] Shutting down kernels
[W 2016-03-03 19:43:10.375 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:43:10.378 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 19:43:10.382 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[I 2016-03-03 19:43:10.625 RafalSkolasinski notebookapp:1079] Serving notebooks from local directory: /home/jovyan/work
[I 2016-03-03 19:43:10.625 RafalSkolasinski notebookapp:1079] 0 active kernels 
[I 2016-03-03 19:43:10.625 RafalSkolasinski notebookapp:1079] The Jupyter Notebook is running at: http://0.0.0.0:8888/user/RafalSkolasinski/
[I 2016-03-03 19:43:10.625 RafalSkolasinski notebookapp:1080] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2016-03-03 19:43:10.649 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (172.17.0.1) 1.39ms
[I 2016-03-03 19:43:10.715 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski/ (127.0.0.1) 0.49ms
[E 2016-03-03 19:43:11.731 RafalSkolasinski web:1524] Uncaught exception GET /user/RafalSkolasinski/tree (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/user/RafalSkolasinski/tree', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Connection': 'close', 'Cookie': 'jupyter-hub-token-RafalSkolasinski="2|1:0|10:1457034190|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|35a4555c30c9ac14021d6dd28b4c10540fd6a8ad6e3dc87392d73c8792aba89a"', 'X-Forwarded-Proto': 'http', 'X-Forwarded-For': '127.0.0.1', 'Accept-Encoding': 'gzip, deflate, sdch', 'Upgrade-Insecure-Requests': '1', 'Referer': 'http://localhost:8000/hub/home', 'X-Forwarded-Port': '8000', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language': 'en-GB,en;q=0.8,pl;q=0.6', 'Host': 'localhost:8000', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'})
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 137, in _new_conn
        (self.host, self.port), self.timeout, **extra_kw)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
        raise err
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
        sock.connect(sa)
    OSError: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
        body=body, headers=headers)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/opt/conda/lib/python3.5/http/client.py", line 1083, in request
        self._send_request(method, url, body, headers)
      File "/opt/conda/lib/python3.5/http/client.py", line 1128, in _send_request
        self.endheaders(body)
      File "/opt/conda/lib/python3.5/http/client.py", line 1079, in endheaders
        self._send_output(message_body)
      File "/opt/conda/lib/python3.5/http/client.py", line 911, in _send_output
        self.send(msg)
      File "/opt/conda/lib/python3.5/http/client.py", line 854, in send
        self.connect()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 162, in connect
        conn = self._new_conn()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 146, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f68bb96a2e8>: Failed to establish a new connection: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
        timeout=timeout
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
        _stacktrace=sys.exc_info()[2])
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 273, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457034190%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7C35a4555c30c9ac14021d6dd28b4c10540fd6a8ad6e3dc87392d73c8792aba89a (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f68bb96a2e8>: Failed to establish a new connection: [Errno 113] No route to host',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2787, in wrapper
        if not self.current_user:
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1095, in current_user
        self._current_user = self.get_current_user()
      File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 82, in get_current_user
        return self.login_handler.get_user(self)
      File "/usr/local/bin/jupyterhub-singleuser", line 90, in get_user
        auth_data = JupyterHubLoginHandler.verify_token(self, self.cookie_name, encrypted_cookie)
      File "/usr/local/bin/jupyterhub-singleuser", line 59, in verify_token
        headers = {'Authorization' : 'token %s' % hub_api_key},
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 67, in get
        return request('get', url, params=params, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 437, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457034190%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7C35a4555c30c9ac14021d6dd28b4c10540fd6a8ad6e3dc87392d73c8792aba89a (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f68bb96a2e8>: Failed to establish a new connection: [Errno 113] No route to host',))
[E 2016-03-03 19:43:11.777 RafalSkolasinski log:46] {
      "Connection": "close",
      "Cookie": "jupyter-hub-token-RafalSkolasinski=\"2|1:0|10:1457034190|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|35a4555c30c9ac14021d6dd28b4c10540fd6a8ad6e3dc87392d73c8792aba89a\"",
      "X-Forwarded-Proto": "http",
      "X-Forwarded-For": "127.0.0.1",
      "Accept-Encoding": "gzip, deflate, sdch",
      "Upgrade-Insecure-Requests": "1",
      "Referer": "http://localhost:8000/hub/home",
      "X-Forwarded-Port": "8000",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "Accept-Language": "en-GB,en;q=0.8,pl;q=0.6",
      "Host": "localhost:8000",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"
    }
[E 2016-03-03 19:43:11.777 RafalSkolasinski log:47] 500 GET /user/RafalSkolasinski/tree (127.0.0.1) 1051.37ms referer=http://localhost:8000/hub/home
[C 2016-03-03 19:43:16.557 RafalSkolasinski notebookapp:984] received signal 15, stopping
[I 2016-03-03 19:43:16.558 RafalSkolasinski notebookapp:1034] Shutting down kernels
[W 2016-03-03 20:18:35.976 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 20:18:35.979 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 20:18:35.982 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[I 2016-03-03 20:18:36.137 RafalSkolasinski notebookapp:1079] Serving notebooks from local directory: /home/jovyan/work
[I 2016-03-03 20:18:36.137 RafalSkolasinski notebookapp:1079] 0 active kernels 
[I 2016-03-03 20:18:36.137 RafalSkolasinski notebookapp:1079] The Jupyter Notebook is running at: http://0.0.0.0:8888/user/RafalSkolasinski/
[I 2016-03-03 20:18:36.137 RafalSkolasinski notebookapp:1080] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2016-03-03 20:18:36.156 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (172.17.0.1) 0.94ms
[I 2016-03-03 20:18:41.024 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (127.0.0.1) 0.56ms
[E 2016-03-03 20:18:42.034 RafalSkolasinski web:1524] Uncaught exception GET /user/RafalSkolasinski/tree (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/user/RafalSkolasinski/tree', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Encoding': 'gzip, deflate, sdch', 'Cookie': 'jupyter-hub-token-RafalSkolasinski="2|1:0|10:1457036315|34:jupyter-hub-token-RafalSkolasinski|44:MDUxMmQ4ZTYyOGM4NDdkYWI0MmE0ZDZmYTMwODM0YjE=|65132865a336649bc49305c2f49ebd0a84812685a2981e9ad9fa0b9b8f2823c0"', 'Host': 'localhost:8000', 'X-Forwarded-For': '127.0.0.1', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36', 'Accept-Language': 'en-GB,en;q=0.8,pl;q=0.6', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'X-Forwarded-Proto': 'http', 'X-Forwarded-Port': '8000', 'Connection': 'close'})
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 137, in _new_conn
        (self.host, self.port), self.timeout, **extra_kw)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
        raise err
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
        sock.connect(sa)
    OSError: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
        body=body, headers=headers)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/opt/conda/lib/python3.5/http/client.py", line 1083, in request
        self._send_request(method, url, body, headers)
      File "/opt/conda/lib/python3.5/http/client.py", line 1128, in _send_request
        self.endheaders(body)
      File "/opt/conda/lib/python3.5/http/client.py", line 1079, in endheaders
        self._send_output(message_body)
      File "/opt/conda/lib/python3.5/http/client.py", line 911, in _send_output
        self.send(msg)
      File "/opt/conda/lib/python3.5/http/client.py", line 854, in send
        self.connect()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 162, in connect
        conn = self._new_conn()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 146, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f29a5c512e8>: Failed to establish a new connection: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
        timeout=timeout
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
        _stacktrace=sys.exc_info()[2])
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 273, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457036315%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3AMDUxMmQ4ZTYyOGM4NDdkYWI0MmE0ZDZmYTMwODM0YjE%3D%7C65132865a336649bc49305c2f49ebd0a84812685a2981e9ad9fa0b9b8f2823c0 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f29a5c512e8>: Failed to establish a new connection: [Errno 113] No route to host',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2787, in wrapper
        if not self.current_user:
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1095, in current_user
        self._current_user = self.get_current_user()
      File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 82, in get_current_user
        return self.login_handler.get_user(self)
      File "/usr/local/bin/jupyterhub-singleuser", line 90, in get_user
        auth_data = JupyterHubLoginHandler.verify_token(self, self.cookie_name, encrypted_cookie)
      File "/usr/local/bin/jupyterhub-singleuser", line 59, in verify_token
        headers = {'Authorization' : 'token %s' % hub_api_key},
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 67, in get
        return request('get', url, params=params, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 437, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457036315%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3AMDUxMmQ4ZTYyOGM4NDdkYWI0MmE0ZDZmYTMwODM0YjE%3D%7C65132865a336649bc49305c2f49ebd0a84812685a2981e9ad9fa0b9b8f2823c0 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f29a5c512e8>: Failed to establish a new connection: [Errno 113] No route to host',))
[E 2016-03-03 20:18:42.082 RafalSkolasinski log:46] {
      "Accept-Encoding": "gzip, deflate, sdch",
      "Cookie": "jupyter-hub-token-RafalSkolasinski=\"2|1:0|10:1457036315|34:jupyter-hub-token-RafalSkolasinski|44:MDUxMmQ4ZTYyOGM4NDdkYWI0MmE0ZDZmYTMwODM0YjE=|65132865a336649bc49305c2f49ebd0a84812685a2981e9ad9fa0b9b8f2823c0\"",
      "Host": "localhost:8000",
      "X-Forwarded-For": "127.0.0.1",
      "Cache-Control": "max-age=0",
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36",
      "Accept-Language": "en-GB,en;q=0.8,pl;q=0.6",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "X-Forwarded-Proto": "http",
      "X-Forwarded-Port": "8000",
      "Connection": "close"
    }
[E 2016-03-03 20:18:42.083 RafalSkolasinski log:47] 500 GET /user/RafalSkolasinski/tree (127.0.0.1) 1050.01ms referer=None
[C 2016-03-03 20:20:08.985 RafalSkolasinski notebookapp:984] received signal 15, stopping
[I 2016-03-03 20:20:08.986 RafalSkolasinski notebookapp:1034] Shutting down kernels
[W 2016-03-03 23:32:14.256 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 23:32:14.259 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[W 2016-03-03 23:32:14.263 RafalSkolasinski configurable:159] Config option `open_browser` not recognized by `SingleUserNotebookApp`, do you mean : `browser`
[I 2016-03-03 23:32:14.363 RafalSkolasinski notebookapp:1079] Serving notebooks from local directory: /home/jovyan/work
[I 2016-03-03 23:32:14.363 RafalSkolasinski notebookapp:1079] 0 active kernels 
[I 2016-03-03 23:32:14.363 RafalSkolasinski notebookapp:1079] The Jupyter Notebook is running at: http://0.0.0.0:8888/user/RafalSkolasinski/
[I 2016-03-03 23:32:14.363 RafalSkolasinski notebookapp:1080] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2016-03-03 23:32:14.421 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (172.17.0.1) 1.09ms
[I 2016-03-03 23:32:14.452 RafalSkolasinski log:47] 302 GET /user/RafalSkolasinski (127.0.0.1) 0.57ms
[E 2016-03-03 23:32:15.466 RafalSkolasinski web:1524] Uncaught exception GET /user/RafalSkolasinski/tree (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/user/RafalSkolasinski/tree', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Cookie': 'jupyter-hub-token-RafalSkolasinski="2|1:0|10:1457047934|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|dce6845eaebf0a4af4f920e43d5f1481aa55d2086548e0f835eb8718555e79d7"', 'X-Forwarded-Port': '8000', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36', 'Accept-Encoding': 'gzip, deflate, sdch', 'Upgrade-Insecure-Requests': '1', 'Referer': 'http://localhost:8000/hub/home', 'Connection': 'close', 'X-Forwarded-Proto': 'http', 'X-Forwarded-For': '127.0.0.1', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Host': 'localhost:8000', 'Accept-Language': 'en-GB,en;q=0.8,pl;q=0.6'})
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 137, in _new_conn
        (self.host, self.port), self.timeout, **extra_kw)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
        raise err
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
        sock.connect(sa)
    OSError: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
        body=body, headers=headers)
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/opt/conda/lib/python3.5/http/client.py", line 1083, in request
        self._send_request(method, url, body, headers)
      File "/opt/conda/lib/python3.5/http/client.py", line 1128, in _send_request
        self.endheaders(body)
      File "/opt/conda/lib/python3.5/http/client.py", line 1079, in endheaders
        self._send_output(message_body)
      File "/opt/conda/lib/python3.5/http/client.py", line 911, in _send_output
        self.send(msg)
      File "/opt/conda/lib/python3.5/http/client.py", line 854, in send
        self.connect()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 162, in connect
        conn = self._new_conn()
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 146, in _new_conn
        self, "Failed to establish a new connection: %s" % e)
    requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7fe4bc96d390>: Failed to establish a new connection: [Errno 113] No route to host

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
        timeout=timeout
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
        _stacktrace=sys.exc_info()[2])
      File "/opt/conda/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 273, in increment
        raise MaxRetryError(_pool, url, error or ResponseError(cause))
    requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457047934%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7Cdce6845eaebf0a4af4f920e43d5f1481aa55d2086548e0f835eb8718555e79d7 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe4bc96d390>: Failed to establish a new connection: [Errno 113] No route to host',))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2787, in wrapper
        if not self.current_user:
      File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1095, in current_user
        self._current_user = self.get_current_user()
      File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 82, in get_current_user
        return self.login_handler.get_user(self)
      File "/usr/local/bin/jupyterhub-singleuser", line 90, in get_user
        auth_data = JupyterHubLoginHandler.verify_token(self, self.cookie_name, encrypted_cookie)
      File "/usr/local/bin/jupyterhub-singleuser", line 59, in verify_token
        headers = {'Authorization' : 'token %s' % hub_api_key},
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 67, in get
        return request('get', url, params=params, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/requests/adapters.py", line 437, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.2.15', port=8081): Max retries exceeded with url: /hub/api/authorizations/cookie/jupyter-hub-token-RafalSkolasinski/2%7C1%3A0%7C10%3A1457047934%7C34%3Ajupyter-hub-token-RafalSkolasinski%7C44%3ANzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA%3D%7Cdce6845eaebf0a4af4f920e43d5f1481aa55d2086548e0f835eb8718555e79d7 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe4bc96d390>: Failed to establish a new connection: [Errno 113] No route to host',))
[E 2016-03-03 23:32:15.510 RafalSkolasinski log:46] {
      "Cookie": "jupyter-hub-token-RafalSkolasinski=\"2|1:0|10:1457047934|34:jupyter-hub-token-RafalSkolasinski|44:NzNkYzJjMGZlNGI0NDZjZWE0MDE2NWYyZWQxMDk1YTA=|dce6845eaebf0a4af4f920e43d5f1481aa55d2086548e0f835eb8718555e79d7\"",
      "X-Forwarded-Port": "8000",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36",
      "Accept-Encoding": "gzip, deflate, sdch",
      "Upgrade-Insecure-Requests": "1",
      "Referer": "http://localhost:8000/hub/home",
      "Connection": "close",
      "X-Forwarded-Proto": "http",
      "X-Forwarded-For": "127.0.0.1",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "Host": "localhost:8000",
      "Accept-Language": "en-GB,en;q=0.8,pl;q=0.6"
    }
[E 2016-03-03 23:32:15.510 RafalSkolasinski log:47] 500 GET /user/RafalSkolasinski/tree (127.0.0.1) 1050.15ms referer=http://localhost:8000/hub/home
[C 2016-03-03 23:32:34.990 RafalSkolasinski notebookapp:984] received signal 15, stopping
[I 2016-03-03 23:32:34.991 RafalSkolasinski notebookapp:1034] Shutting down kernels

Unable to start a container - /usr/bin/env: python3: No such file or directory

While trying to start a container the jupyterhub server outputs the following:

[E 2016-01-13 09:07:42.749 JupyterHub gen:871] Exception in Future <tornado.concurrent.Future object at 0x7f50625bbba8> after timeout
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 867, in error_callback
        future.result()
      File "/root/jupyterhub/jupyterhub/user.py", line 231, in spawn
        raise e
      File "/root/jupyterhub/jupyterhub/user.py", line 207, in spawn
        yield self.server.wait_up(http=True, timeout=spawner.http_timeout)
      File "/root/jupyterhub/jupyterhub/orm.py", line 110, in wait_up
        yield wait_for_http_server(self.url, timeout=timeout)
      File "/root/jupyterhub/jupyterhub/utils.py", line 82, in wait_for_http_server
        **locals()
    TimeoutError: Server at http://127.0.0.1:32802/user/admin didn't respond in 30 seconds

Checking the Docker logs for the container reports:

/usr/bin/env: python3: No such file or directory

Removal of jovyan home directory in systemuser image

I've noticed that the jovyan folder in the home directory still exists in the systemuser image, even after removing it in the dockerfile. Doing my own experiment, it seems impossible to remove. rm -rf /home/jovyan in the docker file succeeds, but the folder still exists when the container starts. Removing it in a running container did infact remove the folder.

Is there any way to remove the folder within the docker file?

home creation issue

Hello, I try to use dockerspawner with the jupyter/systemuser image, but when I start it I get a message like this

Creating user my-user (12345)
/opt/conda/lib/python3.5/site-packages/IPython/paths.py:69: UserWarning: IPython parent '/home/my-user' is not a writable location, using a temp directory.
  " using a temp directory.".format(parent))
Traceback (most recent call last):
  File "/usr/local/bin/jupyterhub-singleuser", line 297, in <module>
    main()
  File "/usr/local/bin/jupyterhub-singleuser", line 293, in main
    return SingleUserNotebookApp.launch_instance()
  File "/opt/conda/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 588, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/notebook/notebookapp.py", line 1017, in initialize
    super(NotebookApp, self).initialize(argv)
  File "<decorator-gen-6>", line 2, in initialize
  File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/jupyter_core/application.py", line 243, in initialize
    self.migrate_config()
  File "/usr/local/bin/jupyterhub-singleuser", line 219, in migrate_config
    super(SingleUserNotebookApp, self).migrate_config()
  File "/opt/conda/lib/python3.5/site-packages/jupyter_core/application.py", line 169, in migrate_config
    migrate()
  File "/opt/conda/lib/python3.5/site-packages/jupyter_core/migrate.py", line 240, in migrate
    ensure_dir_exists(env['jupyter_config'])
  File "/opt/conda/lib/python3.5/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/opt/conda/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/my-user/.jupyter'

my effective config looks like this:

c.NotebookApp.allow_origin = '*'
c.JupyterHub.proxy_auth_token =  '#CENSORED'
c.JupyterHub.cookie_secret_file = '/etc/jupyterhub/cookie_secret'
import os


c.JupyterHub.confirm_no_ssl = True

from IPython.utils.localinterfaces import public_ips
c.JupyterHub.hub_ip = public_ips()[0]
c.JupyterHub.spawner_class = 'dockerspawner.SystemUserSpawner'
c.DockerSpawner.container_image = 'jupyter/systemuser'
c.DockerSpawner.remove_containers = True
c.JupyterHub.proxy_api_ip = '0.0.0.0'
c.DockerSpawner.container_ip = '0.0.0.0'
c.DockerSpawner.use_internal_ip = False
c.DockerSpawner.remove_containers = True
c.DockerSpawner.hub_ip_connect = c.JupyterHub.hub_ip

so did I forget something?

c.DockerSpawner.extra_host_config passes only network_mode to docker

Hi all,
I'm using DockerSpawner in a Docker Swarm setup.
I was able to set the docker overlay network but I can not set the memory limit for the notebook containers.

# Additional args to create_host_config for container create
c.DockerSpawner.extra_host_config = {
    'mem_limit': '300m',
    'memswap_limit': '0b',
    'network_mode': 'nw-docker',
    'oom_kill_disable': False
}

This is the sample from my jupyterhub_config.py file. Only the network_mode setting is recognized by docker. I checked this by running docker inspect on a running notebook container.

How can we fix this?

Thanks

Can't run the dockerspawner example

Hi, I made some changes to the repo( see #30 #31) to reflect recent changes on jupyter, however when running th script run.sh, I get the following error even if I correctly completed the env variables form github and the userlist.

[W 2015-04-13 10:54:03.819 JupyterHub app:251] 
    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.

[E 2015-04-13 10:54:03.873 JupyterHub app:726] Proxy appears to be running at http://*:8000/, but I can't access it (HTTP 403: Forbidden)
    Did CONFIGPROXY_AUTH_TOKEN change?

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.