Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

404 error running in JupyterLab + JupyterHub #17

Closed
zac-yang opened this issue Jun 2, 2020 · 3 comments
Closed

404 error running in JupyterLab + JupyterHub #17

zac-yang opened this issue Jun 2, 2020 · 3 comments

Comments

@zac-yang
Copy link

zac-yang commented Jun 2, 2020

Hi @jonmmease, I've been trying out jupyter-dash in JupyterLab 2.1.1, many thanks for the great work here! I'm currently stuck at a 404 error trying to open the dash app. Additionally I ran into an issue with infer_jupyter_proxy_config() that I seem to have worked around successfully.


I followed the example getting_started notebook, but had ran into an issue running JupyterDash.infer_jupyter_proxy_config(), where cell execution continues indefinitely (and the kernel crashes if I interrupt the kernel). Somehow this is resolved by running this in a separate cell just before infer_jupyter_proxy_config():

from jupyter_dash.comms import _send_jupyter_config_comm_request
_send_jupyter_config_comm_request()

The top of my notebook looks like this (cells run in order, with restarted kernel):
image

The current issue I'm running into though is that the dash URL returns a 404, like such:
image
(I also get the same 404 with mode='external' or 'jupyterlab')

We're running JupyterLab 2.1.1 with JupyterHub 1.1 on a k8s deployment. Our jupyter environment as follows:

pip list | grep jupyter
jupyter-client         6.1.3
jupyter-console        6.1.0
jupyter-core           4.6.3
jupyter-dash           0.2.1.post1
jupyter-server-proxy   1.5.0
jupyter-telemetry      0.0.5
jupyterhub             1.1.0
jupyterlab             2.1.1
jupyterlab-server      1.1.3
jupyterlab-templates   0.2.3

jupyter labextension list
JupyterLab v2.1.1
Known labextensions:
   app dir: /opt/conda/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK
        @jupyterlab/geojson-extension v2.0.1  enabled  OK
        @jupyterlab/toc v3.0.0  enabled  OK
        jupyter-leaflet v0.12.4  enabled  OK
        jupyterlab-dash v0.2.0  enabled  OK
        jupyterlab-plotly v4.7.1  enabled  OK
        jupyterlab_templates v0.2.3  enabled  OK
        plotlywidget v4.7.1  enabled  OK

Following your suggested diagnosis checks from #14 :

  • Able to import jupyter_server_proxy successfully
  • jupyter_dash.comms._jupyter_config returns the following:
{'type': 'base_url_response',
 'server_url': 'http://go-orbitalinsight.com',
 'base_subpath': '/user/zac.yang@orbitalinsight.com/',
 'frontend': 'jupyterlab'}

The URL printed when I run_server(mode='external') is as follows, which looks right:
http://go-orbitalinsight.com/user/zac.yang@orbitalinsight.com/proxy/8050/

Would be grateful for any suggestions on resolving!

@jonmmease
Copy link
Contributor

Thanks for the detailed report @yzq89. Glad you got infer_jupyter_proxy_config working, we do need to document better the fact that this does need to be run in its own cell. This method does some manual manipulation of IPython kernel messages so that you can "Run All" on the notebook and still receive the Comm message from the extension before evaluating cells below this one.

Everything you reporting here looks find at first glance. And the fact that you're getting to the point where a URL is written out means that the flask server is running, and the Python kernel was able to communicate with it. So it sounds like it has something to do with the proxy.

The next thing I'd want to check is whether jupyter_server_proxy is successfully routing local ports to .../proxy/8050/ URLs.

One thing you could try would be to run a simple flask application on the server (e.g. https://flask.palletsprojects.com/en/1.1.x/quickstart/#a-minimal-application) on a particular port, like 8050, and see if the application can be reached at the .../proxy/8050/ address (See https://jupyter-server-proxy.readthedocs.io/en/latest/arbitrary-ports-hosts.html).

Just to double check, did you fully shut down and restart the Jupyter server after jupyter_server_proxy was installed?

@zac-yang
Copy link
Author

zac-yang commented Jun 3, 2020

Hey @jonmmease, I'm afraid this may be a facepalm moment re. restarting jupyter server.. will report back.
On infer_jupyter_proxy_config, just to clarify that just having the command in its own cell did not work; at least in our environment I needed the extra _send_jupyter_config_comms_request in a separate cell too.

@zac-yang
Copy link
Author

zac-yang commented Jun 4, 2020

Reporting back - 404 error went away when running the example code (plus the extra _send_jupyter_config_comm_request) with a fresh restart of JupyterLab. Closing as due to user error, thanks for helping @jonmmease!

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

2 participants