Jupyterhub "Failed to start proxy" error


#1

Hi all,

I was following installation instructions here: https://jupyterhub.readthedocs.io/en/latest/contributing/setup.html

All package/dependencies install fine, but when I go to start it up, it seems to route to my machine name rather than localhost. Any ideas where I can change this configuration or tips for debugging?

Thank you!

Vincent


#2

Including the console log for reference

vipasu-tb:jupyterhub vipasu$ jupyterhub
[I 2018-11-08 12:14:59.201 JupyterHub app:1918] Using Authenticator: jupyterhub.auth.PAMAuthenticator-1.0.0.dev
[I 2018-11-08 12:14:59.201 JupyterHub app:1918] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-1.0.0.dev
[I 2018-11-08 12:14:59.203 JupyterHub app:1148] Loading cookie_secret from /Users/vipasu/Dropbox/Berkeley/Y2Fall/DS/jupyterhub/jupyterhub_cookie_secret
[I 2018-11-08 12:14:59.251 JupyterHub proxy:436] Generating new CONFIGPROXY_AUTH_TOKEN
[W 2018-11-08 12:14:59.251 JupyterHub app:1409] No admin users, admin interface will be unavailable.
[W 2018-11-08 12:14:59.252 JupyterHub app:1410] Add any administrative users to c.Authenticator.admin_users in config.
[I 2018-11-08 12:14:59.252 JupyterHub app:1437] Not using whitelist. Any authenticated user will be allowed.
[I 2018-11-08 12:14:59.288 JupyterHub app:2121] Hub API listening on http://127.0.0.1:8081/hub/
[W 2018-11-08 12:14:59.289 JupyterHub proxy:490] Found proxy pid file: /Users/vipasu/Dropbox/Berkeley/Y2Fall/DS/jupyterhub/jupyterhub-proxy.pid
[W 2018-11-08 12:14:59.289 JupyterHub proxy:502] Proxy no longer running at pid=41171
[W 2018-11-08 12:14:59.291 JupyterHub proxy:605] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else…
[I 2018-11-08 12:14:59.291 JupyterHub proxy:607] Starting proxy @ http://:8000
[E 2018-11-08 12:14:59.304 JupyterHub utils:69] Unexpected error connecting to vipasu-tb:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-11-08 12:14:59.489 JupyterHub utils:69] Unexpected error connecting to vipasu-tb:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-11-08 12:14:59.769 JupyterHub utils:69] Unexpected error connecting to vipasu-tb:8000 [Errno 8] nodename nor servname provided, or not known
12:15:00.022 [ConfigProxy] info: Proxying http://*:8000 to (no default)
12:15:00.024 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
12:15:00.027 [ConfigProxy] error: Uncaught Exception
12:15:00.028 [ConfigProxy] error: Uncaught Exception
[E 2018-11-08 12:15:00.327 JupyterHub utils:69] Unexpected error connecting to vipasu-tb:8000 [Errno 8] nodename nor servname provided, or not known
[C 2018-11-08 12:15:00.327 JupyterHub app:2133] Failed to start proxy
Traceback (most recent call last):
File “/Users/vipasu/Dropbox/Berkeley/Y2Fall/DS/jupyterhub/jupyterhub/app.py”, line 2131, in start
await self.proxy.start()
File “/Users/vipasu/Dropbox/Berkeley/Y2Fall/DS/jupyterhub/jupyterhub/proxy.py”, line 634, in start
_check_process()
File “/Users/vipasu/Dropbox/Berkeley/Y2Fall/DS/jupyterhub/jupyterhub/proxy.py”, line 630, in _check_process
raise e from None
RuntimeError: Proxy failed to start with exit code 0


#3

It looks like your configurable-http-proxy isn’t running. What output do you get if you run:

configurable-http-proxy

on your terminal?

Can you also tell us what OS you are using?


#4

vipasu-tb:jupyterhub vipasu$ configurable-http-proxy
15:50:12.497 [ConfigProxy] warn: REST API is not authenticated.
15:50:12.507 [ConfigProxy] info: Proxying http://*:8000 to (no default)
15:50:12.507 [ConfigProxy] info: Proxy API at http://localhost:8001/api/routes

command seems to work fine. I’m on OS X (Mojave).


#5

Interesting. Can you start jupyterhub with --debug flag to see if there’s any more information?

I’m also curious why we’re getting:

 [E 2018-11-08 12:14:59.304 JupyterHub utils:69] Unexpected error connecting to vipasu-tb:8000 [Errno 8] nodename nor servname provided, or not known

I am guessing vipasu-tb is your computer’s hostname, and somehow that’s not reachable - or at least resolvable. Can you add an entry to your /etc/hosts file with the following contents:

127.0.0.1    vipasu-tb

and see if that fixes the issue?


#6

Yes, that resolved it! I wasn’t sure how it was getting that hostname because it’s not in my ENV. Thanks.


#7

When listening on all ports, it attempts to connect at socket.gethostname(), which should be the same as the output of the hostname command. This is the computer’s self-identified name on the network.

Usually, this name is connectable from the machine itself, but in some misconfigured networks, it can not be. The fix @yuvipanda proposed gives you a shortcut to ensure that the hostname points to localhost.

An alternate option is to specify --ip=a.b.c.d where that is a specific ip (use 127.0.0.1 if you only want localhost for testing, or an external ip from ifconfig if you want to be connectable from outside), rather than the default of ‘all interfaces’. Doing this avoids any potential hostname issues.