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

Can't connect to remote JupyterHub #14053

Closed
1 of 2 tasks
renan-r-santos opened this issue Aug 3, 2023 · 5 comments
Closed
1 of 2 tasks

Can't connect to remote JupyterHub #14053

renan-r-santos opened this issue Aug 3, 2023 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-remote Applies to remote Jupyter Servers verified Verification succeeded

Comments

@renan-r-santos
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

I was trying to follow the documentation regarding connecting to an existing remote Jupyter server but it isn't working.

I'm on VSCode insiders and my remote environment is JupyterHub running at https://example-domain.com/notebook. JupyterLab is accessible at https://example-domain.com/notebook/user/[email protected]/lab.

I have tried many variations of URLs but none seem to work. Additionally, it is always asking for URL, username and password. My deployment of JupyterHub uses Google SSO for authentication, so there's no JupyterHub-specific password to type. I've tried creating a token from JupyterHub's admin panel and using it as a password and it also doesn't work.

Maybe related, but I'd like to ask if, instead of using a remote Kernel with a local file, would it be possible to use a remote Kernel and open a remote folder inside a JupyterLab instance? If not, is this planned? Just for reference, I'm talking about something similar to PyCharm's Jupyter remote connection. Well, I was searching the issue tracker and I think it's #1366, right?

image

VS Code Version

Insiders (1.82.0-insider, undefined, vscode.dev) - 8/3/23

Jupyter Extension Version

2023.7.1002162226

Jupyter logs

Visual Studio Code - Insiders (1.82.0-insider, undefined, vscode.dev)
Jupyter Extension Version: 2023.7.1002162226.
Python Extension Version: 2023.15.12151010.
Opened workspace folder.
18:55:10.554 [info] User belongs to experiment group 'FastKernelPicker'
18:55:10.554 [info] User belongs to experiment group 'NewRemoteUriStorage'
18:55:10.554 [info] User belongs to experiment group 'PasswordManager'
18:55:10.554 [info] User belongs to experiment group 'NewJupyterSession'
18:56:06.040 [error] Failed to get the password for https://example-domain.com/notebook/user/[email protected]/ TypeError: Failed to fetch

Coding Language and Runtime Version

Python 3.11.4

Language Extension Version (if applicable)

2023.15.12151010

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

@renan-r-santos renan-r-santos added the bug Issue identified by VS Code Team member as probable bug label Aug 3, 2023
@DonJayamanne
Copy link
Contributor

rd. My deployment of JupyterHub uses Google SSO for authentication, so there's no JupyterHub-specific password to type.

Unfortunately this isn't supported.

I've tried creating a token from JupyterHub's admin panel and using it as a password and it also doesn't work.

Unfortunately we found that support for Jupyter Hub in the extension is currently broken for new versions of Jupyter Hub. We are currently looking into moving this into a separate extension,
I would also confirm that I too cannot connect to Jupyter hub when testing at my end.

instead of using a remote Kernel with a local file, would it be possible to use a remote Kernel and open a remote folder inside a JupyterLab instance? If n

Yes, there are two options

  1. Please upvote this feature request Create a remote file system/explrorer (Jupyter Lab behavior) #1366 (this is what you are looking for)
  2. Optionally you can use VS Code Tunnels as well, see here for more https://code.visualstudio.com/docs/datascience/notebooks-web#_remote-tunneling-with-vs-code-server
    WIth this option, you open a terminal, start VS Code server, and then you get a URL.
    Next you open that url in the browser and now you have full access to the remote server via the browser, just like Jupyter lab (but all in VS Code, i.e you can access the terminals, files folder, etc all from within vscode)

@DonJayamanne DonJayamanne assigned DonJayamanne and unassigned rebornix Aug 4, 2023
@DonJayamanne DonJayamanne added notebook-remote Applies to remote Jupyter Servers notebook-kernel-remote labels Aug 4, 2023
@renan-r-santos
Copy link
Author

Thank you for all the information, that's very helpful. Yes, indeed VSCode Tunnels work quite well with Jupyter Kernels, thanks.
Feel free to close this issue if you think it's appropriate. Thanks.

@DonJayamanne
Copy link
Contributor

@renan-r-santos
I'll be working on adding support for JupyterHub in a separate extension in the next iteration, and will see how we can get it working with a custom token.

I.e. this is what I'll try to get working I've tried creating a token from JupyterHub's admin panel and using it as a password and it also doesn't work.

@DonJayamanne DonJayamanne added this to the September 2023 milestone Sep 7, 2023
@DonJayamanne
Copy link
Contributor

Note however, adding support for SSO will be out of scope as this cannot be done in external applications.

@DonJayamanne
Copy link
Contributor

I.e. this is what I'll try to get working I've tried creating a token from JupyterHub's admin panel and using it as a password and it also doesn't work.

@renan-r-santos
We have created a new JuptyerHub extension, that supports username/password and username/api tokens.
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter-hub

This should now resolve the issue with the use of API tokens.
Please note, right now this only works in VS Code insiders, in 2 weeks we will ship a release that works in VS COde stable as well.

Please do let me know if that works, or better yet, keep using the tunnels, as I believe that gives a much richer experience.

@DonJayamanne DonJayamanne added the verified Verification succeeded label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-remote Applies to remote Jupyter Servers verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants