question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't reconnect to remote jupyter server without UI reload

See original GitHub issue

Applies To

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

What happened?

  1. Start up a jupyter server with some fixed token or password URL, e.g. run jupyter notebook --no-browser --NotebookApp.token='12345'
  2. Configure a workspace to connect to that remote server (e.g. http://localhost:8888/?token=12345) and open or create some notebook files.
  3. Close the workspace.
  4. Cause something to happen such that the remote server is not accessible (e.g. kill it, or disconnect from the network if the server is truly on a remote machine).
  5. Reopen the workspace. (Or just force a UI reload to simulate the close/reopen.)
  6. Note that none of the “run” buttons are available in the notebook UI because (obviously) the jupyter server is not available.
  7. Restart the jupyter server, as one would do in such a case.
  8. “Run” buttons remain greyed-out in the notebook UI.
  9. Try to force a reconnect to the now-running server by bringing up the “pick how to connect to jupyter” palette and either selecting the current URL from the “recents” list, or selecting “existing” and re-entering the current URL.
  10. Nothing happens! (I assume vscode doesn’t do anything because it assumes selecting a server URL that it is “already” connected to should be a no-op, without noting that there is actually no active connection.) Expected outcome: this would cause vscode to try to reconnect to the now-restored jupyter server.
  11. The only way to reconnect to the jupyter server is to reload the UI or close and reopen the workspace.

VS Code Version

Version: 1.61.2 (Universal) Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643 Date: 2021-10-19T15:49:28.381Z (2 wks ago) Electron: 13.5.1 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 20.6.0

Jupyter Extension Version

v2021.9.1101343141

Coding Language and Runtime Version

Python, though I don’t imagine it matters?

Running Jupyter locally or remotely?

Remote

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zpincuscommented, Aug 16, 2022

Yeah, it’s much better-behaved now! Very helpful errors and everything.

0reactions
DonJayamannecommented, Aug 15, 2022

@zpincus Please could you test the latest version of the Jupyter extension and let us know if this works as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection Failed to remote jupyter notebook - Stack Overflow
So solution is simply choosing a different port number, e.g. 8890 or else except 8888 in your case. Didn't work for me.
Read more >
Config file and command line options - The Jupyter Notebook
Reload the webapp when changes are made to any Python src files. NotebookApp.base_project_urlUnicode. Default: '/'. DEPRECATED use base_url. NotebookApp.
Read more >
Run Jupyter notebooks in your workspace - Azure
Learn how run a Jupyter notebook without leaving your workspace in Azure Machine Learning studio.
Read more >
IPython Console — Spyder 5 documentation
To connect to a kernel on a remote machine,. Launch a Spyder kernel on the remote host if one is not already running,...
Read more >
Connecting to a Remote Jupyter Notebook Server Running on ...
Navigating the VS Code UI is probably the hardest part of connecting it to a Jupyter kernel, remote or local, so let's see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found