-
Notifications
You must be signed in to change notification settings - Fork 6
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
Jupyterhub kernel access with extensions for users with certain special characters in their username fails to access extension.js code from Jupyterhub #55
Comments
Quick addition to the potential impact:
After looking at the log output again, you seem to identify the plotly version and download the version specific to the plotly python version installed. So code incompatibilities should not be an issue anymore. But there might still be issues for extensions where you can not fall back to the cdn for download if there is such a thing. And the behaviour is in general different just because of the username used. Username with special chars => CDN download while normal Username => Jupyterhub download. |
Thanks for filing this issue, I will be shipping a new pre-release version of the Jupyter extension this week, Hopefully this should not be an issue. I.e. versions shouldn't be an issue. |
Addition 2: I figured out the setting causing the popup asking for the cdn download not to appear anymore. Its
If it is set even with the normal username the extension code is downloaded from the cdn. If it is not set it fails to download the extension code from the cdn and actually falls back to the Jupyterhub instance version. Not sure if i missed this the first time i tested it or if there is some other edgecase happening. See this log example.
|
Yea i saw that also after i opened the Ticket. Even if in the end everything works since the extension scripts usually are downloaded from the cdn with the correct version, i think the issue should still be fixed at some point, because it is an additional inconsistency depending on the username. Also maybe this means in some parts of the VS extension code base besides just this case the wrong encoded url is used and leads to worse problems. |
that is being tracked in a separate issue, and will be fixed.
Given this is fixed, I'm closing this issue. |
You mean #53 ? Because this issue regarding juypter extension download issues still exists in the dev version of the vscode jupyter-hub extension you linked me in #53 (comment). The here provided information is with this dev version installed. Unless you fixed this issue later it still exists in the code base. |
Please try in a few days with the latest version of vscode insiders and pre release version of Jupiter extension |
Environment data
Expected behaviour
When using a Jupyterhub instance with Jupyterlab extensions setup (In my example this will be
plotely
) i can use those extensions also locally while executing a local Jupyter Notebook in VS code with the remote kernel on the Jupyterhub. Since the executed python code is from Jupyterhub also the extension js code should be downloaded from the Jupyterhub instance for compatibility reasons.Aside from my specific issue described, i know this might be a bold request since extensions can have arbitrary JS code (as far as i am aware). But it seems the default behaviour to download (any) Jupyterhub extension js and integrate it during the VSCode Jupyter Notebook execution. Am i right there ?
This might be quite a complex feature to support, since different Jupyterhub instances might supply different extension
js
code (versions). So loading and using different js code in VSCode per open Notebook and depending on the Jupyterhub kernel used for a specific Notebook would probably need to be supported for best compatibility.Actual behaviour
When using a Jupyterhub instance with the
plotly
jupyterlab extension setup i get the following error when accessing the remote kernel while using a username with special characters likeuser (test)
:Error downloading from http://localhost:8000/user/user (test)/nbextensions/jupyterlab-plotly/extension.js: Not Found
The adjusted url
http://localhost:8000/user/user%20%28test%29/nbextensions/jupyterlab-plotly/extension.js
does work for downloading the expected extension code.Executing a Notebook still works with the remote Kernel, but if one executes a Notebook which makes use of the plotly extension, VSCode downloads the plotly extension js code from a cdn instead of the Jupyterhub server. This might lead to incompatibilities since the version downloaded from the cdn and the version on Jupyterhub differs.
With a "normal" username like
normal_user
i dont see the same error message and it also does not seem to download the extension code from the cdn but uses the Jupyerhub provided version.This issue was disovered and might be related to #53 (comment).
Steps to reproduce:
Setup or use a local or remote Jupyterhub instance with the jupyterlab extension
plotly
. The extension can be installed by installing theplotly
python package into the base environment of the juypterlab user environment. For my later provided test Notebook code to work, theplotly-resampler
python package also is needed. Login in and start the server with a user calleduser (test)
. This is quite easy to simulate with theDummyAuthenticator
authenticator module which allows any kind of username to be tested.Setup a API Tokens for authentication on the Jupyterhub instance
Use the url, user name and token and create a new remote Jupyterhub connection
existing Jupyterhub-Server
enter URL for existing Server
http://localhost:8000
user (test)
JupyterHub (test)
Error downloading from http://localhost:8000/user/user (test)/nbextensions/jupyterlab-plotly/extension.js: Not Found
.Execute the following test Notebook code with the saved remote kernel from
JupyterHub (test)
Everything looks as expected now. The plotly graph can be interactively used (zoom in and out etc.). But i see log messages about the extension code being downloaded from a cdn url instead of the Jupyterhub server.
Logs
Output for
Jupyter
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toJupyter
)The text was updated successfully, but these errors were encountered: