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

Problem reconnecting to jupyter notebook #16323

Open
1 of 2 tasks
matssk opened this issue Dec 19, 2024 · 6 comments
Open
1 of 2 tasks

Problem reconnecting to jupyter notebook #16323

matssk opened this issue Dec 19, 2024 · 6 comments
Assignees
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster notebook-remote Applies to remote Jupyter Servers

Comments

@matssk
Copy link

matssk commented Dec 19, 2024

Applies To

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

What happened?

If the jupyter notebook server restarts, the plugin refuses to reconnect until I restart Visual Studio Code. It says "Unable to connect to the remote server. Ensure the server is running and reachable." This error message will persist until Visual Studio Code is restarted, even though the jupyter server is already back up.

VS Code Version

1.96

Jupyter Extension Version

2024.11.0

Jupyter logs

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

@matssk matssk added the bug Issue identified by VS Code Team member as probable bug label Dec 19, 2024
@DonJayamanne
Copy link
Contributor

Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to trace
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel (use the command Jupyter: Show Output to get to the logs).

@matssk
Copy link
Author

matssk commented Dec 20, 2024

I won't be able to do that for a few weeks, but I was looking a bit at server logs and it looks like maybe what's happening is it tries logging in again with the same cookies/headers, but these are not valid any more since the server restarted, so it should retry with the token and it seems maybe it's not doing that unless vscode is restarted.

@DonJayamanne
Copy link
Contributor

Do you have a notebook connected to a kennel?
If you do, and then restart the Jupiter server then the kernel that was connected to the notebook is now lost and reconnecting doesn't work.

Hence you need to reselect a kennel spec to get around this.

Is this what you are running into.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster notebook-remote Applies to remote Jupyter Servers labels Dec 20, 2024
@matssk
Copy link
Author

matssk commented Dec 21, 2024

Yes. After restarting the jupyter server I click "Select kernel", then "Existing Jupyter server" and I choose the server there. When I try to reselect the kernel and press the reload icon, it does not connect. After I restart vscode I can try reconnecting to the kernel and it works, but I have to enter the token again.

@DonJayamanne
Copy link
Contributor

and it works, but I have to enter the token again.

Oh so you enter a while new token, is that correct?
And the request is to be provided to enter the new token instead of having to restart vscode.

@matssk
Copy link
Author

matssk commented Dec 21, 2024

I don't get a request for a new token unless I restart vscode, it just says it can't connect.

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Dec 21, 2024
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster notebook-remote Applies to remote Jupyter Servers
Projects
None yet
Development

No branches or pull requests

3 participants