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

Webview doesn't load resources on WSL2 #105536

Closed
leandro-manifesto opened this issue Aug 27, 2020 · 17 comments
Closed

Webview doesn't load resources on WSL2 #105536

leandro-manifesto opened this issue Aug 27, 2020 · 17 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verified Verification succeeded webview Webview issues
Milestone

Comments

@leandro-manifesto
Copy link

Issue Type: Bug

Seems to be #101272, but that issue is locked.

It started happenning when I updated to 1.48 and happens most of the time when I open Git Graph.

Sometimes it does work properly but I still couldn't figure out why.

VS Code version: Code 1.48.2 (a047975, 2020-08-25T10:13:11.295Z)
OS version: Windows_NT x64 10.0.19041
Remote OS version: Linux x64 4.19.104-microsoft-standard

System Info
Item Value
CPUs AMD Ryzen 5 3600X 6-Core Processor (12 x 3793)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.95GB (8.03GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-20.04
OS Linux x64 4.19.104-microsoft-standard
CPUs AMD Ryzen 5 3600X 6-Core Processor (12 x 3792)
Memory (System) 12.44GB (10.04GB free)
VM 0%
Extensions (8)
Extension Author (truncated) Version
project-manager ale 11.2.0
Handlebars and 0.4.1
remote-wsl ms- 0.44.4
vscode-eslint dba 2.1.8
EditorConfig Edi 0.15.1
git-graph mhu 1.25.0
vscode-docker ms- 1.5.0
vscode-typescript-tslint-plugin ms- 1.2.3
@vscodebot
Copy link

vscodebot bot commented Aug 27, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@mjbvz
Copy link
Collaborator

mjbvz commented Aug 27, 2020

Does this reproduce in the latest VS Code insiders build build too?

@mjbvz mjbvz added info-needed Issue requires more information from poster webview Webview issues labels Aug 27, 2020
@leandro-manifesto
Copy link
Author

leandro-manifesto commented Aug 27, 2020

Just installed the latest insiders build and the problem didn't seem to happen.
And for some reason it started working again on the stable version too.
So I decided to test if restarting WSL with wsl --shutdown had any effect, and now neither of them work.

Seems that when I start either VS Code with the WLS 2 distro is already running it works, but when VS Code has to start the distro it doesn't.

By the way, I never use the terminal to start VS Code. It is always through the Windows executable shortcut.

VS Code version: Code - Insiders 1.49.0-insider (b58f454, 2020-08-27T05:47:18.302Z)
OS version: Windows_NT x64 10.0.19041
Remote OS version: Linux x64 4.19.104-microsoft-standard

System Info
Item Value
CPUs AMD Ryzen 5 3600X 6-Core Processor (12 x 3793)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.95GB (8.08GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-20.04
OS Linux x64 4.19.104-microsoft-standard
CPUs AMD Ryzen 5 3600X 6-Core Processor (12 x 3792)
Memory (System) 12.44GB (10.29GB free)
VM 0%
Extensions (2)
Extension Author (truncated) Version
remote-wsl ms- 0.44.4
git-graph mhu 1.25.0

@jghal
Copy link

jghal commented Oct 16, 2020

Am still seeing this issue with 1.50.1

Version: 1.50.1 (user setup)
Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
Date: 2020-10-13T15:06:15.712Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.18363

In WSL

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

@leandro-manifesto
Copy link
Author

@jghal

While this doesn't get fixed my workaround is to boot WSL with Windows Terminal before opening VS Code. Works every time.
If I forget about it, I close VS Code, open a cmd to run wsl --shutdown and do it over.

Hope this helps.

@kanlukasz
Copy link

kanlukasz commented Oct 27, 2020

I'm having the same issues with the Git Graph extension:
obraz

Related: #106667, mhutchie/vscode-git-graph#378

@allanbarklie
Copy link

Just to note that I also see this defect current version info:

Git graph v1.28.0

Version: 1.52.1 (system setup)
Commit: ea3859d
Date: 2020-12-16T16:34:46.910Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042 (using WSL2)

For me the issue is intermittent- I haven't spotted any pattern about when it occurs.
Closing Visual Studio Code and opening it again always fixes it.

@leandro-manifesto
Copy link
Author

Yeah, something changed on update 1.53.1 and now the workaround doesn't work anymore.
The only thing I didn't test yet was restarting the computer.

Remote - WSL Extension version: 0.53.3
VS Code version: Code 1.53.1 (5d424b8, 2021-02-08T23:29:42.785Z)
OS version: Windows_NT x64 10.0.19042
Remote OS version: Linux x64 4.19.104-microsoft-standard

System Info
Item Value
CPUs AMD Ryzen 5 3600X 6-Core Processor (12 x 3793)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.95GB (8.62GB free)
Process Argv --crash-reporter-id 4db21ffc-61bb-4e0f-84f1-1d0c8fc0bf39
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-20.04
OS Linux x64 4.19.104-microsoft-standard
CPUs AMD Ryzen 5 3600X 6-Core Processor (12 x 3792)
Memory (System) 12.44GB (11.73GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30211402
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt600cf:30251589

@leandro-manifesto
Copy link
Author

So I turned on --verbose and went searching for reasons for this and I found that loadLocalResource uses RequestService to load the resources:

[2021-02-09 17:02:32.017] [main] [debug] loadLocalResource - being. requestUri=vscode-webview-resource://6465c1a9-e4ba-483e-9c9a-822011f2fbbd/file///home/leandro/.vscode-server/extensions/mhutchie.git-graph-1.28.0/media/out.min.js
[2021-02-09 17:02:32.017] [main] [debug] loadLocalResource - found resource to load. requestUri=vscode-webview-resource://6465c1a9-e4ba-483e-9c9a-822011f2fbbd/file///home/leandro/.vscode-server/extensions/mhutchie.git-graph-1.28.0/media/out.min.js, resourceToLoad=file:///home/leandro/.vscode-server/extensions/mhutchie.git-graph-1.28.0/media/out.min.js
[2021-02-09 17:02:32.017] [main] [trace] RequestService#request http://::1:45475/vscode-remote-resource?tkn=959f3d08-21d7-42fa-adb8-79b10d6893b3&path=%2Fhome%2Fleandro%2F.vscode-server%2Fextensions%2Fmhutchie.git-graph-1.28.0%2Fmedia%2Fout.min.js
[2021-02-09 17:02:32.020] [main] [debug] loadLocalResource - Loaded over http(s). requestUri=vscode-webview-resource://6465c1a9-e4ba-483e-9c9a-822011f2fbbd/file///home/leandro/.vscode-server/extensions/mhutchie.git-graph-1.28.0/media/out.min.js, response=404

It seems the URI http://::1:45475/vscode-remote-resource?... is wrong because the correct way to specify a IPv6 in a URI is with brackets per RFC 3986.

Using Chrome to simulate the requests, http://::1:45475/vscode-remote-resource?... doesn't work but http://[::1]:45475/vscode-remote-resource?... does.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 9, 2021

Very good find @leandro-manifesto! Ipv6 address could also explain why some people consistently see this while others don't (I don't seem to see it on my machine, but I'm running windows under parallels which may cause weird network things)

The problematic line is likely:

I'll look into checking in a fix but will likely need someone else to verify that it actually works.

mjbvz added a commit that referenced this issue Feb 9, 2021
For #105536 but need verification from someone who can actually reproduce this bug
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 9, 2021

Just pushed potential fix which will be in the next insiders build. Please test it out and let me know if this resolves the problem or not

@leandro-manifesto
Copy link
Author

The current Insiders build is on commit cd97629, so I'm waiting for the new one to come out.

@leandro-manifesto
Copy link
Author

Tested on this build:

Version: 1.54.0-insider
Commit: 40b3204
Date: 2021-02-10T17:39:27.208Z
Electron: 11.2.3
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042

Seems to be working. Git Graph opened properly.

Tested once with an already running WSL2, but it was using IPv4.
So I closed it, reset the WSL2 with wsl --shutdown, waited a while and reopened and it was using IPv6 this time with the brackets.

[2021-02-10 17:44:32.027] [main] [debug] loadLocalResource - being. requestUri=vscode-webview-resource://81374fcd-9910-4675-8dac-a10636112175/file///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.css
[2021-02-10 17:44:32.028] [main] [debug] loadLocalResource - found resource to load. requestUri=vscode-webview-resource://81374fcd-9910-4675-8dac-a10636112175/file///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.css, resourceToLoad=file:///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.css
[2021-02-10 17:44:32.028] [main] [trace] RequestService#request http://[::1]:36243/vscode-remote-resource?tkn=a8c7982c-9c5d-48e2-a617-03b14f27e82f&path=%2Fhome%2Fleandro%2F.vscode-server-insiders%2Fextensions%2Fmhutchie.git-graph-1.28.0%2Fmedia%2Fout.min.css
[2021-02-10 17:44:32.029] [main] [debug] loadLocalResource - being. requestUri=vscode-webview-resource://81374fcd-9910-4675-8dac-a10636112175/file///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.js
[2021-02-10 17:44:32.029] [main] [debug] loadLocalResource - found resource to load. requestUri=vscode-webview-resource://81374fcd-9910-4675-8dac-a10636112175/file///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.js, resourceToLoad=file:///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.js
[2021-02-10 17:44:32.030] [main] [trace] RequestService#request http://[::1]:36243/vscode-remote-resource?tkn=a8c7982c-9c5d-48e2-a617-03b14f27e82f&path=%2Fhome%2Fleandro%2F.vscode-server-insiders%2Fextensions%2Fmhutchie.git-graph-1.28.0%2Fmedia%2Fout.min.js
[2021-02-10 17:44:32.034] [main] [debug] loadLocalResource - Loaded over http(s). requestUri=vscode-webview-resource://81374fcd-9910-4675-8dac-a10636112175/file///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.css, response=200
[2021-02-10 17:44:32.036] [main] [debug] loadLocalResource - Loaded over http(s). requestUri=vscode-webview-resource://81374fcd-9910-4675-8dac-a10636112175/file///home/leandro/.vscode-server-insiders/extensions/mhutchie.git-graph-1.28.0/media/out.min.js, response=200

Each time I open VS Code it seems random if I'll get IPv4 or IPv6, don't know why.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 11, 2021

Thanks for checking. Closing but please let me know if you see this bug using the latest insiders builds of VS Code

@mjbvz mjbvz closed this as completed Feb 11, 2021
@mjbvz mjbvz added author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Feb 11, 2021
@cmamigonian
Copy link

What's the lead time for making this fix generally available?

@barroudjo
Copy link

I can confirm this fixes the issue in vscode insiders 1.54.0. And I can also confirm @leandro-manifesto diagnosis on vscode 1.53.2 as I also saw in the logs the ipv6 address without the [], resulting in 404s, when getting the js and css of git graph.

@alexr00
Copy link
Member

alexr00 commented Feb 26, 2021

Looks like this has been verified by two of the original people who saw this issue. Thanks for verifying!

@alexr00 alexr00 added the verified Verification succeeded label Feb 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2021
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 verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

9 participants