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

Is the kernel error being reported correct (i.e. the most useful?) #8060

Closed
greazer opened this issue Oct 26, 2021 · 5 comments
Closed

Is the kernel error being reported correct (i.e. the most useful?) #8060

greazer opened this issue Oct 26, 2021 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) verified Verification succeeded
Milestone

Comments

@greazer
Copy link
Member

greazer commented Oct 26, 2021

See the following image. The kernel (interpreter) I selected apparently is missing access to win32api.dll somehow. Yet the error reported is a much more nebulous and late-to-the-party type message: "Cannot execute code, session has been exposed".

I think we have code to try and display to the user a better error message when a kernel can't be started, but are we getting the right one?

image

@greazer greazer added the bug Issue identified by VS Code Team member as probable bug label Oct 26, 2021
@DonJayamanne
Copy link
Contributor

session has been disposed is a bogus error (its just an erro from us indicating that something is wrong and we don't know what).
Basically we know why things fell over, this is basically debt that needs to be cleaned up.

I have some work (pending PRs branches from a week or so ago) that'll address this. waiting for debt week to fix them. Hence assigning to myself.

@DonJayamanne DonJayamanne self-assigned this Oct 26, 2021
@DonJayamanne
Copy link
Contributor

elected apparently is missing access to win32api.dll somehow. Yet the error reported is a much more nebulous and late-to-the-party type message: "Cannot execute code, session has be

FYI @greazer we have some other suggestions on what we can do with these errors (tracked here #7902 & #7846 (comment)).

TLDR: We found that re-installing ipykernel, pyzmq and a few other packages resolves the kernel startup.
& the plan was to implement changes so that we'd re-install them for the user to try & get the kernel working.

@DonJayamanne DonJayamanne added the notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) label Oct 26, 2021
@greazer greazer added this to the November 2021 milestone Oct 26, 2021
@DonJayamanne
Copy link
Contributor

I think notifying the user immediately that the kernel died instead of displaying an error message would be better (much like what Jupyter does).
Suggestions here #7399

@DonJayamanne
Copy link
Contributor

@greazer I think #7399 is relvant.
I think what should ideally happen is:

  • When kernel dies, automatically restart the kernel
  • Do not log errors like session disposed with a long stack trace... etc

FYI - When using remote jupyter or local kernels where raw kernels don't work, kernels automatically restart. I.e. this error is only visible when using raw kernels in local scenraios.

@DonJayamanne
Copy link
Contributor

Testing:

  • Create a notebook with at least 3 cells (1 & 3 containing print statements)
    • Second cell should have the following code
import IPython
app = IPython.Application.instance()
app.kernel.do_shutdown(True)
* An error message should also be displayed indicating the kernel died (bottom right)
* Try to run another cell or the same cell in the notebook
* You should be presented with a modal message indicating the kernel is dead with the option to restart the kernel
  • Create a notebook with the following code:
import os
os.getpid()
* Using this PID kill this process from the task manager or terminal
* An error message should also be displayed indicating the kernel died (bottom right)
* Try to run another cell or the same cell in the notebook
* You should be presented with a modal message indicating the kernel is dead with the option to restart the kernel

@rchiodo rchiodo added the verified Verification succeeded label Dec 1, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 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 notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants