Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get 404 with jupyterlab behind nginx #1234

Open
cjbd opened this issue Mar 20, 2023 · 8 comments
Open

get 404 with jupyterlab behind nginx #1234

cjbd opened this issue Mar 20, 2023 · 8 comments

Comments

@cjbd
Copy link

cjbd commented Mar 20, 2023

Description

Hello, I follow this article to put my jupyterlab behind nginx, it's working fine

But when I install jupyterlab-git extension with pip, I always get this error message in the front end:
image

and from the console output, I can see error log like this:

[W 2023-03-20 03:38:17.634 ServerApp] 404 GET /git/settings?version=0.41.0&1679283497734 
(172.18.0.1) 0.81ms

Reproduce

  1. pip install jupyterlab-git
  2. reload jupyterlab
  3. check error message in both front end and back end

Expected behavior

jupyterlab-git extension should work like without nginx

Context

  • Python package version:
# pip show jupyterlab-git
Name: jupyterlab-git
Version: 0.41.0
Summary: A JupyterLab extension for version control using git
Home-page: https://github.com/jupyterlab/jupyterlab-git
Author: Jupyter Development Team
Author-email: 
License: BSD-3-Clause
Location: /opt/miniconda3/lib/python3.8/site-packages
Requires: jupyter-server, nbdime, nbformat, packaging, pexpect, traitlets
Required-by: 
  • Extension version:
# jupyter labextension list
JupyterLab v3.4.4
/opt/miniconda3/share/jupyter/labextensions
        catboost-widget v1.0.0 enabled OK
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyterlab-plotly v5.13.1 enabled OK
        nbdime-jupyterlab v2.1.1 enabled OK
        @jupyter-widgets/jupyterlab-manager v5.0.5 enabled OK (python, jupyterlab_widgets)
        @bokeh/jupyter_bokeh v3.0.5 enabled OK (python, jupyter_bokeh)
        @pyviz/jupyterlab_pyviz v2.2.1 enabled OK (python, pyviz_comms)
        @jupyter-server/resource-usage v0.7.2 enabled  X (python, jupyter-resource-usage)
        @jupyterlab/git v0.41.0 enabled OK (python, jupyterlab-git)


"@jupyter-server/[email protected]" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab              Extension      Package
>=3.4.4 <3.5.0          >=3.5.1 <4.0.0 @jupyterlab/application
>=3.4.4 <3.5.0          >=3.5.1 <4.0.0 @jupyterlab/apputils
>=3.4.4 <3.5.0          >=3.5.1 <4.0.0 @jupyterlab/console
>=5.4.4 <5.5.0          >=5.5.1 <6.0.0 @jupyterlab/coreutils
>=3.4.4 <3.5.0          >=3.5.1 <4.0.0 @jupyterlab/notebook
>=6.4.4 <6.5.0          >=6.5.1 <7.0.0 @jupyterlab/services
>=3.4.4 <3.5.0          >=3.5.1 <4.0.0 @jupyterlab/statusbar
>=3.4.4 <3.5.0          >=3.5.1 <4.0.0 @jupyterlab/translation


Other labextensions (built into JupyterLab)
   app dir: /opt/miniconda3/share/jupyter/lab
        jupyterlab-dash v0.4.2 enabled OK


Build recommended, please run `jupyter lab build`:
    jupyterlab-dash needs to be included in build
  • Git version:
# git --version
git version 2.25.1
  • Operating System and its version:
Command Line Output
[W 2023-03-20 03:38:17.634 
ServerApp] 404 GET /git/settings?
version=0.41.0&1679283497734 
(172.18.0.1) 0.81ms referer=None
Web Browser Output
69.6374f7d6f5f3a1e80ebc.js?v=6374f7d6f5f3a1e80ebc:1 Failed to load the jupyterlab-git server extension settings Error: Git server extension is unavailable. Please ensure you have installed the JupyterLab Git server extension by running: pip install --upgrade jupyterlab-git. To confirm that the server extension is installed, run: jupyter server extension list.
    at 69.6374f7d6f5f3a1e80ebc.js?v=6374f7d6f5f3a1e80ebc:1:177876
    at async activate (69.6374f7d6f5f3a1e80ebc.js?v=6374f7d6f5f3a1e80ebc:1:177406)
@cjbd cjbd added the bug label Mar 20, 2023
@welcome
Copy link

welcome bot commented Mar 20, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

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! 👋

Welcome to the Jupyter community! 🎉

@fcollonval
Copy link
Member

Hey @cjbd it is likely because the server extension part of this extension is not enable. Could you execute

jupyter server extension list

@cjbd
Copy link
Author

cjbd commented Mar 20, 2023

@fcollonval thanks for the update, pls find command output, it's enabled

# jupyter server extension list
Config dir: /root/.jupyter

Config dir: /opt/miniconda3/etc/jupyter
    jupyter_resource_usage enabled
    - Validating jupyter_resource_usage...
      jupyter_resource_usage 0.7.2 OK
    jupyter_server_mathjax enabled
    - Validating jupyter_server_mathjax...
      jupyter_server_mathjax  OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.4.4 OK
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.41.0 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic 0.5.2 OK
    nbdime enabled
    - Validating nbdime...
      nbdime 3.1.1 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK
    panel.io.jupyter_server_extension enabled
    - Validating panel.io.jupyter_server_extension...
      panel.io.jupyter_server_extension  OK

Config dir: /usr/local/etc/jupyter

@cjbd
Copy link
Author

cjbd commented Mar 20, 2023

something that might not be relevant to this, i also had trouble with panel extension, it was giving simlar 404 error for /panel/...
just now i found that if i don't use nginx and launch jupyterlab from localhost, the panel extension is working fine, while git extension is still giving 404 error in the command console

@fcollonval
Copy link
Member

Do you filter endpoints?

If yes you are likely filtering the endpoints of this extension?

@cjbd
Copy link
Author

cjbd commented Mar 20, 2023

@fcollonval no, i don't know how to do that...

@AlvinnnnA
Copy link

Has a similar issue here. My setup includes a jupyterhub as docker container that spawns jupyterlab containers. All reverse proxy-ed through a nginx server. Everything works fine until I wish to install a git extension. conda install works and after installation the output is:

$ jupyter server extension list
Config dir: /home/jovyan/.jupyter

Config dir: /opt/conda/etc/jupyter
--Other extensions omitted...
    jupyterlab_git enabled
    - Validating jupyterlab_git...
Package jupyterlab_git took 0.0258s to import
      jupyterlab_git 0.41.0 OK

Config dir: /usr/local/etc/jupyter

and

$ jupyter labextension list
JupyterLab v3.6.3
/opt/conda/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        nbdime-jupyterlab v2.2.0 enabled OK
        @jupyterlab/git v0.41.0 enabled OK (python, jupyterlab-git)

Other labextensions (built into JupyterLab)
   app dir: /opt/conda/share/jupyter/lab

However when I reload the page this pops up and the logs from the lab container reads:
Screenshot 2023-07-17 at 15 31 16
and the logs concerning the extension from the lab container reads:

[W 2023-07-17 07:15:31.012 ServerApp] 404 GET /user/alvinnnn/git/settings?version=0.41.0&1689578130935 (alvinnnn@my-IP-address) 23.85ms

and

[W 2023-07-17 07:16:36.266 ServerApp] 404 GET /user/alvinnnn/git/settings?version=0.41.0&1689578196194 (alvinnnn@my-IP-address) 21.42ms

Really not sure what was the issue but seemed very close to this

@fcollonval
Copy link
Member

I would guess that your nginx is likely to filter out new API endpoints.

You should look at the proxy log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants