Open RossBencina opened 1 year ago
Relevant issue https://github.com/microsoft/vscode/issues/184194
Hopefully I am not hijacking this issue, but I often see "Restart" (kernel) grayed out on a fully working interactive console.
same problem
Hey @hzphzp, I found that the restart button reappears when you click a cell in the notebook.
same problem, does not ungray/reappear on clicking
@awf @hzphzp @kdgutier are you still running into this issyue?
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
this is still an issue
On my machine, the current workaround is to click on the code cell, then click on the output, then click on the code cell again. The restart button then appears. Hope that helps uncover the cause.
Any luck with this issue? This issue is plaguing my workflow way too frequently now...
I started to have a lot of weird things happening recently (No more "Restart button", cells hanging forever, ...). I found out that I was using the "pre-release" version of the extension. So, going into "Extensions" -> "Jupyter" and switching to release version seemed to solve my issues.
Edit : Ok, unfortunately the restart button still disappear...
Unfortunately, I'm facing this issue (of restart button disappearing) quite severely in both the release version and pre-release version!
Any update it is still an issue on VS Code version:
Version: 1.88.1 (Universal) Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:42:52.765Z (1 wk ago) Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.2.0
I'm having this same issue. I don't have a solution, but a decent work around is to assign a keyboard shortcut for the 'restart kernel' and the 'restart and run all' commands. Here are the steps to do so:
@romach6 I don't think your workaround would work when the Restart button is NOT visible in the Notebook - which is the root of this problem. I have this shortcut configured for ages, but I can only fire it from my keyboard when the Notebook shows the button. Or does it work for you irrespective of the button's visibility?
The workaround I use is to click on results and then back on code. That seems to make it reappear.
This obviously needs to be fixed. It should never disappear since reset is stateless.
@epicwhale When I experienced this issue, I could use the keyboard shortcut irrespective of the button's visibility.
If this is not working for you, another work-around is to put the magic command %reset -f
at the start of your notebook before any actual code. This command will remove all variables from memory, except for those that are defined by the user in the configuration file. The -f
parameter ensures that the command is executed without confirmation.
Despite the availability of work arounds, I agree that this issue should be addressed.
For the sake of further documenting this issue, here are my settings/versions:
Version: 1.89.0 (Universal) Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd Date: 2024-05-01T02:10:10.196Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.4.0
v2024.4.0
Python 3.10.7
Python Extension v2024.6.0
(not using Anaconda)
Locally
@DonJayamanne hey - just checking any luck with this one? I've now chanced upon quite a few folks on the internet and around me who face this issue... what would it take to get some traction within the team? anything more we can help in terms of debug reports?
Hey everyone, just want to update that I'll be looking into this as part of the next development cycle. If the repro is inconsistent or requires a more niche setup, I'll likely reach out towards the beginning of the new month. Thanks for the patience, will be addressing this soon.
It's June, and this is still an issue.
Eagerly waiting for this fix too!
@Yoyokrazy I can't emphasize enough how much this bug has plagued my productivity (and other folks I know) the past few months. I would be using VS Code so much more once this is fixed :) thanks in advance!
I have the same issue. Waiting for this fix!!!!
@epicwhale + other people with consistent repro's
I've looked into this a bit and can't seem to reproduce this reliably, I think there is likely a kernel related context key issue causing this. To control the visibility/enablement of the Restart
button in the notebook toolbar I've broken it down to be as follows:
simplified in plaintext (FOR GLOBAL TOOLBAR):
is workspace trusted
AND
is notebook type of jupyter (ipynb)
AND
kernel id contains `ms-toolsai.jupyter`
AND
kernel is able to restart
AND
kernel "is jupyter"
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
notes:
- `notebookKernel` is just the kernel id
- able to restart/canrestartNotebookkernel represents the following condition
- `kernel.status !== 'unknown' || executionService.executionCount > 0 || kernel.startedAtLeastOnce`
- kernel is jupyter/jupyter.kernel.isjupyter represents the following condition
- `document && isJupyterNotebook(document) && this.controllers.getSelected(document)`
Right now, my thought is that the bug lies at 🐛 kernel is able to restart
, so I think the best thing to do would be to collect some context keys and general logs from you the next time you see this. To do this, follow these steps:
@command:workbench.action.inspectContextKeys
and click somewhere within the cell container or editor (where you know the button will not reappear -- you stated earlier that clicking in the container/editor does not bring the button back)"notebookType"
"notebookKernel"
"jupyter.notebookeditor.canrestartNotebookkernel"
"jupyter.kernel.isjupyter"
Jupyter
output channel may also be helpful to attachFor those of you seeing the restart button greyed out in interactive windows, the same process will apply but you will look for: "jupyter.interactive.canRestartNotebookKernel"
In my case, it only happens when I have second monitor attached and using 2 windows of vscode. Maybe this would help about finding the bug
@Yoyokrazy thanks for investigating. So I stopped using VS Code two weeks ago due to this bug. So I'll try my best if I can get back to it to repro it in the coming days. But here are two things that should help repro this consistently:
what @sglbl mentioned above, using dual monitors + having a 2nd window of VS Code. Moreso, I think if you keep a jupyter notebook in the second window, the repro chance would be very high.
using devcontainers (the project I faced this every few mins on was using a vs code dev container) - I wonder if there's anything to do with that exacerbates this.
Have you tried (1) dual monitor ?
Let me know if you are still stuck with it, and I'll try to repro this weekend if you still are.
@epicwhale + @sglbl , thank you so much for that! The dual windows of vscode, with a notebook in each, repro'd right away.
The problem is indeed a context key bug, with two of the keys:
jupyter.kernel.isjupyter
is set false
jupyter.notebookeditor.canrestartNotebookkernel
does not exist...This gives me a good spot to dig into, will keep the issue up to date with findings.
@Yoyokrazy while you look closer at this one, could it be possible it's a very similar issue causing the 'Debug Cell' option to disappear arbitrarily too? there's dozens of users facing it here, including me: https://github.com/microsoft/vscode/issues/150219 - if so, you might be able to kill two birds with one! 🙏
Yep, taking a look at a handful of potential context issues atm, with that one on the list 👍 thanks for the shout!
So update on my end, the repro is highly inconsistent (though when it does appear, it is quite breaking as described). Been working in devcontainers + dual instances of VS Code so my theory is that there could be a race condition making this tricky to diagnose.
I've gone ahead and added logging statements in the PR linked above this, so the next time you see this, attaching logs (found in output view -> Jupyter) would be appreciated and will help diagnose the issue. Thanks!
@Yoyokrazy sure, if you can let me know when your PR makes it into the extension update (for Insider edition), I can keep it on and collect a log when it happens.
Is this all I have to set to debug to turn it on?
@epicwhale, I went ahead and built a vsix that you can install locally, trying to avoid flooding standard jupyter users with logging. Otherwise, yep that is all you would need to do, logs would appear in the standard output channel that you've attached from before.
(this is just an artifact built from this PR: vscode-jupyter#15916) ms-toolsai-jupyter-insiders.vsix.zip
@Yoyokrazy Oddly I am not able to install this vsix file.. it does not appear in the install from vsix file picker even though I have unzipped it? do you have a better set of instructions to use your artifact? (on Mac here)
vsix file not appearing
even though it's clearly unzipped in my downloads folder?
Sorry bout the delay, I'll whip up a new vsix in the evening and test it against my personal machine and see if I can get you a better set of steps. Not immediately sure why that vsix wouldn't work, but perhaps I can get you a platform specific vsix rather than a universal. 🏃
Applies To
What happened?
Often, the "Restart" button is not visible in the toolbar. For example, right now I see:
It was there 10 minutes ago:
It seems to disappear after restarting the kernel. I can't predict when it reappears.
VS Code Version
1.78.0 (user setup)
Jupyter Extension Version
v2023.4.1011241018
Jupyter logs
No response
Coding Language and Runtime Version
Python 3.10.7
Language Extension Version (if applicable)
Python Extension v2023.8.0
Anaconda Version (if applicable)
(not using Anaconda)
Running Jupyter locally or remotely?
None