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

Console attempts to reconnect and 404s when connecting to an existing project after 1.95 merge #5750

Closed
jthomasmock opened this issue Dec 16, 2024 · 7 comments
Labels
area: console Issues related to Console category. area: core Issues related to Core category. area: kernels Issues related to Jupyter kernels and LSP servers bug Something isn't working

Comments

@jthomasmock
Copy link
Contributor

System details:

Positron and OS details:

Positron Version: 2025.01.0 (Universal) build 87
Code - OSS Version: 1.95.0
Commit: 240e51f
Date: 2024-12-16T02:50:00.442Z
Electron: 32.2.1
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.1.0

Interpreter details:

R 4.4 or Python 3.12.0 .venv

Describe the issue:

Opening a new window for an existing projects leads to consoles 404 error and stuck in a "Reconnecting" state. Shutting down the runtime and then restarting seems to get it out of this state.

Steps to reproduce the issue:

  1. Open a new instance of Positron
  2. Launch an existing project in a new Window
  3. Observe the 404 failures in the console
Screen.Cast.2024-12-16.at.10.28.45.AM.mp4

Expected or desired behavior:

Console successfully starts on first launch and not display a 404 error to user.

Were there any error messages in the UI, Output panel, or Developer Tools console?

Kallichore seems to be looking for an existing process:

2024-12-16 10:24:15.326 [info] Positron Kernel Supervisor activated
2024-12-16 10:24:15.326 [info] Kallichore server PID 42356 is not running
2024-12-16 10:24:15.326 [info] Could not reconnect to Kallichore server at http://localhost:47616. Starting a new server
2024-12-16 10:24:15.326 [info] Starting Kallichore server /Applications/Positron.app/Contents/Resources/app/extensions/positron-supervisor/resources/kallichore/kcserver on port 54134
2024-12-16 10:24:15.326 [info] Waiting for Kallichore server to start (attempt 1, 164ms)
Kallichore 0.1.22 server online with 0 sessions
Kallichore server started in 292ms
Streaming Kallichore server logs from /var/folders/dr/jx6dh4ss7cqc111rf64bxqw40000gn/T/kallichore-66b7a860.log (log level: debug)
16:24:15 [INFO] Starting Kallichore server at 127.0.0.1:54134
Failed to reconnect to session r-dbc936d0: HTTP 404. 
Failed to reconnect to session python-138d6fe1: HTTP 404. 
16:24:15 [INFO] get_session("r-dbc936d0") - X-Span-ID: "123ad90b-379a-454d-b331-2e9d6da8d99a"
16:24:15 [INFO] get_session("python-138d6fe1") - X-Span-ID: "42ad6333-6d1b-4554-bba2-fc3315fd3e46"
@nstrayer nstrayer added area: console Issues related to Console category. area: core Issues related to Core category. area: kernels Issues related to Jupyter kernels and LSP servers labels Dec 16, 2024
@juliasilge juliasilge added the bug Something isn't working label Dec 16, 2024
@juliasilge juliasilge added this to the 2025.01.0 Pre-Release milestone Dec 16, 2024
@jmcphers
Copy link
Collaborator

@jthomasmock I have not been able to reproduce this and the video doesn't show how you got into this state. Can you elaborate on this step?

Launch an existing project in a new Window

What UI gesture did you use to do this?

Does it happen for all projects?

@juliasilge

This comment has been minimized.

@juliasilge
Copy link
Contributor

I can reproduce the problem Tom describes with this UI from the top bar workspace switcher:

Image

@juliasilge
Copy link
Contributor

I see this also in:

Positron Version: 2025.01.0 (Universal) build 71
Code - OSS Version: 1.93.0
Commit: bb6af97
Date: 2024-12-12T02:49:20.848Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.1.0

So maybe not related to the merge after all?

@jthomasmock
Copy link
Contributor Author

Sorry @jmcphers -- yes, as Julia shared. Trying to open a project in existing window will lead to #5749 while opening a project in New Window with the workflow Julia described is what I initially ran into.

Interestingly, I am now not able to reproduce this on:

Positron Version: 2025.01.0 (Universal) build 87
Code - OSS Version: 1.95.0
Commit: 240e51f
Date: 2024-12-16T02:50:00.442Z
Electron: 32.2.1
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.1.0

@jmcphers
Copy link
Collaborator

I found a reliable repro! Notes in #5817.

jmcphers added a commit that referenced this issue Dec 18, 2024
Addresses #5750.

The underlying issue is somewhat complicated. Basically:

- The list of running sessions is stored in ephemeral storage, scoped to
the workspace.
- Ephemeral storage is shared among all active windows.
- We rely on the fact that ephemeral storage goes away when the app
quits in order to prevent reconnection to old sessions.
- It is possible however in multi-window scenarios to close and reopen a
window in a workspace *without ever quitting Positron itself*. In this
scenario, we can try to reconnect to non-existent sessions.

The fix is to manually clear out the sessions from ephemeral storage on
close/quit.

This is not related to the 1.95 merge.

### QA Notes

This does not reproduce reliably with the steps in #5750. Here are steps
that will cause it to reproduce every time in builds prior to this
change.

1. Open a workspace (Workspace 1).
2. Using the Open in New Window gesture on the Project drop down in the
upper right, open a different workspace (Workspace 2) in a new window.
3. Start Python and/or R in Workspace 2 and run a few commands.
4. Close Workspace 2, but leave the Workspace 1 window open.
5. In Workspace 1, once again use Open in New Window to open Workspace
2.

In Step 5, you will see the window attempt to connect to the sessions
that you started in Step 3, but get HTTP 404 since those sessions are
not running any more.

Also note that the purpose of this machinery is to reconnect to sessions
on reload/re-navigate, so double check that that still works.
@testlabauto
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2025.01.0-124
OS Version          : OSX

Test scenario(s)

Verified with Jonathan's instructions on #5817

Link(s) to TestRail test cases run or created:

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: console Issues related to Console category. area: core Issues related to Core category. area: kernels Issues related to Jupyter kernels and LSP servers bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants