Open wenzeslaus opened 7 years ago
Try adding --use_tokens=True
after orchestrate.py
.
Token support was a recent addition to the notebook server, docker stacks, and tmpnb. We just need to update the README here.
I tried --use_tokens=True
but still with the same result. Thanks for the prompt answer anyway.
When I wait a bit, I don't get 503, just the token request. From 8000, I get redirected to:
http://localhost:8000/user/Zi6TwJOKgSVI/login?next=%2Fuser%2FZi6TwJOKgSVI%2Ftree%3Ftoken%3D8f024144ef92336602a153a20227149a2581c6720bb9eb99
This is the docker logs tmpnb
with compose.py --log-to-stderr --logging=debug
:
[D 170107 04:33:06 curl_httpclient:484] b'Connected to (nil) (127.0.0.1) port 8001 (#0)'
[D 170107 04:33:06 curl_httpclient:484] b'0x1bde640 is at send pipe head!'
[D 170107 04:33:06 curl_httpclient:484] b'STATE: CONNECT => DO handle 0x1c558f0; (connection #0)'
[D 170107 04:33:06 curl_httpclient:487] > b'POST /api/routes/user/VTvKrbYhIXli HTTP/1.1'
[D 170107 04:33:06 curl_httpclient:487] > b'User-Agent: Mozilla/5.0 (compatible; pycurl)'
[D 170107 04:33:06 curl_httpclient:487] > b'Host: 127.0.0.1:8001'
[D 170107 04:33:06 curl_httpclient:487] > b'Accept: */*'
[D 170107 04:33:06 curl_httpclient:487] > b'Accept-Encoding: gzip,deflate'
[D 170107 04:33:06 curl_httpclient:487] > b'Authorization: token e57626fc235dea05d18e98331dd1c40efc694471fc64f676e3c62585961e'
[D 170107 04:33:06 curl_httpclient:487] > b'Content-Length: 120'
[D 170107 04:33:06 curl_httpclient:487] > b'Content-Type: application/x-www-form-urlencoded'
[D 170107 04:33:06 curl_httpclient:487] > b''
[D 170107 04:33:06 curl_httpclient:484] b'STATE: DO => DO_DONE handle 0x1c558f0; (connection #0)'
[D 170107 04:33:06 curl_httpclient:484] b'STATE: DO_DONE => WAITPERFORM handle 0x1c558f0; (connection #0)'
[D 170107 04:33:06 curl_httpclient:484] b'STATE: WAITPERFORM => PERFORM handle 0x1c558f0; (connection #0)'
[D 170107 04:33:06 curl_httpclient:484] b'additional stuff not fine transfer.c:1037: 0 0'
[D 170107 04:33:06 curl_httpclient:489] > b'{"container_id": "7441d5fee6848557eb404c6f7172fe51c7f9e79db5343301c610defedcc3081d", "target": "http://127.0.0.1:32941"}'
[D 170107 04:33:06 curl_httpclient:484] b'additional stuff not fine transfer.c:1037: 0 0'
[D 170107 04:33:06 curl_httpclient:484] b'HTTP 1.1 or later with persistent connection, pipelining supported'
[D 170107 04:33:06 curl_httpclient:487] < b'HTTP/1.1 201 Created'
[D 170107 04:33:06 curl_httpclient:487] < b'Date: Sat, 07 Jan 2017 04:33:06 GMT'
[D 170107 04:33:06 curl_httpclient:487] < b'Connection: keep-alive'
[D 170107 04:33:06 curl_httpclient:487] < b'Transfer-Encoding: chunked'
[D 170107 04:33:06 curl_httpclient:487] < b''
[D 170107 04:33:06 curl_httpclient:484] b'STATE: PERFORM => DONE handle 0x1c558f0; (connection #0)'
...
[I 170107 04:33:06 spawnpool:248] Launched [10] new containers.
[D 170107 04:33:06 spawnpool:256] Heartbeat complete. The pool now includes [10] containers.
[I 170107 04:33:06 orchestrate:489] Culling containers unused for 3600 seconds every 600 seconds.
[I 170107 04:33:06 orchestrate:493] Listening on *:9999
[I 170107 04:33:06 orchestrate:497] Admin listening on 127.0.0.1:10000
[I 170107 04:33:22 web:1946] 200 GET /user/aInZOEHNrGSg/api/sessions?_=1483715213808 (127.0.0.1) 2.13ms
[I 170107 04:33:22 web:1946] 200 GET /user/aInZOEHNrGSg/api/terminals?_=1483715213809 (127.0.0.1) 4.53ms
[I 170107 04:34:08 web:1946] 304 GET / (127.0.0.1) 3.64ms
[I 170107 04:34:08 orchestrate:146] Allocated [user/VTvKrbYhIXli] from the pool.
[I 170107 04:34:08 orchestrate:160] Redirecting [/spawn/] -> [/user/VTvKrbYhIXli/tree?token=95bb1bbd478de9549e7b81bdffd18dcaf1111291af682f86].
[I 170107 04:34:08 web:1946] 302 GET /spawn/ (127.0.0.1) 0.82ms
[I 170107 04:34:22 web:1946] 200 GET /user/aInZOEHNrGSg/api/sessions?_=1483715213810 (127.0.0.1) 2.87ms
[I 170107 04:34:22 web:1946] 200 GET /user/aInZOEHNrGSg/api/terminals?_=1483715213811 (127.0.0.1) 2.58ms
[I 170107 04:35:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/sessions?_=1483715213812 (127.0.0.1) 6.69ms
[I 170107 04:35:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/terminals?_=1483715213813 (127.0.0.1) 2.37ms
[I 170107 04:35:26 web:1946] 304 GET / (127.0.0.1) 2.30ms
[I 170107 04:35:26 orchestrate:146] Allocated [user/Zi6TwJOKgSVI] from the pool.
[I 170107 04:35:26 orchestrate:160] Redirecting [/spawn/] -> [/user/Zi6TwJOKgSVI/tree?token=8f024144ef92336602a153a20227149a2581c6720bb9eb99].
[I 170107 04:35:26 web:1946] 302 GET /spawn/ (127.0.0.1) 1.36ms
...
[I 170107 04:38:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/sessions?_=1483715213818 (127.0.0.1) 2.79ms
[I 170107 04:39:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/sessions?_=1483715213820 (127.0.0.1) 1.83ms
[I 170107 04:39:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/terminals?_=1483715213821 (127.0.0.1) 3.33ms
[I 170107 04:40:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/sessions?_=1483715213822 (127.0.0.1) 2.80ms
[I 170107 04:40:21 web:1946] 200 GET /user/aInZOEHNrGSg/api/terminals?_=1483715213823 (127.0.0.1) 3.38ms
Filling out the token would be actually fine with me if I would know it.
I see, when I specify the token with --NotebookApp.token=
it is the token for all containers, so users need to know the token but nobody else can create the tmp nb.
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=tmpnb -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py --log-to-stderr --logging=debug --use-tokens=True --image='jupyter/minimal-notebook' --command='start-notebook.sh "--NotebookApp.base_url={base_path} --ip=0.0.0.0 --port {port} --NotebookApp.trust_xheaders=True --NotebookApp.token=22f5b..."'
But as mentioned earlier without specifying the token, it does not work.
--use-tokens=True
and --NotebookApp.token=22f5b
together works as expected: When opening a new session, user must enter the token.
I don't know how to not require the token from the user if I would decide to do so.
--use-tokens=False
and --NotebookApp.token=22f5b
requires user to enter token every time (or almost every time) new page opens. So, for example, when user clicks Download as PDF, token is required, after entering it, PDF is downloaded, but it does not contain the computed cells. I don't know if that's expected or not.
I get the 503 error time to time but it is always just right after start of the "tmpnb" container, so I think at this point is it just because it is not ready yet, so no issue there.
I'm trying the example from the README for Using jupyter/docker-stacks images but I get error 503 and then token is required. I used these commands:
At port 8000 I get first 503:
And then when I reload the page, I get request for password or token:
This
docker log proxy
:This is part of the
docker log tmpnb
:These are running containers:
I get the same when I use
--NotebookApp.trust_xheaders=True
as in Using jupyter/docker-stacks images or not as in Launching with your own Docker images:The basic example from README works for me.