Extension continuously tries to reconnect to previously selected jupyter server
See original GitHub issueEnvironment 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:
- Manually start a jupyter server
- Connect the Python Interactive window to that server and run some command
- Close the Python Interactive window
- Restart the jupyter server (so that it gets a different auth token)
- Connect the Python Interactive window to the new server with the new auth token
- 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:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
To answer this question:
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