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

An UI(maybe) bug causing .ipynb files can not be displayed #166860

Closed
zhuhr213 opened this issue Nov 21, 2022 · 20 comments · Fixed by #177716
Closed

An UI(maybe) bug causing .ipynb files can not be displayed #166860

zhuhr213 opened this issue Nov 21, 2022 · 20 comments · Fixed by #177716
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders notebook verified Verification succeeded webview Webview issues
Milestone

Comments

@zhuhr213
Copy link

Type: Bug

I mainly use ssh for remote development. The bug is, when I directly open an .ipynb file on the ssh server, it can be opened, run, and can NOT be displayed.
Oddly enough, I then try to open an .ipynb file locally, it successfully displayed and the .ipynb file on the ssh server also displayed! However, when I close the Vscode window where I open the local .ipynb file, and then I try to open an another .ipynb file on the ssh server, again, it can not be displayed, but can be run. Also, after closing the already opened file, it can not be displayed again.

I tried re-install Vscode but it doesn't work. I'm currently using the latest windows 11. All Vscode and its extensions are the latest.
The bug doesn't exist on MAC OS Vscode.

VS Code version: Code 1.73.1 (6261075, 2022-11-09T04:27:29.066Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No
Remote OS version: Linux x64 4.15.0-188-generic

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i5-12600K (16 x 3686)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.79GB (21.41GB free)
Process Argv --folder-uri vscode-remote://ssh-remote%2B8%E5%8F%B7%E6%9C%BA/home/zhuhaoran/scBERT --crash-reporter-id 9f00aa13-d232-4186-acb7-cea9d07f898e
Screen Reader no
VM 0%
Item Value
Remote SSH: 8号机
OS Linux x64 4.15.0-188-generic
CPUs Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz (112 x 2639)
Memory (System) 503.36GB (460.20GB free)
VM 0%
Extensions (27)
Extension Author (truncated) Version
vscode-language-pack-zh-hans MS- 1.73.11090913
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.262.3
remote-ssh ms- 0.92.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.72.0
remote-explorer ms- 0.0.2
vscode-todo-highlight way 1.0.5
material-theme zhu 3.15.6
shell bbe 0.3.0
gitlens eam 13.1.0
vscode-pull-request-github Git 0.54.1
todo-tree Gru 0.0.220
nbpreviewer jit 1.2.2
kite kit 0.147.0
rainbow-csv mec 3.3.0
vscode-language-pack-zh-hans MS- 1.73.11020948
python ms- 2022.18.2
vscode-pylance ms- 2022.11.30
jupyter ms- 2022.9.1303220346
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.12
vscode-jupyter-cell-tags ms- 0.1.6
vscode-jupyter-slideshow ms- 0.1.5
r-debugger RDe 0.4.7
r REd 2.6.1
shellcheck tim 0.28.2

(2 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848cf:30577861
nodejswelcome1cf:30587006
fc301958:30595537
282f8724:30602487
gswce1:30612156
iaj6b796:30613358
dbltrim-noruby:30604474
f6dab269:30613381

@zhuhr213 zhuhr213 changed the title An UI(maybe) bug causing .ipynb files can not be loaded An UI(maybe) bug causing .ipynb files can not be displayed Nov 21, 2022
@eleanorjboyd
Copy link
Member

Hello! Could you send your remote-ssh logs and your jupyter extension logs? Also are there any errors surfacing in the developer tools when it fails to render the .ipynb file?

@eleanorjboyd eleanorjboyd added info-needed Issue requires more information from poster ssh labels Nov 28, 2022
@roblourens
Copy link
Member

it can be opened, run, and can NOT be displayed.

Can you tell me what you mean exactly? Is it that the outputs don't show up? Maybe you can share a screenshot?

@zhuhr213
Copy link
Author

it can be opened, run, and can NOT be displayed.

Can you tell me what you mean exactly? Is it that the outputs don't show up? Maybe you can share a screenshot?

Hello collegue, I upload a pic and a video for your easy reference. The file is already open because I can run it by clicking "Run All" button, but, as you can see, nothing is displayed, and the remote note book is just keep loading and loading.
Weirdly, local notebook files can be loaded successfully, and I have to open a local notebook so that the ssh notebook can be displayed. If I close the ssh notebook and reopen it, again, it can not be loaded.

66cbf4e218d7ce76e10347fe8fc6ef7

bug_report.mp4

@zhuhr213
Copy link
Author

zhuhr213 commented Nov 29, 2022

Hello! Could you send your remote-ssh logs and your jupyter extension logs? Also are there any errors surfacing in the developer tools when it fails to render the .ipynb file?

Hello collegue, I actually didn't see any related errors output. you can see the 'dev tools' logs at #166584, where we have the same issue.

Oh! There is one maybe:
加载 Web 视图时出错: Error: Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state.
I don't know if this is the error.

jupyter log:
1669693665030

ssh log:
[11:44:53.123] Log Level: 2
[11:44:53.126] remote-ssh@0.92.0
[11:44:53.126] win32 x64
[11:44:53.133] SSH Resolver called for "ssh-remote+8号机", attempt 1
[11:44:53.133] "remote.SSH.useLocalServer": false
[11:44:53.134] "remote.SSH.showLoginTerminal": false
[11:44:53.134] "remote.SSH.remotePlatform": {"8号机":"linux"}
[11:44:53.134] "remote.SSH.path": undefined
[11:44:53.134] "remote.SSH.configFile": undefined
[11:44:53.134] "remote.SSH.useFlock": true
[11:44:53.134] "remote.SSH.lockfilesInTmp": false
[11:44:53.134] "remote.SSH.localServerDownload": auto
[11:44:53.134] "remote.SSH.remoteServerListenOnSocket": false
[11:44:53.134] "remote.SSH.showLoginTerminal": false
[11:44:53.134] "remote.SSH.defaultExtensions": []
[11:44:53.134] "remote.SSH.loglevel": 2
[11:44:53.134] "remote.SSH.enableDynamicForwarding": true
[11:44:53.134] "remote.SSH.enableRemoteCommand": false
[11:44:53.134] "remote.SSH.serverPickPortsFromRange": {}
[11:44:53.134] "remote.SSH.serverInstallPath": {}
[11:44:53.136] SSH Resolver called for host: 8号机
[11:44:53.136] Setting up SSH remote "8号机"
[11:44:53.140] Using commit id "6261075646f055b99068d3688932416f2346dd3b" and quality "stable" for server
[11:44:53.141] Install and start server if needed
[11:44:53.143] Checking ssh with "ssh -V"
[11:44:53.163] > OpenSSH_for_Windows_8.6p1, LibreSS
[11:44:53.163] > L 3.4.3

[11:44:53.165] Running script with connection command: ssh -T -D 63111 "8号机" bash
[11:44:53.167] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[11:44:55.708] > d600dd4c3cfd: running

�]0;C:\WINDOWS\System32\cmd.exe�
[11:44:55.708] Got some output, clearing connection timeout
[11:44:55.739] > Acquiring lock on /home/zhuhaoran/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b/vscode-remote-lock.zhuhaoran.6261075646f055b99068d3688932416f2346dd3b
Found existing installation at /home/zhuhaoran/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b...
Checking /home/zhuhaoran/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.log and /home/zhuhaoran/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.pid for a running server
Looking for server with pid: 29205
[11:44:55.823] > Found running server...

Checking server status on port 34977 with wget
d600dd4c3cfd: start
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==34977==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1014==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==1a111a11-aaa1-111a-1111-aaa1111a1a11==
d600dd4c3cfd: end
[11:44:55.823] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==34977==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1014==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==1a111a11-aaa1-111a-1111-aaa1111a1a11==

[11:44:55.823] Remote server is listening on 34977
[11:44:55.823] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":34977},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1014","platform":"linux","connectionToken":"1a111a11-aaa1-111a-1111-aaa1111a1a11"},"installUnpackCode":""}
[11:44:55.825] Starting forwarding server. localPort 63114 -> socksPort 63111 -> remotePort 34977
[11:44:55.826] Forwarding server listening on 63114
[11:44:55.826] Waiting for ssh tunnel to be ready
[11:44:55.826] [Forwarding server 63114] Got connection 0
[11:44:55.827] Tunneled 34977 to local port 63114
[11:44:55.827] Resolved "ssh-remote+8号机" to "127.0.0.1:63114"
[11:44:55.831] ------

[11:44:55.842] [Forwarding server 63114] Got connection 1
[11:44:55.845] >
[11:44:55.859] [Forwarding server 63114] Got connection 2
[11:44:56.380] [Forwarding server 63114] Got connection 3

dev log:
image

@DuTim
Copy link

DuTim commented Nov 30, 2022

same issue. I can try to degrade below the 1.72.2 to solve the problem in my environment . if the version is 1.73.1 ,the problem exist .

@roblourens
Copy link
Member

Kai mentioned an issue that he discussed with you @sandy081, with notebooks failing to open because of network requests being blocked due to settings sync, is there an open issue for that?

I also see

Error: Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state.

Do you know about that @mjbvz?

cc @rebornix

@roblourens
Copy link
Member

#166584 shows network error messages as well

workbench.desktop.main.js:609   ERR read ECONNRESET: Error: read ECONNRESET
	at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
workbench.desktop.main.js:609   ERR Error: Unavailable due to network problems
	at y.convertToSession (d:\Program Files\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:647681)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Promise.all (index 0)
workbench.desktop.main.js:609  WARN Settings Sync: Accounts are not initialized
workbench.desktop.main.js:609   ERR Client network socket disconnected before secure TLS connection was established: Error: Client network socket disconnected before secure TLS connection was established
	at connResetException (node:internal/errors:691:14)
	at TLSSocket.onConnectEnd (node:_tls_wrap:1585:19)
	at TLSSocket.emit (node:events:538:35)
	at endReadableNT (node:internal/streams/readable:1345:12)
	at processTicksAndRejections (node:internal/process/task_queues:83:21)

@sandy081
Copy link
Member

sandy081 commented Dec 8, 2022

Kai mentioned an issue that he discussed with you @sandy081, with notebooks failing to open because of network requests being blocked due to settings sync, is there an open issue for that?

Sorry, do not remember which issue is that

@zhuhr213
Copy link
Author

zhuhr213 commented Dec 9, 2022

The latest 1.74 doesn't fix this bug

@yowu
Copy link

yowu commented Jan 2, 2023

I met the issue too. It works in localhost but desn't work in a remote server.
There is error in dev-log in the remote case. Hope this is related.

ERR 'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).: Error: 'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).
    at t (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:770:25540)
    at new R (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:1324:3987)
    at l.j (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:608:1296)
    at l.createInstance (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:608:788)
    at y.createWebviewElement (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:2182:41321)
    at Za.kb (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:1956:6858)
    at Za.hb (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:1956:642)
    at Za.createWebview (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:1943:915)
    at http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:2412:7598
    at De.hc (http://192.168.50.109:8000/stable-e8a3071ea4344d9d48ef8a4df2c097372b0c5161/static/out/vs/workbench/workbench.web.main.js:2412:8001)

@mjbvz mjbvz added this to the February 2023 milestone Jan 30, 2023
mjbvz added a commit to mjbvz/vscode that referenced this issue Jan 30, 2023
For microsoft#166860

This makes our webview service worker return a 408 if a request takes over 30 seconds. Previously we would keep the request open without responding
mjbvz added a commit that referenced this issue Jan 31, 2023
For #166860

This makes our webview service worker return a 408 if a request takes over 30 seconds. Previously we would keep the request open without responding
@mjbvz mjbvz added the notebook label Feb 1, 2023
@zhuhr213
Copy link
Author

changing chinese in the ssh configuration file to english can sovle the problem.

It really works!!!

@zhuhr213
Copy link
Author

changing chinese in the ssh configuration file to english can sovle the problem.

how did you ever find this solution

mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 9, 2023
For microsoft#166860

Adds a `fatalError` event that notebooks can use to know when their webview will never load
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 9, 2023

@zhuhr213 Can you share your original ssh config? I tried adding Chinese characters to the Host but wasn't able to reproduce this. Were the character in the username perhaps?

@zhuhr213
Copy link
Author

zhuhr213 commented Mar 10, 2023

@zhuhr213 Can you share your original ssh config? I tried adding Chinese characters to the Host but wasn't able to reproduce this. Were the character in the username perhaps?

of course, here is my original ssh config:

Host 15号机
HostName 222.27.87.23
Port 11500
IdentityFile "C:\Users\zhuhr.ssh\id_rsa_2048"
User zhuhaoran

Host 8号机
HostName 222.27.87.23
Port 10800
IdentityFile "C:\Users\zhuhr.ssh\id_rsa_2048"
User zhuhaoran

Host Localubuntu
HostName 172.30.146.140
Port 1841
User zhuhr

Host webServer
HostName 39.104.69.176
Port 22
User root

I just tried my original ssh config, and it still doesn't work. Only the first notebook I opened can be loaded. And if I close and reopen this loaded one, it can not be loaded.

And I changed "8号机" to "server8", and "15号机" to "server15" and it really works! All opened notebooks can be loaded. Is it because you have only one notebook open? Try opening more than one notebook at the same time and maybe you can reproduce this.

figure1
figure2

@mjbvz

mjbvz added a commit that referenced this issue Mar 14, 2023
For #166860

Adds a `fatalError` event that notebooks can use to know when their webview will never load
@mjbvz mjbvz modified the milestones: March 2023, April 2023 Mar 20, 2023
mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 20, 2023
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug webview Webview issues and removed info-needed Issue requires more information from poster labels Mar 20, 2023
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Mar 20, 2023
@mjbvz mjbvz added the author-verification-requested Issues potentially verifiable by issue author label Mar 21, 2023
@VSCodeTriageBot
Copy link
Collaborator

This bug has been fixed in the latest release of VS Code Insiders!

@zhuhr213, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 833ac68 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@zhuhr213
Copy link
Author

@mjbvz Bug fixed and it works well, thank you!

@connor4312 connor4312 added the verified Verification succeeded label Mar 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders notebook verified Verification succeeded webview Webview issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.