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.

Extension continuously tries to reconnect to previously selected jupyter server

See original GitHub issue

Environment data

  • VS Code version: 1.33.1
  • Extension version (available under the Extensions sidebar): 2019.4.11987
  • OS and version: Windows_NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.5.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): pipenv
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

When switching the remote jupyter server URI, the extension is expected to stop querying the previously selected remote notebook.

Actual behaviour

The extension continues to query the first remote server.

It should be noted the Interactive window works as expected when switching jupyter servers - the issue is that the extension continues to make these requests although they are unnecessary. This is problematic in use-cases (such as mine) where I switch remote servers quite often during coding (e.g. running locally/on a GPU-powered prototyping server/on a large-scale cluster). I’m thinking this may be a common scenario.

Steps to reproduce:

  1. Manually start a jupyter server
  2. Connect the Python Interactive window to that server and run some command
  3. Close the Python Interactive window
  4. Restart the jupyter server (so that it gets a different auth token)
  5. Connect the Python Interactive window to the new server with the new auth token
  6. In the jupyter server’s log (stdout) you’ll see requests recieving 403 FORBIDDEN once every few seconds

Logs

Output from Console under the Developer Tools panel: -1556541596382.log

Output of the said jupyter server:

[W 12:39:46.146 NotebookApp] 403 GET /api/sessions?1556541585798 (10.164.120.31) 1.07ms referer=None
[W 12:39:56.146 NotebookApp] Forbidden
[W 12:39:56.147 NotebookApp] 403 GET /api/sessions?1556541595798 (10.164.120.31) 1.05ms referer=None
[W 12:40:06.145 NotebookApp] Forbidden
[W 12:40:06.146 NotebookApp] 403 GET /api/sessions?1556541605798 (10.164.120.31) 1.15ms referer=None
[W 12:40:07.501 NotebookApp] Forbidden
[W 12:40:07.501 NotebookApp] 403 GET /api/kernelspecs?1556541607153 (10.164.120.31) 1.04ms referer=None
[W 12:40:16.146 NotebookApp] Forbidden
[W 12:40:16.146 NotebookApp] 403 GET /api/sessions?1556541615798 (10.164.120.31) 1.02ms referer=None
[W 12:40:26.145 NotebookApp] Forbidden
[W 12:40:26.146 NotebookApp] 403 GET /api/sessions?1556541625798 (10.164.120.31) 1.07ms referer=None
[W 12:40:36.146 NotebookApp] Forbidden

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rchiodocommented, Oct 22, 2019

I’d say microsoft/vscode-python#3104 is likely to be implemented. It has a ton of up votes and wouldn’t be that much work.

0reactions
rchiodocommented, Oct 22, 2019

To answer this question:

Do you think this would be easy for newbie to implement?

I think the solution would be to do this on remote server jupyter uri change (not on closing the interactive window). To do that would require

  • A listener for that config setting changing
  • Some new methods in jupyterExecutionFactory to expose a way to shutdown the active servers. Basically something that would call serverCache.dispose().
Read more comments on GitHub >

github_iconTop Results From Across the Web

Extension continuously tries to reconnect to previously ...
The extension continues to query the first remote server. It should be noted the Interactive window works as expected when switching jupyter ......
Read more >
Unable to start Jupyter notebook on VS Code - python
When I tried to create a new jupyter file for the first time, the Python extension installed ipykernel in my virtual environment "da38"...
Read more >
What to do when things go wrong - The Jupyter Notebook
Try disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have ......
Read more >
Keep Jupyter Notebook Running Even After Browser is Closed
Some ways to handle this is to log the outputs into another file or use a specific logger. Run it as a python...
Read more >
How to Use Jupyter Notebook: A Beginner's Tutorial - Dataquest
From the menu bar, click Insert and select Insert Cell Below to create a new code cell underneath your first and try out...
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