Skip to content

Deleting jupyter session displays error message related to websocket connection #16745

Open
@vambavaram

Description

@vambavaram

Environment data

  • VS Code version: 1.101.1
  • Jupyter Extension version (available under the Extensions sidebar): 2025.3.0
  • Python Extension version (available under the Extensions sidebar): 2025.8.0
  • OS (Windows | Mac | Linux distro) and version: Windows
  • Python and/or Anaconda version:
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Jupyter server running: Remote

Expected behaviour

  1. Delete jupyter session (kernel also gets deleted)
  2. websocket connection is disposed
  3. run a cell
  4. new session, kernel connection, websocket connection created

Actual behaviour

Jupyter session is deleted and kernel disposed. An error notification pops up in the extension. Internally there is a 404 thrown since the corresponding websocket connection is not found. We want to prevent this error from happening.

Steps to reproduce:

  1. api call: DELETE api/sessions/{sessionId} to delete the session.
  2. error thrown

Screenshot of error

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.101.1, undefined, desktop)
Jupyter Extension Version: 2025.3.0.
Python Extension Version: 2025.8.0.
Pylance Extension Version: 2025.6.1.
Platform: win32 (x64).
Home = c:\Users\vambavaram
Temp Storage folder ~\AppData\Roaming\Code\User\globalStorage\ms-toolsai.jupyter\version-2025.3.0
No workspace folder opened.
03:13:25.794 [info] Starting Kernel (MSGLarge (16 vcores/112g - 4 executors) [Untitled-2]) for 'Untitled-2.ipynb' (disableUI=false)
03:14:00.109 [info] https://australiaeast.api.securityplatform.microsoft.com/spark-notebook/interactive: Kernel started: 281b8d17-31ec-4986-b7c9-27567f0f9621
03:14:04.118 [info] Started session for kernel startUsingRemoteKernelSpec:fe3300f06ef1434ddaf691a6f2fe23a183fa5250dc37e17924513b102712d0f8..MSGLarge.python3.\.-m#synapsekernel.synapse_pyspark
03:14:04.137 [warn] Unhandled message found: kernel_info_reply
03:14:04.139 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:14:04.196 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:14:04.199 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:14:04.449 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:14:04.451 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:18:38.690 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:22.560 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:22.718 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:54.905 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:55.193 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:55.201 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:55.455 [info] Kernel successfully started
03:19:55.466 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:55.580 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:19:55.903 [error] Widget Error: Failed to access CDN https://unpkg.com/ after 0 attempt(s), TypeError: Failed to fetch
03:19:56.312 [error] Exception while handling messages: TypeError: Cannot read properties of null (reading 'msg_type')
03:21:34.189 [error] Exception while handling messages: SyntaxError: Unexpected end of JSON input
03:21:34.916 [error] Error in websocket: (404) Not Found, undefined, Headers = {"date":"Wed, 25 Jun 2025 10:21:34 GMT","transfer-encoding":"chunked","connection":"keep-alive","access-control-allow-origin":"*","access-control-expose-headers":"Azure-AsyncOperation,Operation-Location,x-ms-request-id,ETag","strict-transport-security":"max-age=31536000; includeSubDomains","x-ms-correlation-request-id":"98994851-787f-4b23-a93c-55469d25e672","x-azure-ref":"20250625T102134Z-177796b878bdxb8ghC1YVR4bag00000012ag000000003qrn","x-cache":"CONFIG_NOCACHE"}
03:21:34.917 [error] Error in websocket Error: Unexpected server response: 404
    at ClientRequest.<anonymous> (c:\Users\~\vscode-trident-fork\extensions\desktop\dist\extension\extension.js:904:7)
    at ClientRequest.emit (node:events:530:35)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:716:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
    at TLSSocket.socketOnData (node:_http_client:558:22)
    at TLSSocket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at TLSSocket.Readable.push (node:internal/streams/readable:392:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:189:23)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)
03:21:34.922 [info] Dispose Kernel 'Untitled-2.ipynb' associated with 'Untitled-2.ipynb'

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions