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 jupyterhub #45

Open
lifetooeasy opened this issue Jan 17, 2024 · 21 comments
Open

Can't connect to jupyterhub #45

lifetooeasy opened this issue Jan 17, 2024 · 21 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@lifetooeasy
Copy link

Environment data

  • VS Code version: 1.85.1
  • Jupyter Extension version (available under the Extensions sidebar): Switch to Pre-Release Version
  • Python Extension version (available under the Extensions sidebar): Switch to Pre-Release Version
  • OS (Windows | Mac | Linux distro) and version: Ubuntu 22
  • Python and/or Anaconda version: 3.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Remote

Expected behaviour

Connect jupyterhub session via vscode jupyterhub extension.

Actual behaviour

Invalid username or password.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

As described in the doc.

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

12:17:34.165 [error] Failed to start the Jupyter Server Error: Failed to fetch user info, Internal Server Error (500) with message  {"status": 500, "message": "error"}
    > at startServer (/.vscode/extensions/ms-toolsai.jupyter-hub-2023.10.1003492320/dist/extension.node.js:64252:9)

@lifetooeasy lifetooeasy added the bug Issue identified by VS Code Team member as probable bug label Jan 17, 2024
@DonJayamanne
Copy link
Collaborator

Thanks for filing this issue and sorry you are running into this issue.
Are you still running into this issue?
What version of Jupyter Hub do you have installed?
Can you verify you can log into Jupyter hub via the browser?

@DonJayamanne DonJayamanne self-assigned this Jan 28, 2024
@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Jan 28, 2024
@lifetooeasy
Copy link
Author

@DonJayamanne Unfortunately, I still have this issue I am running jupyterhub 1.5.0 and yes I can log in to jupyterhub.

@lifetooeasy
Copy link
Author

@DonJayamanne I am running version 2.3.1 of jupyterhub now and still have same issue, do you don't think that the new versions of vscode or vscode-jupyter-hub are the cause of this issue?

@lifetooeasy
Copy link
Author

could be related to microsoft/vscode-jupyter#39 ?

@quantum-byte
Copy link

@life
Because i was looking into a similiar issue just now.

Are there any special characters in the Jupyterhub username or what does your Jupyterhub user specific instance url look like ?

@DonJayamanne
Copy link
Collaborator

@quantum-byte @lifetooeasy
Please can you install this version of Jupyter Hub extension, & let me know if this works for you.

  • Download the file
  • Extract the zip file
  • Open VS Code and select the command Install from VSIX
  • Select the extracted *.vsix file
  • When prompted, reload VS Code
  • Test again

ms-toolsai-jupyter-hub-insiders.vsix.zip

@lifetooeasy
Copy link
Author

lifetooeasy commented Mar 28, 2024

11:07:53.330 [debug] 
11:07:53.455 [debug] Error: Failed to get user info, Internal Server Error (500) with message  {"status": 500, "message": "Internal Server Error"}
    > at getUserInfo (/home//.vscode/extensions/ms-toolsai.jupyter-hub-2024.4.100/dist/extension.node.js:66986:9)
11:07:53.641 [debug] 
11:07:53.641 [debug] 
11:07:53.644 [debug] 
11:07:53.886 [error] Failed to get user info Error: Failed to get user info, Forbidden (403) with message  {"status": 403, `message": "Forbidden"}
    > at getUserInfo (/.vscode/extensions/ms-toolsai.jupyter-hub-2024.4.100/dist/extension.node.js:66986:9)
11:07:53.887 [debug] 
11:07:54.024 [debug] Error: Failed to get user info, Internal Server Error (500) with message  {"status": 500, "message": "Internal Server Error"}
    > at getUserInfo (vscode/extensions/ms-toolsai.jupyter-hub-2024.4.100/dist/extension.node.js:66986:9)
11:07:54.239 [debug] 
11:07:54.240 [error] Failed to get the user Jupyter Url TypeError: Cannot read properties of undefined (reading 'length')
    > at getUserInfo (/.vscode/extensions/ms-toolsai.jupyter-hub-2024.4.100/dist/extension.node.js:66979:77)
11:07:55.625 [error] SessionManager cannot enumerate kernelSpecs. Specs undefined.
11:07:55.629 [error] Uri verification error Error: Failed to enumeration kernel Specs
    > at /.vscode/extensions/ms-toolsai.jupyter-hub-2024.4.100/dist/extension.node.js:67150:21
    ```

@liudaolunboluo
Copy link

I'm having the same problem, I reinstalled using visx and still have the same problem, my username has no special characters and I'm pretty sure I can log in in my browser!

@DonJayamanne
Copy link
Collaborator

Please can you

  • Uninstall JupyterHub extension
  • Download the attached file
  • Extract this file
  • Open VS Code and select the command Install from VSIX
  • Select the above extracted VSIX
  • Enable logging (debug logging)
  • When prompted to reload VS Code, please do so
  • Try to replicate the issue once again
  • Capture all the logs from the JupyterHub output panel
  • Share the logs

ms-toolsai-jupyter-hub-insiders.vsix.zip

Screenshot for enabling logging

Image

To get to the logs, please open the bottom output panel (use the command Outupt: Focus Output View)
& then select JupyterHub

Image

@lifetooeasy
Copy link
Author

lifetooeasy commented Jul 30, 2024

@DonJayamanne vscode can connect to remote server and list the available remote kernels.
When I click on one of them the kernel is enabled BUT when I try to execute a cell I got this:

10:21:49.318 [info] Starting Kernel python3 for 'Untitled-1.ipynb' (disableUI=false)
10:21:49.876 [error] Failed to change kernel, re-throwing Error: '_xsrf' argument missing from POST
    > at new n (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.6.0-linux-x64/dist/extension.node.js:98:4480)
    > originalException = Error: '_xsrf' argument missing from POST
10:21:49.884 [warn] Error occurred while trying to start the kernel, options.disableUI=false Error: Failed to connect to the remote Jupyter Server. Verify the server is running and reachable. ('_xsrf' argument missing from POST).
    > at Qc.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.6.0-linux-x64/dist/extension.node.js:285:2808)
    > serverProviderHandle = [object Object]
    > originalError = Error: '_xsrf' argument missing from POST
10:21:49.888 [warn] Kernel Error, context = start Error: Failed to connect to the remote Jupyter Server. Verify the server is running and reachable. ('_xsrf' argument missing from POST).
    > at Qc.create (/home/~/.vscode/extensions/ms-toolsai.jupyter-2024.6.0-linux-x64/dist/extension.node.js:285:2808)
    > serverProviderHandle = [object Object]
    > originalError = Error: '_xsrf' argument missing from POST

@DonJayamanne
Copy link
Collaborator

How have you started Jupyter hub? Is this locally installed?

If so please can you share the details of the versions of Jupyter hub and other packages

@lifetooeasy
Copy link
Author

lifetooeasy commented Jul 30, 2024

I am trying to connect to a remote jupyterhub not locally. It runs jupyterhub version 4.1.5 and jupyterlab 4.2.2.

@DonJayamanne

This comment has been minimized.

@DonJayamanne

This comment has been minimized.

@DonJayamanne
Copy link
Collaborator

@lifetooeasy
I think i have a better understanding of the issue now.
Do you have any idea how the remote JupyterHub server has been configured.

  • Do you just need a user name & password to authenticate against that server when using a regular browser (outside VS Code)?
    • Is this using OAuth or some other authentication mechanism?
  • What details are you providing when you try to connect to this from within VS Code?

@lifetooeasy
Copy link
Author

@DonJayamanne

  • outside vscode I am using username/password to authenticate
  • I am providing the URL of the jupyterhub server + username + token

@dorsegal
Copy link

dorsegal commented Aug 1, 2024

I had the same issue Error: '_xsrf' argument missing from POST. took this fix #65 and now I have another error.

Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffe

@DonJayamanne
Copy link
Collaborator

@dorsegal you are running into the issue #64

@dorsegal
Copy link

dorsegal commented Aug 1, 2024

I tried the work around but I have the same result.

Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer

@Yefee
Copy link

Yefee commented Aug 7, 2024

I tried the work around but I have the same result.

Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer

This is something I also encountered.

Although I have found a workaround, it is still painful to repeat the process every time.
Follow these steps: 1) Open JupyterHub in your browser and terminate the current kernel. 2) Return to VS Code and click "Restart" at the top of the notebook. 3) Run the notebook again and you've bypassed this error from now on.
For every notebook, you have to repeat this process 😫.

@nitzanvolman
Copy link

we have this issue as well,
I can confirm this workaround works (pretty annoying)

Cursor Version: 0.40.4
VSCode Version: 1.91.1

JupyterHub Extension Version: v2024.5.1002432242

JupyterLab Version: Version 4.0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

7 participants