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

Investigate issues with jupyter-contrib-nbextensions for utoronto-configurator #2380

Closed
pnasrat opened this issue Mar 20, 2023 · 13 comments · Fixed by #3550
Closed

Investigate issues with jupyter-contrib-nbextensions for utoronto-configurator #2380

pnasrat opened this issue Mar 20, 2023 · 13 comments · Fixed by #3550
Assignees

Comments

@pnasrat
Copy link
Contributor

pnasrat commented Mar 20, 2023

Context

via https://2i2c.freshdesk.com/a/tickets/554

jupyter-contrib-nbextensions is
installed. I'll note that running jupyter nbextension list shows
"nbextensions_configurator/config_menu/main", but there are "problems
found" with that extension.

jovyan@c97ceffb19a2:~$ pip list | grep jupyter-nbextension 
jupyter-nbextensions-configurator 0.6.1
jovyan@c97ceffb19a2:~$ jupyter nbextension list 
Known nbextensions:
  config dir: /opt/conda/etc/jupyter/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      jupyter_resource_usage/main  enabled 
      - Validating: OK
      jupyterlab-plotly/extension  enabled 
      - Validating: OK
      jupytext/index  enabled 
      - Validating: OK
      markus-jupyter-extension/extension  enabled 
      - Validating: OK
      rise/main  enabled 
      - Validating: OK
      voila/extension  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
      contrib_nbextensions_help_item/main  enabled 
      - Validating: OK
    tree section
      jupyter_server_proxy/tree  enabled 
      - Validating: OK
      jupyter_tree_download/tree  enabled 
      - Validating: OK
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

Proposal

No response

Updates and actions

No response

@pnasrat
Copy link
Contributor Author

pnasrat commented Mar 20, 2023

Jinja2 needs to be pinned for voila but unrelated.

