jupyterhub / zero-to-jupyterhub-k8s

Helm Chart & Documentation for deploying JupyterHub on Kubernetes
https://zero-to-jupyterhub.readthedocs.io
Other
1.55k stars 795 forks source link

Z2JH 0.11.1 gives 404 when connecting to JupyterLab 3.0.5 singleuser ServerApp #2015

Closed jpugliesi closed 3 years ago

jpugliesi commented 3 years ago

Bug description

Hello - we are using z2jh 0.11.1, attempting to use jupyterlab 3.0.5 with the new ServerApp for the single-user servers

We currently get 404s from the singleuser server when set up:

[I 2021-01-26 20:53:55.183 SingleUserNotebookApp mixins:557] Starting jupyterhub-singleuser server version 1.3.0
[I 2021-01-26 20:53:55.192 SingleUserNotebookApp serverapp:1938] Serving notebooks from local directory: /efs/jupyterhub
[I 2021-01-26 20:53:55.192 SingleUserNotebookApp serverapp:1938] Jupyter Server 1.2.2 is running at:
[I 2021-01-26 20:53:55.192 SingleUserNotebookApp serverapp:1938] http://jupyter-john:8888/user/john/lab
[I 2021-01-26 20:53:55.192 SingleUserNotebookApp serverapp:1938]  or http://127.0.0.1:8888/user/john/lab
[I 2021-01-26 20:53:55.192 SingleUserNotebookApp serverapp:1939] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2021-01-26 20:53:55.195 SingleUserNotebookApp mixins:538] Updating Hub with activity every 300 seconds
[I 2021-01-26 20:53:57.142 SingleUserNotebookApp log:181] 302 GET /user/john/ -> /user/john/lab? (@100.114.155.52) 0.69ms
[W 2021-01-26 20:53:57.326 SingleUserNotebookApp log:181] 404 GET /user/john/lab? (@::ffff:100.126.103.68) 10.65ms

We've set the following env variable in the singleuser server:

   #environment variable in singleuser server
   env:
    - name: JUPYTERHUB_SINGLEUSER_APP
      value: "jupyter_server.serverapp.ServerApp"

and configure the z2jh config to use jupyterlab:

singleuser:
  defaultUrl: "/lab"

our jupyter_server_config.py is:

c = get_config()
c.Spawner.default_url = '/lab'

Expected behaviour

I expect the following configuration to work

Actual behaviour

Spawning a singleuser server produces a 404

404 : Not Found
You are requesting a page that does not exist!

How to reproduce

  1. Install z2jh 0.11.1
  2. Configure as mentioned above

Your personal set up

Kubernetes 1.16.5

pip freeze in singleuser server env:

