jupyterhub / jupyterhub-deploy-docker

Reference deployment of JupyterHub with docker
BSD 3-Clause "New" or "Revised" License
701 stars 367 forks source link

Network and config issues when starting jupyterhub #45

Closed lachlancampbell closed 1 year ago

lachlancampbell commented 7 years ago

I have a working jupyterhub installation (based mostly on Andrea Zonca's instructions [https://zonca.github.io/2016/04/jupyterhub-sdsc-cloud.html] and it worked flawlessly for a machine-learning workshop. However, I now want to upgrade to using jupyterlab with my hub, and unfortunately experienced much the same problems as https://github.com/jupyterhub/jupyterhub-deploy-docker/issues/26. I could access jupyterlab from the hub by manually changing the url once I had logged in, but was unable to have it as the default url. Hence I'm trying your docker deployment of the hub :)

My first issue arises with nginx on the host. If I have the service running and I start the hub I get the following error:

ERROR: for jupyterhub  Cannot start service hub: driver failed programming external connectivity on endpoint jupyterhub (dd0d984e99ddb8ce10900a489c82f96d42ab9f84e9b4977d874c85f0e0374096): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use

ERROR: for hub  Cannot start service hub: driver failed programming external connectivity on endpoint jupyterhub (dd0d984e99ddb8ce10900a489c82f96d42ab9f84e9b4977d874c85f0e0374096): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use
ERROR: Encountered errors while bringing up the project.

If I stop nginx, the hub starts with no errors, but the site won't load. The logs do however show an error with the config:

docker logs jupyterhub
[E 2017-09-11 02:17:41.976 JupyterHub application:569] Exception while loading config file /srv/jupyterhub/jupyterhub_config.py
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 557, in _load_config_files
        config = loader.load_config()
      File "/opt/conda/lib/python3.5/site-packages/traitlets/config/loader.py", line 457, in load_config
        self._read_file_as_dict()
      File "/opt/conda/lib/python3.5/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
        py3compat.execfile(conf_filename, namespace)
      File "/opt/conda/lib/python3.5/site-packages/ipython_genutils/py3compat.py", line 185, in execfile
        exec(compiler(f.read(), fname, 'exec'), glob, loc)
      File "/srv/jupyterhub/jupyterhub_config.py", line 80, in <module>
        name = parts[0]
    IndexError: list index out of range

[I 2017-09-11 02:17:41.980 JupyterHub app:745] Writing cookie_secret to /srv/jupyterhub/jupyterhub_cookie_secret
[W 2017-09-11 02:17:42.302 JupyterHub app:365]
    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.

[W 2017-09-11 02:17:42.336 JupyterHub app:864] No admin users, admin interface will be unavailable.
[W 2017-09-11 02:17:42.337 JupyterHub app:865] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2017-09-11 02:17:42.337 JupyterHub app:892] Not using whitelist. Any authenticated user will be allowed.
[I 2017-09-11 02:17:42.360 JupyterHub app:1453] Hub API listening on http://127.0.0.1:8081/hub/
[W 2017-09-11 02:17:42.364 JupyterHub app:1174] Running JupyterHub without SSL.  I hope there is SSL termination happening somewhere else...
[I 2017-09-11 02:17:42.364 JupyterHub app:1176] Starting proxy @ http://*:8000/
02:17:42.628 - info: [ConfigProxy] Proxying http://*:8000 to http://127.0.0.1:8081
02:17:42.633 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
[I 2017-09-11 02:17:42.675 JupyterHub app:1485] JupyterHub is now running at http://127.0.0.1:8000/

So, to me it looks as though the userlist isn't there? When I build the image it says it's copying it, so not sure whats happening.

I'm doing all this on a VM running on Openstack with Ubuntu 16.04, and I'm using Docker version 17.06.1-ce, build 874a737, docker-compose version 1.16.1, build 6d1ac21. I want to use PAM and local user accounts so I commented out references to oauth in the Dockerfile and Makefile (previously I was using the systemuser rather than the singleuser, is this another potential source of problems?).

I plan on trying kubernetes and helm in the future, but having never used either, this seemed like the easiest and quickest way to get what I want. Any advice on how to proceed greatly appreciated.

bjuergens commented 6 years ago

check your jupyterhub_config.py

I just had a similar problem, and it was solved, because my userlist-file wasn't formatted properly.