[D 09:48:34.453 NotebookApp] [jupyter_nbextensions_configurator] Loading 0.6.1
[D 09:48:34.454 NotebookApp] [jupyter_nbextensions_configurator]   Editing templates path to add /opt/conda/lib/python3.10/site-packages/jupyter_nbextensions_configurator/templates
[D 09:48:34.454 NotebookApp] [jupyter_nbextensions_configurator]   Editing nbextensions path to add /opt/conda/lib/python3.10/site-packages/jupyter_nbextensions_configurator/static
[D 09:48:34.454 NotebookApp] [jupyter_nbextensions_configurator]   Adding new handlers
[I 09:48:34.455 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.6.1
[W 09:48:36.102 NotebookApp] Loading JupyterLab as a classic notebook (v6) extension.
[I 2023-03-20 09:48:36.116 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.10/site-packages/jupyterlab
[I 2023-03-20 09:48:36.116 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 09:48:36.226 NotebookApp] [Jupytext Server Extension] Deriving a JupytextContentsManager from LargeFileManager
[W 09:48:36.472 NotebookApp] Error loading server extension voila.server_extension
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.10/site-packages/notebook/notebookapp.py", line 2040, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "/opt/conda/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/opt/conda/lib/python3.10/site-packages/voila/__init__.py", line 11, in <module>
        from .server_extension import _load_jupyter_server_extension # noqa
      File "/opt/conda/lib/python3.10/site-packages/voila/server_extension.py", line 21, in <module>
        from .handler import VoilaHandler
      File "/opt/conda/lib/python3.10/site-packages/voila/handler.py", line 24, in <module>
        from .notebook_renderer import NotebookRenderer
      File "/opt/conda/lib/python3.10/site-packages/voila/notebook_renderer.py", line 24, in <module>
        from .exporter import VoilaExporter
      File "/opt/conda/lib/python3.10/site-packages/voila/exporter.py", line 15, in <module>
        from jinja2 import contextfilter
    ImportError: cannot import name 'contextfilter' from 'jinja2' (/opt/conda/lib/python3.10/site-packages/jinja2/__init__.py)
[I 09:48:36.476 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 09:48:36.476 NotebookApp] Jupyter Notebook 6.5.3 is running at:
[I 09:48:36.476 NotebookApp] http://localhost:8888/?token=a66242d872cded51b0b60f406db2fe342cead16f040db892
[I 09:48:36.476 NotebookApp]  or http://127.0.0.1:8888/?token=a66242d872cded51b0b60f406db2fe342cead16f040db892
[I 09:48:36.476 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 09:48:36.484 NotebookApp] No web browser found: could not locate runnable browser.
[C 09:48:36.484 NotebookApp] 

@pnasrat
Copy link
Contributor Author

pnasrat commented Mar 20, 2023

Note the extensions list error may be misleading as I don't see a tb above see also

Jupyter-contrib/jupyter_nbextensions_configurator#37
Jupyter-contrib/jupyter_nbextensions_configurator#131

@yuvipanda
Copy link
Member

Upgrading jupyter-nbextensions-configurator from 0.5.1 to 0.7 might fix it, perhaps related to Jupyter-contrib/jupyter_nbextensions_configurator#141?

@pnasrat
Copy link
Contributor Author

pnasrat commented Mar 20, 2023

Issue still appears with:

conda list | grep nbex
jupyter-contrib-nbextensions 0.7.0                    pypi_0    pypi
jupyter-nbextensions-configurator 0.6.1                    pypi_0    pypi
 jupyter nbextension list 
Known nbextensions:
  config dir: /home/jovyan/.jupyter/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      contrib_nbextensions_help_item/main  enabled 
      - Validating: OK
      hide_input  enabled 
      - Validating: problems found:
        - require?  X hide_input
    tree section
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main
  config dir: /opt/conda/etc/jupyter/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      jupyter_resource_usage/main  enabled 
      - Validating: OK
      jupyterlab-plotly/extension  enabled 
      - Validating: OK
      jupytext/index  enabled 
      - Validating: OK
      rise/main  enabled 
      - Validating: OK
      voila/extension  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
    tree section
      jupyter_server_proxy/tree  enabled 
      - Validating: OK
      jupyter_tree_download/tree  enabled 
      - Validating: OK
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

@pnasrat
Copy link
Contributor Author

pnasrat commented Mar 20, 2023

Actually it functionally works with the upgrade but you have to uncheck "disable configuration for nbextensions without explicit compatibility (they may break your notebook environment, but can be useful to show for nbextension development)" as shown with hide input working on the right. The cli breakage is misleading per above

image

@pnasrat
Copy link
Contributor Author

pnasrat commented Mar 20, 2023

Emailed community with testing instructions if that works for them. I tested locally on a clean launch of the image run locally via docker. I did the following in a running jupyter notebook --ip 0.0.0.0 launch a terminal and run the below, then refresh the list of extensions.

pip install --upgrade 'jupyter-contrib-nbextensions==0.7.' 
jupyter contrib nbextension install --user

@damianavila damianavila moved this from Needs Shaping / Refinement to In progress in DEPRECATED Engineering and Product Backlog Mar 20, 2023
@damianavila damianavila moved this to In Progress ⚡ in Sprint Board Mar 20, 2023
@pnasrat
Copy link
Contributor Author

pnasrat commented Mar 22, 2023

Community member was unable to fix in the way I documented. I do not yet have access to the utoronto hub. Going to liase with @yuvipanda to see if we can get a work around for them.

@yuvipanda
Copy link
Member

I tried to see if this was related to the serverapp change (with #2210), but reverting that and deploying to staging had no effect.

I'm upgrading nbcontrib (2i2c-org/utoronto-image#48) to see if that helps.

@yuvipanda
Copy link
Member

Aha, with a bit more digging, I'm pretty sure the culprit is Jupyter-contrib/jupyter_nbextensions_configurator#152.

I'm going to pin nbclassic<0.5 and see if that fixes things.

@yuvipanda
Copy link
Member

Symptoms alleviated by #2411. We need to figure out what the longer term solution there is.

yuvipanda added a commit to 2i2c-org/utoronto-image that referenced this issue Jun 24, 2023
Following suggestion from
Jupyter-contrib/jupyter_nbextensions_configurator#153
that we need to explicilty enable the configurator.
nbclassic also has hit 1.0, which might help.

Ref 2i2c-org/infrastructure#2380
@damianavila damianavila moved this from In progress to Waiting in DEPRECATED Engineering and Product Backlog Jul 5, 2023
@pnasrat pnasrat removed their assignment Jul 11, 2023
@yuvipanda yuvipanda removed their assignment Jul 27, 2023
@damianavila
Copy link
Contributor

This is upstream, closing now.

yuvipanda added a commit to yuvipanda/pilot-hubs that referenced this issue Dec 27, 2023
Brings in 2i2c-org/utoronto-image#58,
so we no longer have to use the older notebook server.

Fixes 2i2c-org#2380
Ref 2i2c-org#2729
yuvipanda added a commit to yuvipanda/pilot-hubs that referenced this issue Dec 27, 2023
Brings in 2i2c-org/utoronto-image#58,
so we no longer have to use the older notebook server.

Fixes 2i2c-org#2380
Ref 2i2c-org#2729
@yuvipanda
Copy link
Member

2i2c-org/utoronto-image#58 actually fixes this, #3550 rolls it out to just the staging utoronto hub. It can be rolled out to prod on Jan 9.

@damianavila
Copy link
Contributor

I think this landed into production on Jan 9th, ref: #3598.
Feel free to reopen if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done 🎉
Development

Successfully merging a pull request may close this issue.

3 participants