code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: Problem opening .ipynb files (Jupyter Notebook)

Open c-dasq opened this issue 4 years ago • 45 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Microsoft Edge / Chrome / Firefox / Vivaldi / Safari
  • Local OS: Windows 10.0.19044.1826 / macOS Big Sur 11.6.8
  • Remote OS: Raspberry Pi OS Lite (64-bit) 2022-04-04 (Kernel: 5.15 | Debian: 11 'bullseye')
  • Remote Architecture: arm64
  • code-server --version: 4.5.2

Steps to Reproduce

  1. open code-server
  2. try to open .ipynb file
  3. trying to create an .ipynb file

Expected

The file should open and be viewable

Actual

Code-server keeps trying to open the file, or creating the file, never finishes loading on screen.

Logs

No response

Screenshot/Video

image

Does this issue happen in VS Code or GitHub Codespaces?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

No response

c-dasq avatar Aug 18 '22 19:08 c-dasq

Same issue here, under the same condition of OP. Can install every extension and every package, but the notebook seems loading forever.

Antonet99 avatar Aug 31 '22 09:08 Antonet99

@c-dasq If https://github.com/coder/code-server/issues/5475#issuecomment-1229529712 seems reasonable to you and did resolve this [your] issue, please close.

benz0li avatar Aug 31 '22 09:08 benz0li

Interesting that you dont care about all the other people @benz0li

Emporea avatar Aug 31 '22 11:08 Emporea

I do care:

  • https://github.com/coder/code-server/issues/4976
  • https://github.com/coder/code-server/issues/4777
  • https://github.com/coder/code-server/issues/4689
  • https://github.com/coder/code-server/issues/3874
  • https://github.com/coder/code-server/issues/3782

@Emporea Please post the output from the browser's web console when you reload the page and open the Jupyter Notebook* using my deployment. 👉 [Firefox] Tools > Browser Tools > Web Developer Tools: Console || Keyboard shortcut Ctrl+Shift+K

*Please open about:debugging (> This Firefox) and about:serviceworkers in two separate browser tabs while doing so.
ℹ️ There should be two Service Workers (and two Other Workers) after spinning up code-server.

benz0li avatar Aug 31 '22 11:08 benz0li

@wolframalpha In your case: Another problem is, that you are not serving code-server via HTTPS. See #5475 (comment).

Oh yeah that makes sense, the browser crypto API is only available in secure contexts I believe.

From https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle:

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

code-asher avatar Aug 31 '22 15:08 code-asher

There is supposed to be a popup warning on startup when using insecure contexts saying that certain functionality will not work because the browser does not allow them but we should instead make that popup appear at the point of trying to perform an action so it is more obvious why a certain feature is not working. So instead we would make it show every time a web view fails to open, when paste fails, and other things that will fail due to insecure contexts. In the specific case of web views it might be best to show that message right in the web view instead of a popup.

Also we should change the error message in the console to specifically say whether an insecure context is the problem instead of just "can't compute".

code-asher avatar Aug 31 '22 15:08 code-asher

@benz0li Have you changed anything with your deployment? I cant reproduce the error any more, its working with your deployment. This confuses me even more cause now it has to be my deployment. But my deployment works for you. Gosh. Help.

Output of Console when refreshing my deployment:

Uncaught (in promise) Error: Unable to write file 'vscode-log:/20220831T185932/window.log' (Error: IndexedDB database 'vscode-web-db' is closed.)
    _ files.ts:1156
    writeFile fileService.ts:404
    _log fileLog.ts:106
    consume async.ts:637
    queue async.ts:628
    queue async.ts:626
    _log fileLog.ts:94
    error fileLog.ts:69
    error log.ts:435
    _log bufferLog.ts:53
    error bufferLog.ts:76
    handleUnexpectedError workbench.ts:129
    registerErrorHandler workbench.ts:87
    onUnexpectedError errors.ts:65
    A errors.ts:84
    registerErrorHandler workbench.ts:80
    registerErrorHandler workbench.ts:77
    M workbench.ts:71
    open web.main.ts:112
    s web.factory.ts:65
    <anonymous> workbench.ts:503
    <anonymous> workbench.ts:510
    _invokeFactory loader.js:1199
    complete loader.js:1209
    _onModuleComplete loader.js:1839
    _resolve loader.js:1796
    defineModule loader.js:1439
    y loader.js:1889
    <anonymous> fake:8
    <anonymous> fake:1
2 [files.ts:1156:2](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/out-vscode-reh-web/vs/workbench/file:/home/runner/work/code-server/code-server/lib/vscode/src/vs/platform/files/common/files.ts)
This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. [emporea.net](https://emporea.net/?folder=/home/coder)
The web worker extension host is started in a same-origin iframe! [workbench.web.main.js:1999:23012](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “usb”. [workbench.web.main.js:1999:23574](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “serial”. [workbench.web.main.js:1999:23574](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “hid”. [workbench.web.main.js:1999:23574](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [workbench.web.main.js:1999:23574](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “usb”. [workbench.web.main.js:1999:23730](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “serial”. [workbench.web.main.js:1999:23730](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “hid”. [workbench.web.main.js:1999:23730](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [workbench.web.main.js:1999:23730](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “usb”. [workbench.web.main.js:1999:24554](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “serial”. [workbench.web.main.js:1999:24554](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “hid”. [workbench.web.main.js:1999:24554](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [workbench.web.main.js:1999:24554](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
 INFO [Service Worker] registered [workbench.web.main.js:602:3719](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/workbench.web.main.js)
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing. [emporea.net](https://emporea.net/?folder=/home/coder)
The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it. [webWorkerExtensionHostIframe.html](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html?&vscodeWebWorkerExtHostId=c4be9fb0-c743-45c0-9510-26eb60db3687)

When I then try to open a ipynb file this gets added to the console:

Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [webviewElement.ts:501:10](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/out-vscode-reh-web/vs/workbench/file:/home/runner/work/code-server/code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.ts)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [webviewElement.ts:565:9](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/out-vscode-reh-web/vs/workbench/file:/home/runner/work/code-server/code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.ts)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [webviewElement.ts:543:16](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/out-vscode-reh-web/vs/workbench/file:/home/runner/work/code-server/code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.ts)
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing. [emporea.net](https://emporea.net/?folder=/home/coder)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [index-no-csp.html:933:13](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/contrib/webview/browser/pre/index-no-csp.html?id=50a4df99-1b67-46ca-82b3-893c92d5a311&origin=50a4df99-1b67-46ca-82b3-893c92d5a311&swVersion=4&extensionId=&platform=browser&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=https%3A%2F%2Femporea.net&remoteAuthority=emporea.net&purpose=notebookRenderer)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [index-no-csp.html:942:48](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/contrib/webview/browser/pre/index-no-csp.html?id=50a4df99-1b67-46ca-82b3-893c92d5a311&origin=50a4df99-1b67-46ca-82b3-893c92d5a311&swVersion=4&extensionId=&platform=browser&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=https%3A%2F%2Femporea.net&remoteAuthority=emporea.net&purpose=notebookRenderer)
Feature Policy: Skipping unsupported feature name “cross-origin-isolated”. [index-no-csp.html:945:18](https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/contrib/webview/browser/pre/index-no-csp.html?id=50a4df99-1b67-46ca-82b3-893c92d5a311&origin=50a4df99-1b67-46ca-82b3-893c92d5a311&swVersion=4&extensionId=&platform=browser&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=https%3A%2F%2Femporea.net&remoteAuthority=emporea.net&purpose=notebookRenderer)

about:serviceworkers shows this:

Origin: https://emporea.net

    Scope: https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/contrib/webview/browser/pre/
    Script Spec: https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&remoteAuthority=emporea.net
    Current Worker URL: https://emporea.net/stable-2062a59ca1a586d8a6e7bf483841085a94c440a4/static/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&remoteAuthority=emporea.net
    Active Cache Name: {f1b77d62-b4f6-4250-8701-c7437280b238}
    Waiting Cache Name:
    Push Endpoint: null

Origin: https://emporea.net

    Scope: https://emporea.net/
    Script Spec: https://emporea.net/_static/out/browser/serviceWorker.js
    Current Worker URL: https://emporea.net/_static/out/browser/serviceWorker.js
    Active Cache Name: {be5d9d96-3018-457b-b82e-53953a180697}
    Waiting Cache Name:
    Push Endpoint: null

Both Service Workers are running and the ipynb still doesn't load on my deployment. image

Your working deployment has about the same logs but its showing the file now constantly, while mine does not.

I am using nginx-proxy with acme-companion as a reverse proxy and serve https.

Then i give the codeserver docker-compose.yml the environmental parameters VIRTUAL_HOST=emporea.net and LETSENCRYPT_HOST=emporea.net. This should be sufficient, right? It worked until 4.4.0, so i still dont understand what happend after 4.4.0.? Can you explain?

Code-Server docker container shows this on start-up though (last line, "Not serving HTTPS")

[2022-08-31T16:54:12.831Z] info  Wrote default config file to ~/.config/code-server/config.yaml
[2022-08-31T16:54:13.360Z] info  code-server 4.6.0 6d3f9ca6a6df30a1bfad6f073f6fa33c0e63abdb
[2022-08-31T16:54:13.362Z] info  Using user-data-dir ~/.local/share/code-server
[2022-08-31T16:54:13.378Z] info  Using config file ~/.config/code-server/config.yaml
[2022-08-31T16:54:13.378Z] info  HTTP server listening on http://0.0.0.0:8080/ 
[2022-08-31T16:54:13.378Z] info    - Authentication is enabled
[2022-08-31T16:54:13.378Z] info      - Using password from $PASSWORD
[2022-08-31T16:54:13.378Z] info    - Not serving HTTPS 

If i can provide more logs or more infos about my configuration let me know. Thanks.

Emporea avatar Aug 31 '22 17:08 Emporea

@benz0li Have you changed anything with your deployment? I cant reproduce the error any more, its working with your deployment.

I update my images regularly: https://gitlab.b-data.ch/jupyterlab/python/scipy/-/commits/main
ℹ️ No fundamental change since Aug 28, 2022 6:20pm CEST (Update code-server to v4.6.0).

This confuses me even more cause now it has to be my deployment. But my deployment works for you. Gosh. Help.

Your deployment does not work flawlessly for me either: https://github.com/coder/code-server/issues/5334#issuecomment-1214142287

I am using nginx-proxy with acme-companion as a reverse proxy and serve https.

Maybe https://github.com/coder/code-server/issues/4976#issuecomment-1070414441?

Code-Server docker container shows this on start-up though (last line, "Not serving HTTPS")

That is OK because the reverse proxy (nginx) takes care of TLS termination.

benz0li avatar Aug 31 '22 17:08 benz0li

Then i give the codeserver docker-compose.yml the environmental parameters VIRTUAL_HOST=emporea.net and LETSENCRYPT_HOST=emporea.net. This should be sufficient, right? It worked until 4.4.0, so i still dont understand what happend after 4.4.0.? Can you explain?

I do not know, but when I open https://emporea.net in Safari I get

emporea net_https

👉 @Emporea Your TLS termination does not seem to work properly.

benz0li avatar Aug 31 '22 17:08 benz0li

Actually i just removed the container after my testing. Thats why you get that TLS error. I can open it up again if you want to test it.

Edit: Its up and running again.

Emporea avatar Aug 31 '22 18:08 Emporea

Right now its working with my deployment too. I am even more confused.

I can see wibdwbv.ipynb

Emporea avatar Aug 31 '22 18:08 Emporea

And now its not working again. Without me changing anything but closing the files and opening it up again multiple times.

Edit: (1hour later) its working again. I don't know why there is this inconsistency.

Emporea avatar Aug 31 '22 18:08 Emporea

I don't know why there is this inconsistency.

That is odd and very frustrating 🤔 I wonder what it could be. Anyone have any ideas?

jsjoeio avatar Aug 31 '22 20:08 jsjoeio

Hi all, I was able to simulate almost all possible cases in an orderly manner, and I was unable to replicate the problem:

  • Web Browser: Firefox / Chrome / Chromium-based spinoffs
  • Remote OS: Raspberry Pi OS Lite / Ubuntu Server / Containers
  • Local OS: Windows 10 / Windows 11 / MacOs / iPadOs/ Ubuntu / Raspberry Pi Desktop / Android

It didn't really work well in only two cases:

  • Firefox on Android 9 (sorry, I don't have a newer version)
  • LXC Ubuntu Server container (I'm sure it's a ProxMox problem)

I suspect that when I generated the report for this bug, I had left the bind-addr setting at 0.0.0.0:8080, I didn't realize that port forwarding via SSH wasn't working (I use tmux); or I don't know if I made some other mistake.

I want to thank you all for the support, and if no one has any more comments, I will close this case.

Thank you very much,

code-server-jupyter-working

c-dasq avatar Sep 01 '22 12:09 c-dasq

Well mine isnt resolved. But go ahead. 💁🏻

Emporea avatar Sep 01 '22 12:09 Emporea

@Emporea, no problem, I'm not going to close it.

I'll try it with Fedora and let you know.

c-dasq avatar Sep 01 '22 12:09 c-dasq

Try my installation under emporea.net with password "coder"

Emporea avatar Sep 01 '22 13:09 Emporea

I installed ipykernel (using your terminal) and now everything works perfect :)

emporea - funciona ok

Can you do a test and let me know, please?

c-dasq avatar Sep 01 '22 13:09 c-dasq

I also have to install pip

c-dasq avatar Sep 01 '22 13:09 c-dasq

yeah that has nothing to do with it. Sometimes it works, sometimes not.

Does it work all the time for you? This way i could atleast know if it is a problem with my local setup and not with my deployment.

Emporea avatar Sep 01 '22 13:09 Emporea