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

Cannot connect to existing Jupyter Server: "... Server with this URL already exists" #13637

Closed
1 of 2 tasks
Tracked by #12832
mmbannert opened this issue Jun 2, 2023 · 3 comments
Closed
1 of 2 tasks
Tracked by #12832
Assignees
Labels
debt Code quality issues
Milestone

Comments

@mmbannert
Copy link

Applies To

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

What happened?

I would like to choose an existing Jupyter Server to run my notebooks in VSCode. This used to be possible in the way that is described here. The "Specify Jupyter Server for Connections" option is now deprecated, however. The recommended procedure is to hit "Select Kernel" in the top right corner and to choose "Existing Jupyter Server" from the dropdown menu. Once that's done, I pick "Enter the URL of the running Jupyter server" and enter the URL of the running server. After hitting enter, VSCode does not connect me with that server and instead complains that "A Jupyter Server with this URL already exists".

This message is very puzzling because the whole point of this procedure was exactly that: to connect me to an existing jupyter server. I suspect that this is very likely a bug because VSCode indeed finds my running server but does not establish the connection although this is the now recommended way of connecting to running jupyter servers.

So, how then can I establish the connection to the Jupyter Server?

Further background: The Jupyter Server is running inside a container on a remote machine. I am connecting to that remote machine and attach VSCode to the running container. The first time when I connect to the container, VSCode prompts for the password of my Jupyter Server. According to the logs, this password is invalid. I copy-pasted it and it therefore must be correct. I verified that I can connect to the server in the browser using that very same token. So is it possible that VSCode may not process my password correctly?

Cheers,
Michael

VS Code Version

Version: 1.78.2 (Universal) Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435 Date: 2023-05-10T14:44:45.204Z Electron: 22.5.2 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin arm64 21.6.0 Sandboxed: Yes

Jupyter Extension Version

v2023.4.1011241018

Jupyter logs

Visual Studio Code (1.78.2, attached-container, desktop)
Jupyter Extension Version: 2023.4.1011241018.
Python Extension Version: 2023.8.0.
Platform: linux (x64).
Workspace folder ~/experiments/TrueScenometry/code, Home = /home/USERNAME
10:05:54.909 [info] Start refreshing Kernel Picker (1685693154909)
10:05:54.934 [info] Using Pylance
10:05:55.092 [info] Connecting remote server kernel http://0.0.0.0:8888/
10:05:55.092 [info] Connecting remote server kernel http://0.0.0.0:8888/
10:05:55.095 [info] Connecting remote server kernel http://localhost:8888/
10:05:55.621 [warn] Password for http://0.0.0.0:8888/ was invalid.
10:05:55.681 [error] Error fetching kernels from http://0.0.0.0:8888/ (0.0.0.0, jupyter): [t [Error]: Forbidden
	at Function.create (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:68133)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Object.t.listRunning (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:55998)
	at async jf.getRunningKernels (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:177115)
	at async Promise.all (index 0)
	at async Bf.listKernelsFromConnection (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:188567)
	at async ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:186840] {
  response: L [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://0.0.0.0:8888/api/kernels?1685693155648',
      status: 403,
      statusText: 'Forbidden',
      headers: [T [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
10:05:55.687 [error] Error fetching kernels from http://0.0.0.0:8888/ (0.0.0.0, jupyter): [t [Error]: Forbidden
	at Function.create (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:68133)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Object.t.listRunning (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:55998)
	at async jf.getRunningKernels (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:177115)
	at async Promise.all (index 0)
	at async Bf.listKernelsFromConnection (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:188567)
	at async ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:186840] {
  response: L [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://0.0.0.0:8888/api/kernels?1685693155650',
      status: 403,
      statusText: 'Forbidden',
      headers: [T [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
10:05:55.692 [error] UniversalRemoteKernelFinder: Failed to get kernels without cache [t [Error]: Forbidden
	at Function.create (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:68133)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Object.t.listRunning (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:55998)
	at async jf.getRunningKernels (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:177115)
	at async Promise.all (index 0)
	at async Bf.listKernelsFromConnection (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:188567)
	at async ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:186840] {
  response: L [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://0.0.0.0:8888/api/kernels?1685693155648',
      status: 403,
      statusText: 'Forbidden',
      headers: [T [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
10:05:55.692 [error] SessionManager:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
	at e.dispose (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:171555)
	at u.dispose (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:62984)
	at jf.dispose (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:176229)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Bf.listKernelsFromConnection (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:189405)
	at async ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:186840]
10:05:55.693 [error] UniversalRemoteKernelFinder: Failed to get kernels without cache [t [Error]: Forbidden
	at Function.create (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:68133)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Object.t.listRunning (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:55998)
	at async jf.getRunningKernels (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:177115)
	at async Promise.all (index 0)
	at async Bf.listKernelsFromConnection (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:188567)
	at async ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:186840] {
  response: L [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://0.0.0.0:8888/api/kernels?1685693155650',
      status: 403,
      statusText: 'Forbidden',
      headers: [T [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
10:05:55.694 [error] SessionManager:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
	at e.dispose (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:171555)
	at u.dispose (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:2:62984)
	at jf.dispose (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:176229)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Bf.listKernelsFromConnection (~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:189405)
	at async ~/.vscode-server/extensions/ms-toolsai.jupyter-2023.4.1011241018-linux-x64/out/extension.node.js:17:186840]
10:05:55.879 [warn] Failed to get activated env vars for /usr/bin/python3 in 404ms
10:05:55.902 [info] Process Execution: /usr/bin/python3 -c "import site;print("USER_BASE_VALUE");print(site.USER_BASE);print("USER_BASE_VALUE");"
10:05:55.947 [info] Process Execution: /usr/bin/python3 -m pip list
10:05:56.010 [info] Process Execution: /usr/bin/python3 -c "import pip;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
10:06:08.496 [warn] Password for http://localhost:8888/ was invalid.
10:06:09.686 [info] End refreshing Kernel Picker (1685693154909)

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

@mmbannert mmbannert added the bug Issue identified by VS Code Team member as probable bug label Jun 2, 2023
@DonJayamanne DonJayamanne assigned DonJayamanne and unassigned amunger Jun 2, 2023
@DonJayamanne
Copy link
Contributor

Thank you for filing this issue, I believe I know whats going on here and will try to get this fixed for the next iteration.

@DonJayamanne
Copy link
Contributor

@mmbannert this should be fixed in the current release.
Leaving this issue open to resolve some debt.

@DonJayamanne DonJayamanne added debt Code quality issues and removed bug Issue identified by VS Code Team member as probable bug labels Jun 15, 2023
@DonJayamanne
Copy link
Contributor

This has been fixed in the latest main branch (hence in the pre-release version)
Fixed here #13725

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues
Projects
None yet
Development

No branches or pull requests

3 participants