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

Jupyter notebook extension on remote server does not work after VScode downgrade. #22865

Closed
amirhosseindavoody opened this issue Feb 5, 2024 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@amirhosseindavoody
Copy link

amirhosseindavoody commented Feb 5, 2024

Environment data

  • VS Code version: 1.85.2
  • Jupyter Extension version (available under the Extensions sidebar): v2023.11.1100101639
  • Python Extension version (available under the Extensions sidebar): v2023.20.0
  • OS (Windows | Mac | Linux distro) and version: Windows 11, using remote devepment on Suse 12
  • Python and/or Anaconda version: python 3.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): using pixi package manager
  • Jupyter server running: This is a remote development environment but the jupyter server is running locally on the remote machine.

Expected behaviour

The jupyter notebook should autocomplete the variable names and show list of live variables.

Actual behaviour

None of the functionalities of jupyter notebook extensions for autocomplete and showing existing variables work.

Steps to reproduce:

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

I don't have exact instructions, but this happened when I had to revert back from vscode 1.86 release to 1.85.2 because of glibc version incompatibility on my remote machine. Then I found out that the extensions have been upgraded too. So, I reverted back the extensions to some previous version from back in November. The extensions I reverted are Jupyter notebook, pylance, and vscode-python. Now, none of the functionalities for jupyter notebook work. Python extension seems to work for now. I get autocomplete in .py files but nothing in .ipynb files.

I see this error when I look at the jupyter extension page:

image

Logs

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

Visual Studio Code (1.85.2, ssh-remote, desktop)
Jupyter Extension Version: 2023.11.1003402403.
Python Extension Version: 2023.20.0.
Pylance Extension Version: 2023.11.10.
Platform: linux (x64).
Multiple Workspace folders opened /path/to/python/environment, path/to/jupyter/notebook
10:28:04.576 [info] Start refreshing Kernel Picker (1707157684576)
10:28:04.582 [info] Not using Pylance
10:28:05.473 [error] Failed to validate Password info [D [FetchError]: request to http://remote-server-ip:8888/tree? failed, reason: connect ECONNREFUSED 10.116.83.98:8888
	at ClientRequest.<anonymous> (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/node-fetch.js:1:306417)
	at ClientRequest.emit (node:events:513:28)
	at Socket.socketErrorListener (node:_http_client:502:9)
	at Socket.emit (node:events:513:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}
10:28:05.509 [error] Error fetching kernels from http://remote-server-ip:8888/ (remote-server-ip): [FetchError: request to http://remote-server-ip:8888/api/kernels?1707157685499 failed, reason: connect ECONNREFUSED 10.116.83.98:8888
	at ClientRequest.<anonymous> (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/node-fetch.js:1:306417)
	at ClientRequest.emit (node:events:513:28)
	at Socket.socketErrorListener (node:_http_client:502:9)
	at Socket.emit (node:events:513:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)]
10:28:05.510 [error] UniversalRemoteKernelFinder: Failed to get kernels without cache [FetchError: request to http://remote-server-ip:8888/api/kernels?1707157685499 failed, reason: connect ECONNREFUSED 10.116.83.98:8888
	at ClientRequest.<anonymous> (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/node-fetch.js:1:306417)
	at ClientRequest.emit (node:events:513:28)
	at Socket.socketErrorListener (node:_http_client:502:9)
	at Socket.emit (node:events:513:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)]
10:28:05.511 [error] Jupyter Lab Helper:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
	at v.dispose (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/@jupyterlab/services.js:11:10935)
	at ni.dispose (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/@jupyterlab/services.js:11:29299)
	at r.dispose (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/extension.node.js:138:4517)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async Promise.all (index 0)
	at async rT.listKernelsFromConnection (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/extension.node.js:235:22644)
	at async /nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/extension.node.js:235:20130]
10:28:05.511 [error] Failed to validate Password info [D [FetchError]: request to http://remote-server-ip:8888/tree? failed, reason: connect ECONNREFUSED 10.148.216.186:8888
	at ClientRequest.<anonymous> (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/node-fetch.js:1:306417)
	at ClientRequest.emit (node:events:513:28)
	at Socket.socketErrorListener (node:_http_client:502:9)
	at Socket.emit (node:events:513:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}
10:28:05.517 [error] Error fetching kernels from http://remote-server-ip:8888/ (remote-server-ip): [FetchError: request to http://remote-server-ip:8888/api/kernels?1707157685513 failed, reason: connect ECONNREFUSED 10.148.216.186:8888
	at ClientRequest.<anonymous> (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/node-fetch.js:1:306417)
	at ClientRequest.emit (node:events:513:28)
	at Socket.socketErrorListener (node:_http_client:502:9)
	at Socket.emit (node:events:513:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)]
10:28:05.520 [error] UniversalRemoteKernelFinder: Failed to get kernels without cache [FetchError: request to http://remote-server-ip:8888/api/kernels?1707157685513 failed, reason: connect ECONNREFUSED 10.148.216.186:8888
	at ClientRequest.<anonymous> (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/node-fetch.js:1:306417)
	at ClientRequest.emit (node:events:513:28)
	at Socket.socketErrorListener (node:_http_client:502:9)
	at Socket.emit (node:events:513:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)]
10:28:05.520 [error] Jupyter Lab Helper:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
	at v.dispose (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/@jupyterlab/services.js:11:10935)
	at ni.dispose (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/node_modules/@jupyterlab/services.js:11:29299)
	at r.dispose (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/extension.node.js:138:4517)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async Promise.all (index 0)
	at async rT.listKernelsFromConnection (/nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/extension.node.js:235:22644)
	at async /nfs/site/disks/tadm_work_19/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/dist/extension.node.js:235:20130]
10:28:05.870 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd0cd805199a84c55772db822326d76150fb29da8490063933ca6c923deab3cb765./path/to/python/environment/.pixi/envs/default/python./path/to/python/environment/.pixi/envs/default/python.-m#ipykernel_launcher  (Python Path: /path/to/python/environment/.pixi/envs/default/bin/python, Conda, 3.9.18) for 'path/to/jupyter/notebook/data_cleanup.ipynb' (disableUI=true)
10:28:07.134 [info] End refreshing Kernel Picker (1707157684576)
10:28:09.582 [error] Failed to get activated conda env vars for /path/to/python/environment/.pixi/env/bin/python
                 in 4174ms
10:28:09.584 [error] Unable to determine site packages path for python /path/to/python/environment/.pixi/env/bin/python (Conda)
10:28:09.594 [info] Process Execution: /path/to/python/environment/.pixi/env/bin/python -m pip list
10:28:09.597 [error] Failed to get activated conda env vars for /path/to/python/environment/.pixi/envs/default/bin/python
                 in 3714ms
10:28:09.599 [error] Unable to determine site packages path for python /path/to/python/environment/.pixi/envs/default/bin/python (Conda)
10:28:09.606 [info] Process Execution: /path/to/python/environment/.pixi/envs/default/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
10:28:09.613 [info] Process Execution: /path/to/python/environment/.pixi/envs/default/bin/python -m ipykernel_launcher --f=~/.local/share/jupyter/runtime/kernel-v2-31540CcI3YXsmyhtA.json
    > cwd: path/to/jupyter/notebook
10:28:09.619 [error] Failed to get activated conda env vars for /path/to/python/environment/.pixi/envs/default/bin/python
                 in 3750ms
10:28:09.620 [error] Unable to determine site packages path for python /path/to/python/environment/.pixi/envs/default/bin/python (Conda)
10:28:09.626 [info] Process Execution: /path/to/python/environment/.pixi/envs/default/bin/python -m pip list
10:28:09.638 [info] Process Execution: /path/to/python/environment/.pixi/env/bin/python -c "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
10:28:09.671 [info] Process Execution: /path/to/python/environment/.pixi/envs/default/bin/python -c "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
10:28:10.757 [info] Process Execution: /path/to/python/environment/.pixi/envs/default/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.11.1003402403-linux-x64/pythonFiles/printJupyterDataDir.py
12:07:28.187 [info] Handle Execution of Cells 0 for path/to/jupyter/notebook/data_cleanup.ipynb
12:07:28.196 [info] Kernel acknowledged execution of cell 0 @ 1707163648195
12:07:29.495 [info] End cell 0 execution after 1.299s, completed @ 1707163649494, started @ 1707163648195
12:07:31.237 [info] Handle Execution of Cells 1 for path/to/jupyter/notebook/data_cleanup.ipynb
12:07:31.244 [info] Kernel acknowledged execution of cell 1 @ 1707163651244
12:07:31.246 [info] End cell 1 execution after 0.002s, completed @ 1707163651246, started @ 1707163651244
12:07:42.969 [info] Handle Execution of Cells 3 for path/to/jupyter/notebook/data_cleanup.ipynb
12:07:42.975 [info] Kernel acknowledged execution of cell 3 @ 1707163662975
12:07:43.606 [info] End cell 3 execution after 0.631s, completed @ 1707163663606, started @ 1707163662975
12:07:44.424 [info] Handle Execution of Cells 4 for path/to/jupyter/notebook/data_cleanup.ipynb
12:07:44.430 [info] Kernel acknowledged execution of cell 4 @ 1707163664430
12:07:44.432 [info] End cell 4 execution after 0.002s, completed @ 1707163664432, started @ 1707163664430
12:07:53.921 [info] Handle Execution of Cells 6 for path/to/jupyter/notebook/data_cleanup.ipynb
12:07:53.931 [info] Kernel acknowledged execution of cell 6 @ 1707163673931
12:08:21.689 [info] End cell 6 execution after 27.758s, completed @ 1707163701689, started @ 1707163673931
12:19:06.354 [info] Start refreshing Interpreter Kernel Picker
12:19:06.354 [info] Start refreshing Kernel Picker (1707164346354)
12:19:10.275 [info] End refreshing Kernel Picker (1707164346354)


@amirhosseindavoody amirhosseindavoody added the bug Issue identified by VS Code Team member as probable bug label Feb 5, 2024
@lramos15 lramos15 removed the bug Issue identified by VS Code Team member as probable bug label Feb 5, 2024
@DonJayamanne
Copy link

Thanks for filing this issue and sorry you are running into this.
Please can you let me know whats wrong with the latest versions, given the latest version is where we fix bugs I'd like you to try the latest version and let me know how that goes.
(you will need to update your version of vscode as well).

@DonJayamanne DonJayamanne self-assigned this Feb 5, 2024
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster labels Feb 5, 2024
@amirhosseindavoody
Copy link
Author

This is the issue with the latest VScode version 1.86. It is incompatible with the version of linux we are running in our server. So, I had to revert back to 1.85.2.

Following up the VScode release the python extension also created another release that is incompatible with 1.85.2. So, I had to revert back that release as well.

As for the jupyter notebook extension, after checking I realized that the latest release is from 3 weeks ago, so I have updated the extension version to v2023.11.1100101639 but still getting the same error. I updated the bug discription to reflect the jupyter notebook extension version.

@DonJayamanne
Copy link

Now, none of the functionalities for jupyter notebook work.

Failed to get activated conda env vars for /path/to/python/environment/.pixi/envs/default/bin/python
in 3714ms

This seems to be due to an error from python extension not being able to activate your conda environment

Unfortunate lly I'll have to transfer this issue too the python extension brepo as the underlying issue is in that extension

before i do that I'd like to clarify what isn't working exactly
Are you trying to run code against you're local python env? If you're connecting to remote environments, you might want to try and remove the existing items and add them again

Based on the logs pylance isn't installed or might be disabled. Please can you check

@amirhosseindavoody
Copy link
Author

You are right. The problem was with the python extension not recognizing the correct environment.

The root cause was this:

  • I created a jupyter server using python in environment A but the python extension was pointing to the python in environment B which didn't have jupyter package. After installing the jupyter package in environment B everything started to work.

I don't think it is an issue with python or jupyter extensions. It is a bad setup on my part which I wasn't able to figure out.

The answers to your question:

  • I am ssh-ing into a remote server, but running everything locally on that server.
  • I am using Jedi as the language server. Pylance was constantly exiting due to the large size of my code base.

@DonJayamanne
Copy link

@amirhosseindavoody , to be clear, this is a regression, i.e. it used to work, but not anymore,
Thanks
@karrtikr /cc

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-jupyter Feb 6, 2024
@DonJayamanne DonJayamanne removed their assignment Feb 6, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 6, 2024
@brettcannon brettcannon removed the info-needed Issue requires more information from poster label Mar 13, 2024
@anthonykim1
Copy link

@amirhosseindavoody Are you still experiencing this?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 10, 2024
@anthonykim1
Copy link

@amirhosseindavoody Try adding "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"], to your settings.json if you are still experiencing this for activation problems, if that doesnt work please let me know so I can reopen the issue. Thanks.

@anthonykim1 anthonykim1 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
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 triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

7 participants