Я пытаюсь установить jupyterhub, используя docker -compose. Сбой выдает следующее сообщение:
I 2020-01-31 16:30:48.424 JupyterHub oauth2:100] OAuth redirect: 'http://35.226.65.183:30100/hub/oauth_callback'
[I 2020-01-31 16:30:48.425 JupyterHub log:174] 302 GET /hub/oauth_login?next= -> http://35.226.65.183:30080/auth/realms/ma
ster/protocol/openid-connect/auth?response_type=code&redirect_uri=http%3A%2F%2F35.226.65.183%3A30100%2Fhub%2Foauth_callbac
k&client_id=jupyterhub&state=[secret] (@::ffff:192.0.161.155) 1.69ms
[E 2020-01-31 16:31:27.259 JupyterHub web:1788] Uncaught exception GET /hub/oauth_callback?state=eyJzdGF0ZV9pZCI6ICJjZmZlM
jk3ZTVmN2M0NjhjODFjZjVhMGEzOTQ5MmVkYyIsICJuZXh0X3VybCI6ICIifQ%3D%3D&session_state=b8884ec6-666c-4749-8762-34e837ca5f55&cod
e=671dd549-dca0-4921-90a7-4be854da548b.b8884ec6-666c-4749-8762-34e837ca5f55.946f3792-de4d-4a5e-9f7e-17d05cb87c81 (::ffff:1
92.0.161.155)
HTTPServerRequest(protocol='http', host='35.226.65.183:30100', method='GET', uri='/hub/oauth_callback?state=eyJzdGF0ZV
9pZCI6ICJjZmZlMjk3ZTVmN2M0NjhjODFjZjVhMGEzOTQ5MmVkYyIsICJuZXh0X3VybCI6ICIifQ%3D%3D&session_state=b8884ec6-666c-4749-8762-3
4e837ca5f55&code=671dd549-dca0-4921-90a7-4be854da548b.b8884ec6-666c-4749-8762-34e837ca5f55.946f3792-de4d-4a5e-9f7e-17d05cb
87c81', version='HTTP/1.1', remote_ip='::ffff:192.0.161.155')
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/usr/local/lib/python3.6/dist-packages/oauthenticator/oauth2.py", line 207, in get
user = await self.login_user()
File "/usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py", line 699, in login_user
authenticated = await self.authenticate(data)
File "/usr/local/lib/python3.6/dist-packages/jupyterhub/auth.py", line 383, in get_authenticated_user
authenticated = await maybe_future(self.authenticate(handler, data))
File "/usr/local/lib/python3.6/dist-packages/oauthenticator/generic.py", line 138, in authenticate
resp = await http_client.fetch(req)
tornado.httpclient.HTTPClientError: HTTP 404: Not Found
[E 2020-01-31 16:31:27.261 JupyterHub log:166] {
"X-Forwarded-Host": "35.226.65.183:30100",
"X-Forwarded-Proto": "http",
"X-Forwarded-Port": "30100",
"X-Forwarded-For": "::ffff:192.0.161.155",
"Upgrade-Insecure-Requests": "1",
"Cookie": "oauthenticator-state=[secret]",
"Connection": "close",
"Referer": "http://35.226.65.183:30080/auth/realms/master/login-actions/registration?client_id=jupyterhub&tab_id=LZ-
UwbTzssM",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.5",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0",
"Host": "35.226.65.183:30100"
}
[E 2020-01-31 16:31:27.261 JupyterHub log:174] 500 GET /hub/oauth_callback?state=[secret]&session_state=[secret]&code=[sec
ret] (@::ffff:192.0.161.155) 6.88ms
16:31:44.666 [ConfigProxy] info: 200 GET /api/routes
[I 2020-01-31 16:31:44.666 JupyterHub proxy:320] Checking routes
Uncaught exception GET /hub/oauth_callback?state=eyJzdGF0ZV9pZCI6ICJhOGZkO
TcxNmM0MTg0NmI1ODAyMjYyZGM3OTdjYjEwMSIsICJuZXh0X3VybCI6ICIifQ%3D%3D&session_state=b757af0b-2e63-42cd-8900-b08bf485b64b&cod
e=ebd0a4c6-76e1-459f-9e29-99c0a3b7eb6e.b757af0b-2e63-42cd-8900-b08bf485b64b.946f3792-de4d-4a5e-9f7e-17d05cb87c81 (::ffff:1
92.0.161.155)
Когда я напрямую нажимаю на ссылку в браузере http://35.226.65.183:30100/hub/oauth_callback?state=eyJzdGF0ZV9pZCI6ICJhOGZkO
TcxNmM0MTg0NmI1ODAyMjYyZGM3OTdjYjEwMSIsICJuZXh0X3VybCI6ICIifQ%3D%3D&session_state=b757af0b-2e63-42cd-8900-b08bf485b64b&cod
e=ebd0a4c6-76e1-459f-9e29-99c0a3b7eb6e.b757af0b-2e63-42cd-8900-b08bf485b64b.946f3792-de4d-4a5e-9f7e-17d05cb87c81
, это работает так, что не выдает ошибку 404, но страница найдена, но она какая-то недопустимая ошибка состояния. Мой docker -компонентный файл yaml:
version: "2"
services:
hub:
restart: always
image: localhost:5000/fifteenrock/jhub_image:0.1
container_name: jhub
ports:
- ${JHUB_PORT}:8000
volumes:
# Bind Docker socket on the host so we can connect to the daemon from
# within the container
- "/var/run/docker.sock:/var/run/docker.sock:rw"
# Bind Docker volume on host for JupyterHub database and cookie secrets
- "data:${DATA_VOLUME_CONTAINER}"
environment:
CLIENT_ID: ${CLIENT_ID}
# CLIENT_SECRET: ${CLIENT_SECRET}
CLIENT_SECRET: ${CLIENT_SECRET}
HOST_URL: ${HOST_URL}
NOTEBOOK_URL: ${NOTEBOOK_URL}
FR_IMAGE_TAG: ${FR_IMAGE_TAG}
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
HUB_IP: should_be_ip_address_without_http
# All containers will join this network
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
# Noebook directory inside user image
DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
# Using this run command (optional)
DOCKER_SPAWN_CMD: ${DOCKER_SPAWN_CMD}
volumes:
data:
external:
name: ${DATA_VOLUME_HOST}
networks:
default:
external:
name: ${DOCKER_NETWORK_NAME}
Мой скрипт, который создает контейнеры, (у меня есть переменные, которые могут не иметь отношения)
app_host=http://35.226.65.183
...
export JHUB_PORT=30100
export DOCKER_NETWORK_NAME=jhub
export HOST_URL=$app_host:30080
export NOTEBOOK_URL=$app_host:$JHUB_PORT
$BIN_DIR/docker-compose up -d