Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 error with host network mode #207

Open
SchetininVitaliy opened this issue Nov 27, 2017 · 0 comments
Open

404 error with host network mode #207

SchetininVitaliy opened this issue Nov 27, 2017 · 0 comments
Labels
host networking Related to host networking

Comments

@SchetininVitaliy
Copy link

Hello, jupyterhub team!

I`m trying start to use docker spawner in my lab. Jupyterhub has installed directly in host machine.
And I use such config file:

c.JupyterHub.spawner_class = 'dockerspawner.SystemUserSpawner'
c.SystemUserSpawner.host_homedir_format_string = '/home/{username}'
import os
notebook_dir = '/home/jovyan/work'
c.DockerSpawner.notebook_dir = notebook_dir

c.DockerSpawner.extra_create_kwargs.update({ 'command': 'start-singleuser.sh' })

c.DockerSpawner.extra_host_config = {'network_mode': 'host'}
c.DockerSpawner.use_internal_ip = True
c.DockerSpawner.network_name = 'host'

c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }
c.DockerSpawner.extra_create_kwargs.update({ 'volume_driver': 'local' })
# Remove containers once they are stopped
c.DockerSpawner.remove_containers = True
# For debugging arguments passed to spawned containers
c.DockerSpawner.debug = True

import netifaces
docker0 = netifaces.ifaddresses('docker0')
docker0_ipv4 = docker0[netifaces.AF_INET][0]
c.JupyterHub.hub_ip = docker0_ipv4['addr']

And now I see that container has started, but I have 404 error in browser.
In jupyterhub logs:

[I 2017-11-27 16:01:20.477 JupyterHub dockerspawner:452] Container 'jupyter-vitaliy' is gone
[D 2017-11-27 16:01:20.500 JupyterHub dockerspawner:530] Starting host with config: {'binds': {'jupyterhub-user-vitaliy': {'bind': '/home/jovyan/work', 'mode': 'rw'}, '/home/vitaliy': {'bind': '/home/vitaliy', 'ro': False}}, 'links': {}, 'network_mode': 'host'}
[I 2017-11-27 16:01:20.573 JupyterHub dockerspawner:540] Created container 'jupyter-vitaliy' (id: 0c2db9d) from image jupyterhub/singleuser:0.7
[I 2017-11-27 16:01:20.573 JupyterHub dockerspawner:557] Starting container 'jupyter-vitaliy' (id: 0c2db9d)
[D 2017-11-27 16:01:20.997 JupyterHub spawner:584] Polling subprocess every 30s
[D 2017-11-27 16:01:22.929 JupyterHub utils:84] Server at http://127.0.0.1:8888/user/vitaliy responded with 404
[I 2017-11-27 16:01:22.929 JupyterHub base:322] User vitaliy server took 3.210 seconds to start
[I 2017-11-27 16:01:22.930 JupyterHub orm:188] Adding user vitaliy to proxy /user/vitaliy => http://127.0.0.1:8888
[D 2017-11-27 16:01:22.933 JupyterHub orm:146] Fetching POST http://127.0.0.1:8001/api/routes/user/vitaliy
16:01:22.938 - info: [ConfigProxy] Adding route /user/vitaliy -> http://127.0.0.1:8888
16:01:22.939 - info: [ConfigProxy] 201 POST /api/routes/user/vitaliy 
[D 2017-11-27 16:01:22.940 JupyterHub base:236] Setting cookie for vitaliy: jupyter-hub-token-vitaliy, {}

container log:

[W 2017-11-27 13:09:23.693 SingleUserNotebookApp configurable:168] Config option `open_browser` not recognized by `SingleUserNotebookApp`.  Did you mean `browser`?
[W 2017-11-27 13:09:24.325 SingleUserNotebookApp login:225] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 2017-11-27 13:09:24.380 SingleUserNotebookApp extension:43] JupyterLab alpha preview extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
[I 2017-11-27 13:09:24.384 SingleUserNotebookApp notebookapp:1445] Serving notebooks from local directory: /home/vitaliy
[I 2017-11-27 13:09:24.384 SingleUserNotebookApp notebookapp:1445] 0 active kernels
[I 2017-11-27 13:09:24.384 SingleUserNotebookApp notebookapp:1445] The Jupyter Notebook is running at:
[I 2017-11-27 13:09:24.384 SingleUserNotebookApp notebookapp:1445] http://0.0.0.0:8888/
[I 2017-11-27 13:09:24.384 SingleUserNotebookApp notebookapp:1446] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2017-11-27 13:09:24.444 SingleUserNotebookApp log:47] 404 GET /user/vitaliy (127.0.0.1) 57.32ms referer=None
[W 2017-11-27 13:09:24.623 SingleUserNotebookApp log:47] 404 GET /user/vitaliy (::ffff:10.0.2.2) 2.55ms referer=http://mysitehere:223/hub/login?next=%2Fhub%2Fuser%2Fjovyan
@minrk minrk added the host networking Related to host networking label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host networking Related to host networking
Projects
None yet
Development

No branches or pull requests

2 participants