Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Proxy error: code=ECONNRESET #191

Closed
elliottslaughter opened this issue Dec 15, 2015 · 3 comments
Closed

Proxy error: code=ECONNRESET #191

elliottslaughter opened this issue Dec 15, 2015 · 3 comments

Comments

@elliottslaughter
Copy link

I'm trying to track down an issue in my tmpnb setup with a custom notebook image. If I run tmpnb with jupyter/demo, it runs just fine:

docker pull jupyter/demo
export TOKEN=$( head -c 30 /dev/urandom | xxd -p )
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py --image="jupyter/demo" --command="start-notebook.sh \"--NotebookApp.base_url={base_path} --NotebookApp.allow_origin='*' --port={port}\""

The server starts, and when I navigate to localhost:8000, I load the demo notebooks. However, if I try to run my own image (stanfordlegion/jupyter-regent), it starts returning 503.

docker pull stanfordlegion/jupyter-regent
export TOKEN=$( head -c 30 /dev/urandom | xxd -p )
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py --image="stanfordlegion/jupyter-regent" --command="start-notebook.sh \"--NotebookApp.base_url={base_path} --NotebookApp.allow_origin='*' --port={port}\""

If I take a look at the logs from tmpnb, it seems that the instance has spawned correctly:

[I 151215 00:10:27 orchestrate:366] Listening on *:9999
[I 151215 00:10:28 web:1811] 200 GET / (127.0.0.1) 206.86ms
[I 151215 00:10:28 orchestrate:128] Allocated [user/PEcVZgzyeRjs] from the pool.
[I 151215 00:10:28 web:1811] 302 GET /spawn/ (127.0.0.1) 0.70ms

And the instance itself seems to agree with that:

[I 00:10:30.089 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 00:10:30.541 NotebookApp] Serving notebooks from local directory: /home/jovyan/notebooks
[I 00:10:30.541 NotebookApp] 0 active kernels 
[I 00:10:30.541 NotebookApp] The IPython Notebook is running at: http://[all ip addresses on your system]:8888/user/PEcVZgzyeRjs/

But the somehow the proxy doesn't agree:

00:10:00.733 - info: [ConfigProxy] Proxying http://*:8000 to http://127.0.0.1:9999
00:10:00.746 - info: [ConfigProxy] Proxy API at http://localhost:8001/api/routes
00:10:28.552 - error: [ConfigProxy] Proxy error:  code=ECONNRESET
00:10:28.563 - error: [ConfigProxy] 503 GET /user/PEcVZgzyeRjs/tree

What am I missing? I can't find any other relevant logs, and I'm not sure where things are going bad as they are. Any suggestions?

Thanks in advance.

@elliottslaughter
Copy link
Author

After scouring the demo sources, I discovered that this was the critical line I was missing:

c.NotebookApp.trust_xheaders = True

(https://github.com/jupyter/docker-demo-images/blob/master/resources/jupyter_notebook_config.partial.py#L5)

@rgbkrk
Copy link
Member

rgbkrk commented Dec 17, 2015

Thanks for writing your solution in the issue!

@emptycrown
Copy link

I am getting this error now just running the Quick Start containers. The jupyter interface works fine, but when I create a new notebook, it cannot connect to the kernel.

Inspecting the logs of the jupyter/configurable-http-proxy containers yields

23:30:18.400 - error: [ConfigProxy] Proxy error:  code=ECONNRESET
23:30:18.400 - error: [ConfigProxy] 503 GET /user/xxxxxxx

I tried adding NotebookApp.trust_xheaders = True but to no avail. Please advise, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants