Can't get past jupyter token/password screen when starting jupyter notebook from Docker container

1,618 views
Skip to first unread message

John McLean

unread,
Aug 28, 2018, 6:28:56 AM8/28/18
to Project Jupyter
Hi,

I was following this tutorial (https://miykael.github.io/nipype_tutorial/notebooks/introduction_docker.html) to try and run jupyter notebooks from within a docker container. My docker installation and image pull were successful. I can also run the container image to start with bash or ipython. However, on starting the container with jupyter notebook, I can't get past the token/password screen on my browser.

Here is the output from powershell on my host PC (running windows 10 64 bit). My version of docker is 18.06 as so is up to date as of today 28/8/18.

Running the command:

docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook

The output is as follows:


[I 10:25:05.104 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 10:25:05.111 NotebookApp] Writing notebook server cookie secret to /home/neuro/.local/share/jupyter/runtime/notebook_cookie_secret
[I 10:25:05.297 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.0
[I 10:25:05.324 NotebookApp] JupyterLab extension loaded from /opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/jupyterlab
[I 10:25:05.324 NotebookApp] JupyterLab application directory is /opt/miniconda-latest/envs/neuro/share/jupyter/lab
[I 10:25:05.495 NotebookApp] [nb_conda] enabled
[I 10:25:05.495 NotebookApp] Serving notebooks from local directory: /home/neuro/nipype_tutorial
[I 10:25:05.496 NotebookApp] The Jupyter Notebook is running at:
[I 10:25:05.496 NotebookApp] http://(2bb4cef2b045 or 127.0.0.1):8888/?token=a0d6863f5b451c7f763d4d4e20bc7e7c3bd4cd2d3b36e24f
[I 10:25:05.496 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 10:25:05.497 NotebookApp] No web browser found: could not locate runnable browser.
[C 10:25:05.497 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://(2bb4cef2b045 or 127.0.0.1):8888/?token=a0d6863f5b451c7f763d4d4e20bc7e7c3bd4cd2d3b36e24f

On copying the URL to the browser and adjusting to try different options, have tried:

http://127.0.0.1:8888/?token=a0d6863f5b451c7f763d4d4e20bc7e7c3bd4cd2d3b36e24f
http://localhost:8888/?token=a0d6863f5b451c7f763d4d4e20bc7e7c3bd4cd2d3b36e24f
http://0.0.0.0:8888/?token=a0d6863f5b451c7f763d4d4e20bc7e7c3bd4cd2d3b36e24f
http://'mydockerNATip':8888/?token=a0d6863f5b451c7f763d4d4e20bc7e7c3bd4cd2d3b36e24f

All of these either bring up the jupyter token/password page or fail. I tried logging into the docker with bash to set a password as per the jypyter guide, but this this didn't help.

Does anyone have an idea where I am going wrong? Any help appreciated. I also have jupyter installed on the host machine and that has been working fine.

Thanks
John

Luciano Resende

unread,
Aug 28, 2018, 7:54:09 AM8/28/18
to jup...@googlegroups.com
This might be due to Notebook being binded to localhost inside the docker....

Try adding the following parameters to your start command :

—NotebookApp.ip=0.0.0.0
—NoteboopApp.port=8888

Hope this helps...
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/a68e64ca-0966-4efe-8471-54e14ec82570%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my Mobile device

John McLean

unread,
Aug 28, 2018, 8:18:51 AM8/28/18
to jup...@googlegroups.com
Thanks for the suggestion Luciano,

I tried: 

docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook --NotebookApp.ip=0.0.0.0 --NotebookApp.port=8888

But the outcome is the same, i'm stuck with the jupyter token/password page and entering token doesn't work.
Best wishes
John

You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/y0FK1n4LRVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

John McLean

unread,
Aug 30, 2018, 5:18:29 AM8/30/18
to Project Jupyter
Hi,
As was of an update. I updated docker a day or so ago. Now I get a different error message and I do not get offered the choice of a url. Maybe a proxy issue. For ease, the new error is included immendiately below, the full powershell commands and terminal output are below that.

---------------------------
PS C:\Users\MCLEAJO685> docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint nervous_swirles (db2cf37428d0accb29f78ae030f0ed2628fe641adc4954d82269fdc26f3d4924): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8888:tcp:172.17.0.2:8888: input/output error.

----------------------

PS C:\Users\MCLEAJO685> docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

PS C:\Users\MCLEAJO685> docker pull miykael/nipype_tutorial:latest
latest: Pulling from miykael/nipype_tutorial
Digest: sha256:47b95501a67f115fd6ee6246c855cf15db0523908c8bf55f80e18db8b27b7986
Status: Image is up to date for miykael/nipype_tutorial:latest
PS C:\Users\MCLEAJO685> docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
ubuntu                     latest              16508e5c265d        7 days ago          84.1MB
miykael/nipype_tutorial    latest              00bcf07bfcbc        7 days ago          8.49GB
nginx                      latest              c82521676580        5 weeks ago         109MB
hello-world                latest              2cb0d9787c4d        7 weeks ago         1.85kB
docker4w/nsenter-dockerd   latest              cae870735e91        10 months ago       187kB
PS C:\Users\MCLEAJO685> docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint nervous_swirles (db2cf37428d0accb29f78ae030f0ed2628fe641adc4954d82269fdc26f3d4924): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8888:tcp:172.17.0.2:8888: input/output error.
PS C:\Users\MCLEAJO685> docker run -it --name repo2docker -p 8888:8888 vanessa/repo2docker-jupyterlab jupyter lab --ip 0
.0.0.0
Unable to find image 'vanessa/repo2docker-jupyterlab:latest' locally
latest: Pulling from vanessa/repo2docker-jupyterlab
4ccdce43d1e0: Pull complete
c95f13c88d92: Pull complete
82656eee95ad: Pull complete
78ff727be57a: Pull complete
448bb314afa5: Pull complete
9d5385822d13: Pull complete
e8f408ef0128: Pull complete
63314e962953: Pull complete
2867b08a103c: Pull complete
065088584bae: Pull complete
7ca732810287: Pull complete
bf42a5848b89: Pull complete
9e1bf29de72e: Pull complete
620b0b10e90f: Pull complete
a3251e53fb06: Pull complete
ab7c93f12aee: Pull complete
6fb28c5245d1: Pull complete
8a0a536069f3: Pull complete
cbe359404675: Pull complete
a21061bee9b4: Pull complete
Digest: sha256:bc187c99851402d6980bc88413140e347383e8175db7324728d16542b898882a
Status: Downloaded newer image for vanessa/repo2docker-jupyterlab:latest
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint repo2docker (d465975798ad34c94ec863f7712afba995d4a7dd99996dbf74bf2a329cf38f18): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8888:tcp:172.17.0.2:8888: input/output error.
PS C:\Users\MCLEAJO685>
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/a68e64ca-0966-4efe-8471-54e14ec82570%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my Mobile device

--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/y0FK1n4LRVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+unsubscribe@googlegroups.com.

John McLean

unread,
Aug 30, 2018, 7:06:31 AM8/30/18
to Project Jupyter

Solved.


I was digging around on various forums looking into the new error i was receiving. I saw one post suggesting ‘experimental features’ from Docker settings > Daemon, should be turned off. In hope rather than expectation, I turned experimental features ‘on’, as my setting was already off. Miraculously, this allows me to run the image and jupyter notebook. No idea why.

The url i had to copy onto my browser went as follows:


http://(572887568e37 or 127.0.0.1):8888/?token=a069361e348d97b30b42db38dcaa725b0ff1ff3cf9b21a68


where I edited it in the browser and selected the 127.0.0.1 i/p


i.e. ran the following in the browser…


http://127.0.0.1:8888/?token=a069361e348d97b30b42db38dcaa725b0ff1ff3cf9b21a68

Thanks for the help
John

Reply all
Reply to author
Forward
0 new messages