# Jupyterhub "Failed to start proxy" error

**URL:** <https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137>\
**Category:** discuss\
**Created:** [November 8, 2018, 8:22pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137 "2018-11-08T20:22:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vipasu](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@vipasu](https://discourse.jupyter.org/u/vipasu)\
**Post date:** [November 8, 2018, 8:22pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/1 "2018-11-08T20:22:23Z")

</div>

Hi all,

I was following installation instructions here: [https://jupyterhub.readthedocs.io/en/latest/contributing/setup.html](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

---

<div class="post-metadata">

**Author:** ![vipasu](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@vipasu](https://discourse.jupyter.org/u/vipasu)\
**Post date:** [November 8, 2018, 8:23pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/2 "2018-11-08T20:23:01Z")

</div>

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/](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](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

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [November 8, 2018, 9:55pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/3 "2018-11-08T21:55:08Z")

</div>

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

```bash
configurable-http-proxy

```

on your terminal?

Can you also tell us what OS you are using?

---

<div class="post-metadata">

**Author:** ![vipasu](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@vipasu](https://discourse.jupyter.org/u/vipasu)\
**Post date:** [November 8, 2018, 11:50pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/4 "2018-11-08T23:50:57Z")

</div>

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](http://localhost:8001/api/routes)

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

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [November 8, 2018, 11:58pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/5 "2018-11-08T23:58:03Z")

</div>

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

I’m also curious why we’re getting:

```auto
 [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:

```auto
127.0.0.1 vipasu-tb

```

and see if that fixes the issue?

---

<div class="post-metadata">

**Author:** ![vipasu](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@vipasu](https://discourse.jupyter.org/u/vipasu)\
**Post date:** [November 9, 2018, 2:21am UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/6 "2018-11-09T02:21:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![minrk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/minrk/32/13_2.png) [@minrk](https://discourse.jupyter.org/u/minrk)\
**Post date:** [November 9, 2018, 8:56am UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/7 "2018-11-09T08:56:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ramanji](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@Ramanji](https://discourse.jupyter.org/u/Ramanji)\
**Post date:** [April 7, 2020, 8:16am UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/8 "2020-04-07T08:16:16Z")

</div>

HI YuviPanda,

I have installed jupyterhub in Kubernetes cluster. I have started my jupyetrhub and facing below issue would you please suggest me how to fix below issue.

[W 2020-04-07 08:10:20.963 JupyterHub proxy:534] Proxy still running at pid=39  
[C 2020-04-07 08:10:23.966 JupyterHub app:2568] Failed to start proxy  
Traceback (most recent call last):  
File “/usr/local/lib/python3.6/dist-packages/jupyterhub/app.py”, line 2566, in start  
await self.proxy.start()  
File “/usr/local/lib/python3.6/dist-packages/jupyterhub/proxy.py”, line 580, in start  
self.\_check\_previous\_process()  
File “/usr/local/lib/python3.6/dist-packages/jupyterhub/proxy.py”, line 558, in \_check\_previous\_process  
raise RuntimeError(“Failed to stop proxy at pid=%s”, pid)  
RuntimeError: (‘Failed to stop proxy at pid=%s’, 39)

---

<div class="post-metadata">

**Author:** ![cleemesser](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/cleemesser/32/8347_2.png) [@cleemesser](https://discourse.jupyter.org/u/cleemesser)\
**Post date:** [October 24, 2022, 9:53pm UTC](https://discourse.jupyter.org/t/jupyterhub-failed-to-start-proxy-error/137/9 "2022-10-24T21:53:06Z")

</div>

I’ve noticed another reason for this error. After a power outage. The “jupyterhub-proxy.pid” file was left over an instance of jupyterhub.

So I got an error like this:

```auto
   RuntimeError: ('Failed to stop proxy at pid=%s', 2871)

```

Where 2871 was the process id (PID) for the no longer running proxy. Deleting this file allowed me to restart jupyterhub successfully.

Ideally, jupyterhub would warn me about this and tell me to remove the pid file