absl-py==0.10.0
aiohttp==3.7.3
alembic==1.5.2
ansiwrap==0.8.4
anyio==2.0.2
appdirs==1.4.4
argon2-cffi==20.1.0
astunparse==1.6.3
async-generator==1.10
async-timeout==3.0.1
attrs==20.1.0
autovizwidget @ file:///tmp/pip-install-z_z18dmw/sparkmagic_5585a992207b4cfca1556c625ca386c4/autovizwidget
awscli==1.18.219
Babel==2.9.0
backcall==0.2.0
black==20.8b1
bleach==3.1.5
boto3==1.16.59
botocore==1.19.59
branca==0.4.2
cachetools==4.1.1
certifi==2020.6.20
certipy==0.1.3
cffi==1.14.2
cfgv==3.2.0
chardet==3.0.4
click==7.1.2
colorama==0.4.3
colour==0.1.5
coverage==5.4
cryptography==3.3.1
cvxpy==1.1.7
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
distlib==0.3.1
docformatter==1.4
docutils==0.15.2
ecos==2.0.7.post1
entrypoints==0.3
filelock==3.0.12
flake8==3.8.4
folium==0.12.1
fsspec==0.8.5
gast==0.3.3
gcsfs==0.7.1
gitdb==4.0.5
GitPython==3.1.12
google-auth==1.21.0
google-auth-oauthlib==0.4.1
google-pasta==0.2.0
grpcio==1.31.0
gviz-api==1.9.0
h5py==2.10.0
hdijupyterutils @ file:///tmp/pip-install-z_z18dmw/sparkmagic_5585a992207b4cfca1556c625ca386c4/hdijupyterutils
hybridcontents==0.2.0
identify==1.5.13
idna==2.10
importlib-metadata==1.7.0
iniconfig==1.1.1
ipykernel==5.4.3
ipython==7.18.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.17.2
Jinja2==2.11.2
jmespath==0.10.0
joblib==1.0.0
json5==0.9.5
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.7
jupyter-console==6.2.0
jupyter-core==4.6.3
jupyter-http-over-ws==0.0.8
jupyter-server==1.2.2
jupyter-telemetry==0.1.0
jupyterhub==1.3.0
jupyterlab==3.0.5
jupyterlab-code-formatter==1.4.2
jupyterlab-git==0.23.3
jupyterlab-server==2.1.3
jupyterlab-widgets==1.0.0
Keras-Preprocessing==1.1.2
kiwisolver==1.2.0
Mako==1.1.4
Markdown==3.2.2
MarkupSafe==1.1.1
matplotlib==3.3.1
mccabe==0.6.1
mistune==0.8.4
mock==4.0.3
multidict==5.1.0
mypy-extensions==0.4.3
nbclassic==0.2.6
nbclient==0.5.1
nbconvert==5.6.1
nbdime==2.1.0
nbformat==5.1.2
nbstripout==0.3.9
nbval==0.9.6
nest-asyncio==1.4.3
nodeenv==1.5.0
nose==1.3.7
nose-exclude==0.5.0
nose-warnings-filters==0.1.5
notebook==6.1.3
numpy==1.18.5
oauthlib==3.1.0
opt-einsum==3.3.0
osqp==0.6.2.post0
packaging==20.4
pamela==1.0.0
pandas==1.2.1
pandocfilters==1.4.2
papermill @ git+https://github.com/viaduct-ai/papermill.git@bfd9c39c3b031385317772091e64b3e275d8928c
parso==0.7.1
pathspec==0.8.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.2.0
pipenv==2020.11.15
plotly==4.14.3
pluggy==0.13.1
pre-commit==2.9.3
prometheus-client==0.8.0
prompt-toolkit==3.0.7
protobuf==3.13.0
psycopg2-binary==2.8.6
ptyprocess==0.6.0
py==1.10.0
py4j==0.10.7
pyarrow==3.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.6.0
pycparser==2.20
pyflakes==2.2.0
Pygments==2.6.1
pygobject==3.26.1
pykerberos==1.2.1
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyrsistent==0.16.0
pyspark==2.4.5
pytest==6.2.2
pytest-cov==2.11.1
python-apt==1.6.5+ubuntu0.3
python-dateutil==2.8.1
python-editor==1.0.4
python-json-logger==2.0.1
pytz==2020.5
PyYAML==5.3.1
pyzmq==19.0.2
qdldl==0.1.5.post0
qtconsole==4.7.6
QtPy==1.9.0
regex==2020.11.13
requests==2.25.1
requests-kerberos==0.12.0
requests-oauthlib==1.3.0
requests-unixsocket==0.2.0
retrying==1.3.3
rsa==4.5
ruamel.yaml==0.16.12
ruamel.yaml.clib==0.2.2
s3contents==0.6.1
s3fs==0.4.2
s3transfer==0.3.4
scikit-learn==0.24.1
scipy==1.4.1
scs==2.1.2
selenium==3.141.0
Send2Trash==1.5.0
six==1.15.0
smmap==3.0.5
sniffio==1.2.0
sparkmagic @ git+https://github.com/viaduct-ai/sparkmagic.git@cd575a07e20867b7e7755a74e5b168978602ffc4#subdirectory=sparkmagic
SQLAlchemy==1.3.22
ssh-import-id==5.7
tenacity==6.3.1
tensorboard==2.3.0
tensorboard-plugin-profile==2.4.0
tensorboard-plugin-wit==1.7.0
tensorflow==2.3.0
tensorflow-estimator==2.3.0
termcolor==1.1.0
terminado==0.8.3
testbook==0.2.5
testpath==0.4.4
textwrap3==0.9.2
threadpoolctl==2.1.0
toml==0.10.2
tornado==6.1
tqdm==4.56.0
traitlets==5.0.0
typed-ast==1.4.2
typing-extensions==3.7.4.3
unattended-upgrades==0.1
untokenize==0.1.1
urllib3==1.25.10
virtualenv==20.4.0
virtualenv-clone==0.5.4
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
xgboost==1.3.3
yapf==0.30.0
yarl==1.6.3
zipp==3.1.0
welcome[bot] commented 3 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

consideRatio commented 3 years ago

@jpugliesi can you verify that the environment variable is set on the created user pod by inspecting the pod itself?

I'm not confident you configure the setting of the environment variable correctly, or perhaps what you provided was just that? This worked for me in z2jh 0.11.1

singleuser:
  defaultUrl: /lab
  extraEnv:
    # ref: https://github.com/jupyterhub/jupyterhub/blob/master/docs/source/reference/config-user-env.md#switching-to-jupyter-server
    JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp

our jupyter_server_config.py is:

c = get_config()
c.Spawner.default_url = '/lab'

I didn't configure this or similar. I suggest to try removing that. Note that Spawner is a JupyterHub thing, and jupyter_server which isn't won't be aware of this anyhow I think.

consideRatio commented 3 years ago

This seems stale now, and is probably not related to z2jh itself. I'll close this.

Note that if this was caused by jupyterhub/jupyterhub#3328, then it will be fixed with the next z2jh release that will contain that version of JupyterHub having that fix.

GabeChurch commented 1 year ago

You can fix this problem by setting the following

singleuser: 
     cmd: jupyter-labhub

SEE https://discourse.jupyter.org/t/jupyterhub-singleuser-and-jupyter-server/10942/14