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

Unable to open Notebooks in Insiders #5804

Closed
sztal opened this issue May 7, 2021 · 28 comments
Closed

Unable to open Notebooks in Insiders #5804

sztal opened this issue May 7, 2021 · 28 comments
Assignees

Comments

@sztal
Copy link

sztal commented May 7, 2021

Issue Type: Bug

It seems that the last update crashed Jupyter notebook extension.

It cannot find jupyter.opennotebook function/object presumably need for opening .ipynb files in the Notebook Editor. Moreover, there seems to be some even deeper problem going in the core of the extension which probably cannot load some sort of a configuration file (or so it seems according to the console log in Developer Tools. Below I paste the javascript erorr trace generated in my particular case and raised at workbench.desktop.main.js:62:

[Extension Host] extension activation failed TypeError: o.getConfiguration(...).get(...).find is not a function
    at new m (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:683169)
    at Object.t.resolveInstance (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:263270)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:262475
    at Object.t.resolve (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:262738)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:253835
    at e._get (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:253601)
    at e.get (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:252313)
    at a.get (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:90:509426)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:245341
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:37:825686
    at t.activate (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:37:825373)
    at async Promise.all (index 0)
    at async Promise.all (index 88)
    at async Promise.all (index 1) (at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:37:826205)

Extension version: 2021.6.819764235
VS Code version: Code - Insiders 1.57.0-insider (6bee0f2f3fea9df1ad45344f09b2a139c93b384f, 2021-05-07T08:17:31.522Z)
OS version: Linux x64 5.11.0-7614-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz (8 x 800)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 0, 0, 1
Memory (System) 15.52GB (6.13GB free)
Process Argv --unity-launch --crash-reporter-id ea2cc0b8-cf43-49b3-a0ce-43755c989cd5
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
@DonJayamanne
Copy link
Contributor

Thanks for filling this issue, I'll look into this asap.

@DonJayamanne DonJayamanne changed the title jupyter.opennotebook not found Unable to open Notebooks in Insiders May 7, 2021
@DonJayamanne
Copy link
Contributor

Hmm, looks like theres a bug in VS Code microsoft/vscode#123307

@DonJayamanne
Copy link
Contributor

Yup, i too can replicate this.

@joyceerhl
Copy link
Contributor

This should be fixed in the latest VS Code Insiders build:

Version: 1.57.0-insider (user setup)
Commit: a19565da7dfc739fa26e36aae96113e19fe3806f
Date: 2021-05-07T17:19:03.737Z

@sztal could you please update VS Code Insiders and let us know if the issue persists? Thanks and sorry for the trouble!

@sztal
Copy link
Author

sztal commented May 7, 2021

Hi, many thanks for such a quick reaction! However, it seems the problem still persists.

I updated VS Code correctly, I think (below is the version info I get after updating):

code-insiders --version
# OUTPUT
# 1.57.0-insider
# a19565da7dfc739fa26e36aae96113e19fe3806f
# x64

The errors I see in Developer Tools seems to be identical. And crucially, when I inspect settings I still see that:

"workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],

is marked with a warning Incorrect type. Expected "object" and from what I could understand from the above discussions in the issue tickets the problem was related to some incompatibilities in how this config item is represented, right? So unfortunately it seems the problem is not solved yet.

@Hanuphant
Copy link

The same issue is affecting me too.

@joyceerhl
Copy link
Contributor

@sztal To be clear, you cannot open notebooks even after upgrading?

The warning is benign. TLDR VS Code has changed the layout for this setting, but internally they are supposed to still recognize the old format (though we are likely going to upgrade to the new layout, see #5806). There was a bug that caused their backward compatibility code to fail which we're told has since been fixed. But if you can't open notebooks at all then the problem is somewhere else.

@joyceerhl
Copy link
Contributor

@Hanuphant, are you on the latest VS Code Insiders? There was an update that shipped 3 hours ago which should have resolved this.

@Hanuphant
Copy link

@Hanuphant, are you on the latest VS Code Insiders? There was an update that shipped 3 hours ago which should have resolved this.

Yes, it is still not working. Updated 10 mins ago.

@sztal
Copy link
Author

sztal commented May 7, 2021

@joyceerhl , yes, I still cannot open any notebook. In some cases they are opened as plain text .json files and in some cases VS Code just hangs while trying to open them. And also, all the errors I mentioned earlier are still there in the DevTools Console. In particular, there is this one which looks probably most worrying (raised at workbench.desktop.main.js:62):

extension activation failed TypeError: o.getConfiguration(...).get(...).find is not a function
    at new m (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:683169)
    at Object.t.resolveInstance (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:263270)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:262475
    at Object.t.resolve (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:262738)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:253835
    at e._get (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:253601)
    at e.get (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:252313)
    at a.get (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:90:509426)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:52:245341
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:37:825686
    at t.activate (/home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:37:825373)
    at async Promise.all (index 0)
    at async Promise.all (index 88)
    at async Promise.all (index 1) (at /home/sztal/.vscode-insiders/extensions/ms-toolsai.jupyter-2021.6.819764235/out/client/extension.js:37:826205)
S @ workbench.desktop.main.js:sourcemap:62

@Hanuphant
Copy link

Currently, from the dev view there are 4 errors and 3 warnings shown now. The update did fix a 5th one which appeared earlier in the day.


workbench.desktop.main.js:1799
Unable to instantiate workbench contribution f. TypeError: Cannot read property 'windowsExec' of undefined at f._refreshOpenInTerminalMenuItemTitle (workbench.desktop.main.js:1973) at new f (workbench.desktop.main.js:1973) at g._createInstance (workbench.desktop.main.js:625) at g.createInstance (workbench.desktop.main.js:625) at S.safeCreateInstance (workbench.desktop.main.js:1799) at S.doInstantiateByPhase (workbench.desktop.main.js:1799) at workbench.desktop.main.js:1799
  safeCreateInstance @ workbench.desktop.main.js:1799


(node:17900) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use Code - Insiders --trace-deprecation ... to show where the warning was created) (at writeOut (internal/process/warning.js:43:3))

Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information.

workbench.desktop.main.js:62 [Extension Host] extension activation failed TypeError: o.getConfiguration(...).get(...).find is not a function
at new m (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:683169)
at Object.t.resolveInstance (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:263270)
at c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:262475
at Object.t.resolve (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:262738)
at c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:253835
at e._get (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:253601)
at e.get (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:252313)
at a.get (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:90:509426)
at c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:52:245341
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:37:825686
at async t.activate (c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:37:825373)
at async Promise.all (index 0)
at async Promise.all (index 89)
at async Promise.all (index 1) (at c:\Users\shreyash.vscode-insiders\extensions\ms-toolsai.jupyter-2021.6.819764235\out\client\extension.js:37:826205)

The aforementioned are the errors I am seeing now.

@joyceerhl
Copy link
Contributor

Yep I repro the bug. Assigning to myself for investigation. Thanks for letting us know.

@joyceerhl joyceerhl assigned joyceerhl and unassigned claudiaregio May 7, 2021
@joyceerhl
Copy link
Contributor

@DonJayamanne It's working for you because your settings.json still contains the old editorAssociations setting format. If you delete it, this code here falls over and crashes activation:

// Custom settings just for native notebook support.
const settings = workspaceService.getConfiguration('workbench', undefined);
const editorAssociations = settings.get('editorAssociations') as {
viewType: string;
filenamePattern: string;
}[];
if (editorAssociations.find((a) => a.viewType && a.viewType.includes('jupyter-notebook'))) {

@joyceerhl
Copy link
Contributor

As a temporary workaround @sztal and @Hanuphant, you can replace the workbench.editorAssociations setting with the following:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter-notebook",
            "filenamePattern": "*.ipynb"
        }
    ]

I assume both of you have intentionally opted out of the native notebooks UI. However this will allow the Jupyter extension to activate. We're working on a fix for this (basically we need to support reading the new setting format that VS Code has introduced, which is the default layout now).

@sztal
Copy link
Author

sztal commented May 7, 2021

Thanks! But now I am a bit confused. I did not want to opt out from the native notebooks UI. As a matter of fact it was the reason I started to use VS Code Insiders in the first place. So does it mean that I could have opted out somehow accidentally? And if so, how can I check this?

@joyceerhl
Copy link
Contributor

Do you have "jupyter.experiments.optOutFrom": [ "NativeNotebookEditor" ] or "jupyter.experiments.enabled": false set anywhere in your settings.json?

The "jupyter.notebook.ipynb" viewType is for our custom editor implementation of notebooks. So you shouldn't have that entry there. The "jupyter-notebook" viewType is for our native notebooks implementation.

@sztal
Copy link
Author

sztal commented May 7, 2021

But in the meantime, I confirm that your solution works (and I still have new native notebooks).

I think that this jupyter.notebook.ipynb was somehow added during upgrading of VS Code, but I am not sure. However I really do believe that it was just jupyter-notebook earlier. Nonetheless, now I corrected the settings and everything seem to be fine.

So once again, thanks a lot for solving it so quickly!

@Hanuphant
Copy link

Do you have "jupyter.experiments.optOutFrom": [ "NativeNotebookEditor" ] or "jupyter.experiments.enabled": false set anywhere in your settings.json?

The "jupyter.notebook.ipynb" viewType is for our custom editor implementation of notebooks. So you shouldn't have that entry there. The "jupyter-notebook" viewType is for our native notebooks implementation.

Yeah, I did have "jupyter.experiments.optOutFrom": ["NativeNotebookEditor"] in my settings.json.

I am quite new to this, will you be able to help me out with workbench.editorAssociation . Do I have to add that code in settings.json?

@joyceerhl
Copy link
Contributor

Yup, you would delete the existing "workbench.editorAssociations" key and value, and replace it with this snippet:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter-notebook",
            "filenamePattern": "*.ipynb"
        }
    ]

@Hanuphant
Copy link

Yup, you would delete the existing "workbench.editorAssociations" key and value, and replace it with this snippet:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter-notebook",
            "filenamePattern": "*.ipynb"
        }
    ]

Thanks a lot @joyceerhl & devs. It worked!!!

@flipphillips
Copy link

I too was using Insider for the native view capability.

@joyceerhl
Copy link
Contributor

@flipphillips are you also unable to open notebooks in insiders? Does this workaround help?: #5804 (comment)

@flipphillips
Copy link

flipphillips commented May 7, 2021

@joyceerhl - I see what the problem is/was, that the settings format is different now than what was in the synced settings (I had other associations in there too).

It appears that this manual fix worked, thanks!

It does complain that the setting is wrong, btw -
Screen Shot 2021-05-07 at 7 35 24 PM

@joyceerhl
Copy link
Contributor

Yeah the new VS Code core setting IntelliSense flags the old format as an error, but it's still supported for backward compatibility. We (Jupyter extension) are working on a fix to migrate workbench.editorAssociations to the new format.

@flipphillips
Copy link

Groovy - makes sense. I'll do the best to pass on the secret sauce to my students. Ironically, I was just showing them the cool/better notebook interface in class, then they got home and couldn't get it to work because of this :) Such is living on the edge.

@joyceerhl
Copy link
Contributor

@flipphillips Yeah, sorry about the snafu. Team is out for the week but we should have this fixed Monday.

@joyceerhl
Copy link
Contributor

This should be fixed in the latest Jupyter extension build targeting VS Code Insiders: v2021.6.828932339.

@joyceerhl
Copy link
Contributor

Closing as this should have been resolved with today's update. Please feel free to open a new issue if otherwise. Thanks everyone for your patience and for reporting a bug!

@joyceerhl joyceerhl unpinned this issue May 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants