code-server: [Bug]: Jupyter Notebook not working

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

- Web Browser: Chrome
- Local OS: Any 
- Remote OS: Docker (Unraid OS)
- Remote Architecture: AMD x64
- `code-server --version`: 4.0.1

Expected

[Notebook Creation]: Creation and opening of new .ipynb file with proper layout as shown in MS documentation [Notebook Opening]: Opening .ipynb file should result in proper layout shown with possibility of editing the notebook file.

Actual

[Notebook Creation]: Error message “Command ‘Jupyter: Create New Jupyter Notebook’ resulted in an error (NO provider registered for view type: ‘jupyter-notebook’)”, no file being created, black screen. [Notebook Opening]: Error message “Cannot open resource with notebook editor type ‘jupyter-notebook’, please check if you have the right extension installed or enabled.”, file content not shown, black screen.

Logs

In the following, the Chrome console output related to the situations mentioned above

[Notebook Creation]:

(node:11546) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.(Use `node --trace-deprecation ...` to show where the warning was created)

mainThreadExtensionService.ts:95 Activating extension 'vscode.ipynb' failed: Cannot find module '/usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/extensions/ipynb/dist/ipynbMain.js'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/out/vs/loader.js
- /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/out/bootstrap-amd.js
- /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/out/bootstrap-fork.js.

CRITI FAILED to destory notebook Error: NO provider registered for view type: 'jupyter-notebook'
    at O.withNotebookDataProvider (notebookServiceImpl.ts:611:10)
    at async u.createReferencedObject (notebookEditorModelResolverServiceImpl.ts:64:16)
    at async a.resolve (notebookEditorModelResolverServiceImpl.ts:216:18)
    at async l.$tryCreateNotebook (mainThreadNotebookDocuments.ts:131:15)

[Notebook Opening]:

mainThreadExtensionService.ts:95 Activating extension 'vscode.ipynb' failed: Cannot find module '/usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/extensions/ipynb/dist/ipynbMain.js'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/out/vs/loader.js
- /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/out/bootstrap-amd.js
- /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/out/bootstrap-fork.js.

Screenshot/Video

[Notebook Creation]: image

[Notebook Opening]: image


Content of folder /usr/local/share/.config/yarn/global/node_modules/code-server/vendor/modules/code-oss-dev/extensions/ipynb (Mentioned in the above errors) image

Does this issue happen in VS Code?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

Trying to work with Jupiter Notebooks, unable to have it working with ms-python.python & ms-toolsai.jupyter extensions having tried both GUI and CLI (with code-server --install-extension) install methods. Tried to look for other issues posted, no one seems to be similar as most were related to stuff regarding old code-server versions (prior to 4.0)

Tried with enviroments:

  • Python 3.8.10
  • Miniconda 3.9.5 Same errors in both cases

Nginx reverse proxy is used to access code-server

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 31 (17 by maintainers)

Most upvoted comments

@vdallavalle I suggest you open an issue at https://github.com/linuxserver/docker-code-server/issues then.

Yeah, just tried install script on ubuntu machine (so no Docker, just plain code-server) and there is no problem whatsoever. At this point I’m pretty confident this is somehow related to linuxserver/code-server image. I’ll wait for a feedback from @jsjoeio and than close this issue and open a new one in linuxserver repo. Thank for your help 😊

@benz0li I will ask my admin if they can do the tls termination up front. I will update the progress in this issue! Thanks for your help 🙏 🙏

@crissed53 TLS termination should be done by Kubeflow not by the container image(s). Have a look at https://github.com/kubeflow/kubeflow/issues/5976.

ℹ️ For https://demo.jupyter.b-data.ch TLS termination is done by JupyterHub. The JupyterLab container exposes HTTP on port 8888 and requests are proxied through JupyterHub.

I swear this was working when we released 4.0.1. Looks like we’ll need to fix again 😢

I reproduced locally with 4.0.1 using macOS + Brave.

image

Thanks for raising this issue.

@aghasemi can you try using 4.1.0?

I’m on 4.1.0

Ah, you said 4.0.1 in the previous message:

I am having a similar issue, on version 4.0.1, and my error when trying to create a new Notebook is

Can you see if you’re facing the same issue as #4976 or #4964?

I can confirm it is 4.1.0. Sorry for the typo.

It is likely #4976, as I am also running CS via nginx on a domain.

I updated to 4.0.2 and now Jupyter Notebooks seem to be working fine…

So just to clarify, the error above is expected when running code-server locally on MacOS (as was earlier reproduced with Brave, and I just reproduced on MacOS with Chrome and code-server==4.0.2). I’ve tried opening a notebook after changing folder and am still faced with the following error (both with HTTP and HTTPS), installing ms-python.python and ms-toolsai.jupyter as user:

Command 'Jupyter: Create New Jupyter Notebook' resulted in an error (NO provider registered for view type: 'jupyter-notebook')

Everything working properly with codercom/code-server:4.0.1, too. One only needs

  1. apt-get update && apt-get -y install --no-install-recommends python3-venv python3-pip as root and
  2. install code-server (VS Code) extensions ms-python.python and ms-toolsai.jupyter as user [coder].

@vdallavalle How did you install code-server itself? If you install extension ms-toolsai.jupyter at system level [as root], you must take care of some stuff yourself, i.e. create its tmp-folder manually.
👉 See https://gitlab.b-data.ch/jupyterlab/r/r-ver/-/blob/master/r-ver/latest.Dockerfile#L186-L188.

@jsjoeio Jupyter Notebooks work just fine: See https://demo.jupyter.b-data.ch for a reference deployment using JupyterHub and JupyterLab + code-server.

See #4689 (comment)

[…] Do you access code-server in private/incognito mode? 👉 If so: Try disabling private/incognito mode or make an exception for your IP address/domain. Service workers do not work in private/incognito mode. Accessing code-server via HTTP instead of HTTPS may cause further problems. […]

plus

[…] one must explicitly open a folder (File > Open Folder…) before opening a Jupyter notebook.

Thank you for the replay but none of your suggestions has to do with my case: as you can see from my nginx configuration I am indeed using https to connect with code-server. Moreover I don’t usually access application under incoginto mode (I mean, why should I 😝). Actually it’s not clear in the images I posted but all my tests are within an opened folder (with File > Open Folder), so that’s not what causes my issue.

You may also docker run --rm -p 8888:8888 -e GEN_CERT=yes -v jupyter-user-jovyan:/home/jovyan [image] with any of the following images:

  • registry.gitlab.b-data.ch/jupyterlab/r/r-ver
  • registry.gitlab.b-data.ch/jupyterlab/r/tidyverse
  • registry.gitlab.b-data.ch/jupyterlab/r/verse
  • registry.gitlab.b-data.ch/jupyterlab/r/geospatial
  • registry.gitlab.b-data.ch/jupyterlab/julia/ver

@jsjoeio Jupyter Notebooks work just fine: See https://demo.jupyter.b-data.ch for a reference deployment using JupyterHub and JupyterLab + code-server.

See https://github.com/coder/code-server/issues/4689#issuecomment-1006472915

[…] Do you access code-server in private/incognito mode? 👉 If so: Try disabling private/incognito mode or make an exception for your IP address/domain.

Service workers do not work in private/incognito mode. Accessing code-server via HTTP instead of HTTPS may cause further problems. […]

plus

[…] one must explicitly open a folder (File > Open Folder…) before opening a Jupyter notebook.