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

State not persisted on close and reopen notebook #9826

Closed
JacksonKearl opened this issue Apr 28, 2022 · 7 comments · Fixed by #9866
Closed

State not persisted on close and reopen notebook #9826

JacksonKearl opened this issue Apr 28, 2022 · 7 comments · Fixed by #9866
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@JacksonKearl
Copy link
Contributor

Testing #9768

Worked well until the last step, where I defined a in a cell, closed the notebook, reopened it, then tried to print a and got a NameError

Recording 2022-04-28 at 15 09 08

@JacksonKearl
Copy link
Contributor Author

info 15:8:17.545: Execute Cell 0 /booper/mynotebook.ipynb
info 15:8:17.570: Updating preferred kernel for remote notebook 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:17.570: Storing Preferred remote kernel for /booper/mynotebook.ipynb is 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:17.575: Updating preferred kernel for remote notebook 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:17.575: Storing Preferred remote kernel for /booper/mynotebook.ipynb is 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:17.577: Cell 0 executed with state Success
info 15:8:22.218: Disposing kernel http://127.0.0.1:8888/..python3./usr/local/opt/python@3.9/bin/python3.9./.-m#ipykernel_launcher for notebook /booper/mynotebook.ipynb due to selection of another kernel or closing of the notebook
info 15:8:22.218: Dispose kernel file:///booper/mynotebook.ipynb
info 15:8:22.218: Cancel pending cells
info 15:8:24.219: Creating server with url : http://127.0.0.1:8888/
info 15:8:24.221: Creating server with url : http://127.0.0.1:8888/
error 15:8:24.604: Unable to select kernel as the Notebook document could not be identified
info 15:8:24.605: Creating server with url : http://127.0.0.1:8888/
info 15:8:24.606: Preferred Remote kernel for /booper/mynotebook.ipynb is 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:24.606: Find preferred kernel for /booper/mynotebook.ipynb with metadata {"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.1"},"orig_nbformat":4} & preferred interpreter 
info 15:8:24.606: Preferred Remote kernel for /booper/mynotebook.ipynb is 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:24.606: Preferred kernel 508599fe-dd73-495c-9bb7-5058c3c81e86 is exact match
info 15:8:24.607: PreferredConnection: 508599fe-dd73-495c-9bb7-5058c3c81e86 found for NotebookDocument: /booper/mynotebook.ipynb
info 15:8:24.607: TargetController found ID: 508599fe-dd73-495c-9bb7-5058c3c81e86 for document /booper/mynotebook.ipynb
info 15:8:24.607: Creating server with url : http://127.0.0.1:8888/
info 15:8:24.752: Preferred Remote kernel for /booper/mynotebook.ipynb is 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:24.752: Find preferred kernel for /booper/mynotebook.ipynb with metadata {"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.1"},"orig_nbformat":4} & preferred interpreter 
info 15:8:24.753: Preferred Remote kernel for /booper/mynotebook.ipynb is 508599fe-dd73-495c-9bb7-5058c3c81e86
info 15:8:24.753: Preferred kernel 508599fe-dd73-495c-9bb7-5058c3c81e86 is exact match
info 15:8:27.547: Execute Cell 1 /booper/mynotebook.ipynb
info 15:8:27.547: Starting Notebook id = http://127.0.0.1:8888/..python3./usr/local/opt/python@3.9/bin/python3.9./.-m#ipykernel_launcher for /booper/mynotebook.ipynb (disableUI=false)
http://127.0.0.1:8888/: Kernel started: b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:27.626: Waiting for idle on (kernel): b363d10d-28d2-4584-8d36-a499b46dab47 -> unknown
info 15:8:28.335: Finished waiting for idle on (kernel): b363d10d-28d2-4584-8d36-a499b46dab47 -> idle
info 15:8:28.335: Started session for kernel http://127.0.0.1:8888/..python3./usr/local/opt/python@3.9/bin/python3.9./.-m#ipykernel_launcher
info 15:8:28.335: Finished connecting kernel http://127.0.0.1:8888/..python3./usr/local/opt/python@3.9/bin/python3.9./.-m#ipykernel_launcher
http://127.0.0.1:8888/: Creating new notebook 
info 15:8:28.336: Executing silently Code (idle) = __vsc_ipynb_file__ = "/booper/mynotebook.ipynb"\n%config Completer.use_jedi = False
info 15:8:28.354: Executing silently Code (completed) = __vsc_ipynb_file__ = "/booper/mynotebook.ipynb"\n%config Completer.use_jedi = False
info 15:8:28.355: Waiting for idle on (kernel): b363d10d-28d2-4584-8d36-a499b46dab47 -> idle
info 15:8:28.355: Finished waiting for idle on (kernel): b363d10d-28d2-4584-8d36-a499b46dab47 -> idle
info 15:8:28.356: Updating preferred kernel for remote notebook b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:28.356: Storing Preferred remote kernel for /booper/mynotebook.ipynb is b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:28.356: Creating server with url : http://127.0.0.1:8888/
info 15:8:28.359: Creating server with url : http://127.0.0.1:8888/
info 15:8:28.390: Updating preferred kernel for remote notebook b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:28.390: Storing Preferred remote kernel for /booper/mynotebook.ipynb is b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:28.481: Updating preferred kernel for remote notebook b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:28.481: Storing Preferred remote kernel for /booper/mynotebook.ipynb is b363d10d-28d2-4584-8d36-a499b46dab47
info 15:8:28.482: Cancel all remaining cells true || Error || undefined
info 15:8:28.482: Cancel pending cells
info 15:8:28.482: Cell 1 executed with state Error

@JacksonKearl
Copy link
Contributor Author

Looks like each file open started a new kernel?

➜  ~ jupyter-notebook --no-browser --NotebookApp.allow_origin="*"
[I 15:03:52.742 NotebookApp] Serving notebooks from local directory: /Users/jkearl
[I 15:03:52.742 NotebookApp] Jupyter Notebook 6.4.11 is running at:
[I 15:03:52.742 NotebookApp] http://localhost:8888/?token=09f7f345ab65b03cfda03f38721bfccb70bef1587fda886c
[I 15:03:52.742 NotebookApp]  or http://127.0.0.1:8888/?token=09f7f345ab65b03cfda03f38721bfccb70bef1587fda886c
[I 15:03:52.742 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:03:52.747 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///Users/jkearl/Library/Jupyter/runtime/nbserver-51904-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=09f7f345ab65b03cfda03f38721bfccb70bef1587fda886c
     or http://127.0.0.1:8888/?token=09f7f345ab65b03cfda03f38721bfccb70bef1587fda886c
[I 15:04:50.479 NotebookApp] Creating new notebook in 
[I 15:04:50.666 NotebookApp] Kernel started: 03d349a6-e428-48b5-9ca1-3f7e36296e81, name: python3
[W 15:04:50.689 NotebookApp] delete /mynotebook-jvsc-986c68fa-8e91-4f6b-8ccd-9774b543d224.ipynb
[I 15:06:02.858 NotebookApp] Starting buffering for 03d349a6-e428-48b5-9ca1-3f7e36296e81:88316e9a-09e6-4ab4-ad79-eef9886f4989
[I 15:06:22.762 NotebookApp] Creating new notebook in 
[I 15:06:22.823 NotebookApp] Kernel started: 1437b57e-cec2-432d-811c-8a1a2145573e, name: python3
[W 15:06:22.847 NotebookApp] delete /mynotebook-jvsc-46385f40-4b33-4b5c-8def-84f03031c98f.ipynb
[I 15:07:09.714 NotebookApp] Starting buffering for 1437b57e-cec2-432d-811c-8a1a2145573e:a236e6e2-6be5-44ad-bd67-c5f0dbe5fdb3
[I 15:07:23.898 NotebookApp] Creating new notebook in 
[I 15:07:23.959 NotebookApp] Kernel started: 6ea4a7a2-4334-4aed-bf7e-f1bcd0123944, name: python3
[W 15:07:23.980 NotebookApp] delete /mynotebook-jvsc-02685189-79ee-4373-b200-a1130278ba89.ipynb
[I 15:07:36.703 NotebookApp] Starting buffering for 6ea4a7a2-4334-4aed-bf7e-f1bcd0123944:b1339662-b173-4200-9554-e728c684374b
[I 15:07:41.662 NotebookApp] Creating new notebook in 
[I 15:07:41.735 NotebookApp] Kernel started: 508599fe-dd73-495c-9bb7-5058c3c81e86, name: python3
[W 15:07:41.756 NotebookApp] delete /mynotebook-jvsc-d9d0b6c8-714e-4e07-8402-a0b266ff4c42.ipynb
[I 15:08:22.219 NotebookApp] Starting buffering for 508599fe-dd73-495c-9bb7-5058c3c81e86:92eb9bd9-c5c5-4dd6-ac75-7ab95e824040
[I 15:08:27.554 NotebookApp] Creating new notebook in 
[I 15:08:27.613 NotebookApp] Kernel started: b363d10d-28d2-4584-8d36-a499b46dab47, name: python3
[W 15:08:27.635 NotebookApp] delete /mynotebook-jvsc-3b8dbfa2-fe74-4f1f-b525-576b5bb0e062.ipynb
^C[I 15:12:07.139 NotebookApp] interrupted
Serving notebooks from local directory: /Users/jkearl
5 active kernels
Jupyter Notebook 6.4.11 is running at:
http://localhost:8888/?token=09f7f345ab65b03cfda03f38721bfccb70bef1587fda886c
 or http://127.0.0.1:8888/?token=09f7f345ab65b03cfda03f38721bfccb70bef1587fda886c
Shutdown this notebook server (y/[n])? y
[C 15:12:08.382 NotebookApp] Shutdown confir

@rchiodo
Copy link
Contributor

rchiodo commented Apr 28, 2022

@JacksonKearl what's your version of the jupyter extension? I should have just fixed this error.

@JacksonKearl
Copy link
Contributor Author

v2022.4.1001202127

@rchiodo
Copy link
Contributor

rchiodo commented Apr 28, 2022

Can you try with the previous one?

@rchiodo
Copy link
Contributor

rchiodo commented Apr 28, 2022

Oh actually I can repro with both. Thanks for the issue. Looks like this feature is only working in desktop.

@rchiodo
Copy link
Contributor

rchiodo commented Apr 28, 2022

Not sure why, same code runs in desktop. Debugging it I can't repro, but with insiders.vscode.dev I can.

@greazer greazer added bug Issue identified by VS Code Team member as probable bug and removed needs-triage labels May 2, 2022
@greazer greazer added this to the May 2022 milestone May 2, 2022
@rebornix rebornix added the verified Verification succeeded label Jun 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants