microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.69k stars 296 forks source link

net::ERR_CONTENT_LENGTH_MISMATCH returning large content when port-forwarding from devcontainer #9969

Open rokos-angus opened 5 months ago

rokos-angus commented 5 months ago

Type: Bug

VSCode 1.91.0-insider (reproducible with latest stable release) Docker version 25.0.3, build 4debf41 (installed within WSL, not docker desktop)

Run local devcontainer within WSL (ubuntu 22.04 image) Run any http webserver and port forward with vscode to windows host (I have best luck reproducing with flask python server) Access content from windows host browser. This seems to depend on the size of the content, most reliable when it is at least >100kb

Expected Behavior Content is successfully displayed in the browser

Actual Behavior Content appears to be truncated, browser logs Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH

It is worth noting that this issue does NOT happen when running and port forwarding the application in WSL directly, ONLY when running in a devcontainer

Extension version: 0.372.0 VS Code version: Code - Insiders 1.91.0-insider (21decd9342dd2e14f2a7cd2883f84e6ff43ea0df, 2024-06-11T06:46:21.055Z) OS version: Windows_NT x64 10.0.22621 Modes: Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|13th Gen Intel(R) Core(TM) i9-13900K (32 x 2995)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|127.76GB (68.02GB free)| |Process Argv|--crash-reporter-id 134e0632-6bb4-4424-ba75-d813c8e8d17a| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Dev Container| |OS|Linux x64 5.15.146.1-microsoft-standard-WSL2| |CPUs|13th Gen Intel(R) Core(TM) i9-13900K (32 x 0)| |Memory (System)|62.68GB (56.87GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.146.1-microsoft-standard-WSL2| |CPUs|13th Gen Intel(R) Core(TM) i9-13900K (32 x 0)| |Memory (System)|62.68GB (56.87GB free)| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 vsaa593cf:30376535 py29gd2263:31024238 c4g48928:30535728 2i9eh265:30646982 962ge761:30841072 pythongtdpath:30726887 welcomedialog:30812478 pythonidxpt:30768918 pythonnoceb:30776497 asynctok:30898717 dsvsc013:30777762 dsvsc014:30777825 dsvsc015:30821418 pythontestfixt:30866404 pythonregdiag2:30926734 pythonmypyd1:30859725 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30870582 dsvsc016:30879898 dsvsc017:30880771 dsvsc018:30880772 cppperfnew:30980852 pythonait:30973460 jchc7451:31067543 showvideot:31016890 chatpanelt:31014475 g316j359:31013175 a69g1124:31018687 dvdeprecation:31040973 pythonprt:31036556 dwnewjupytercf:31046870 2f103344:31071589 nb_pri_only:31057983 fa862199:31048878 nativerepl1:31071684 ```
chrmarti commented 5 months ago

Can you compare what the browser gets with the original? The WSL and Dev Containers extensions use the same port forwarding implementation, not sure what could cause this.

rokos-angus commented 5 months ago

Not quite sure what you mean by "the original" I have created a reproduction repo at https://github.com/rokos-angus/devcontainer-content-mismatch

Using this project I consistently see the content mismatch error in the devcontainer here but not windows or wsl. Interested if you see similar

Container: image

WSL: image

chrmarti commented 5 months ago

Seeing it with Docker in WSL. I didn't see it on Mac. Using PowerShell to download from Docker in WSL shows that it sometimes works and sometimes doesn't get all bytes. Maybe we're closing some stream too early? /cc @alexr00

vscodenpa commented 5 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

rokos-angus commented 5 months ago

@chrmarti @alexr00 what more info did you need? Seems it was reproducible

JamesStratford commented 2 weeks ago

I'm dealing with this issue also. Dev container on WSL over remote-ssh.

Running Plotly Dash with Flask backend

About 50% of the time on page load I get net::ERR_CONTENT_LENGTH_MISMATCH