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 extra "Could not fetch remote environment error" when there's an issue with remote connection #135392

Closed
MikaelUmaN opened this issue Sep 17, 2021 · 12 comments
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue remote Remote system operations issues terminal Integrated terminal issues
Milestone

Comments

@MikaelUmaN
Copy link

Issue Type: Bug

  1. Start fresh container with --name xyz
  2. Attach in vs code
  3. Do work
  4. Stop container
    5 ...

Then:

A) Start container xyz
B) Attempt attach in vs code

Expected:

  • Attach successfully

Actual:

  • "Could not fetch remote environment"
  • "Websocket closed"

VS Code version: Code 1.60.1 (83bd43b, 2021-09-10T17:07:10.714Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
Fetching remote diagnostics for 'Container lyn-repo-01.brummer.se:8181/dr/jupyter-dotnet-datascience:latest (data)' failed: WebSocket close with status code 1006

System Info
Item Value
CPUs Intel(R) Xeon(R) W-2135 CPU @ 3.70GHz (12 x 3696)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 127.68GB (86.49GB free)
Process Argv --crash-reporter-id 4aa64e2a-13ea-4711-99fe-09f896d0328a
Screen Reader no
VM 0%

Fetching remote diagnostics for 'Container lyn-repo-01.brummer.se:8181/dr/jupyter-dotnet-datascience:latest (data)' failed: WebSocket close with status code 1006

Extensions: none
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt678:30270856
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805cf:30301675
pythonvspyt200:30340761
vscextlangct:30333562
binariesv615:30325510
vsccppwtct:30364498
pythonvssor306:30344512
bridge0708:30335490
pygetstartedt2:30360495
bridge0723:30353136
pythonrunftest32cf:30365367
pythonf5test824:30361777
javagetstartedt:30364666
pythonvspyt187:30365361
pydsgsc2:30361791
vscus224:30367819
vssid140cf:30363604
vssur157:30367808

@zhongjie-cai
Copy link

zhongjie-cai commented Sep 17, 2021

Same issue here. I am looking at running docker without Docker Desktop in Windows, and I have a following setup as docker compose that I start before attaching:

  • Dockerfile content:
FROM mcr.microsoft.com/vscode/devcontainers/base:alpine
  • docker-compose.yaml:
version: '3.3'

services:
  code:
    build:
      context: .
      dockerfile: ./Dockerfile
    container_name: 'code'
    volumes:
      - ..:/code:cached
    command: /bin/sh -c "while sleep 1000; do :; done"
    cap_add:
      - SYS_PTRACE
    security_opt:
      - seccomp:unconfined
  server:
    image: 'plantuml/plantuml-server:jetty'
    container_name: 'server'
    environment:
      PLANTUML_LIMIT_SIZE: 8192
    ports:
      - "8080:8080"
    expose:
      - "8080"
  • devcontainer.json:
{
	"name": "code",
	"dockerComposeFile": "./docker-compose.yaml",
	"service": "code",
	"shutdownAction": "stopCompose",
	"settings": {
		"terminal.integrated.shell.linux": "/bin/bash",
		"plantuml.render": "PlantUMLServer",
		"plantuml.server": "http://server:8080"
	},
	"workspaceFolder": "/code",
	"extensions": [
		"jebbs.plantuml"
	]
}

After the docker compose is up, attaching VS code to the code container yields the error message as Mikael described.

As Docker Desktop is no longer free of charge for commercial users, I would assume many people might start switching off using it for development, and therefore might browse the possibility of running docker without Docker Desktop, and thus could be seeing the same errors.

It'll be great if such error can be fixed; or if it is not a bug, maybe help us resolve our problem. Thanks!

@roblourens roblourens assigned chrmarti and unassigned roblourens Sep 17, 2021
@chrmarti
Copy link
Contributor

@MikaelUmaN Are you using Docker Desktop for Windows or some other type of installation? Is the problem still present using VS Code Insiders? (https://code.visualstudio.com/insiders/)

@zhongjie-cai How did you install Docker?

@chrmarti chrmarti transferred this issue from microsoft/vscode Sep 20, 2021
@MikaelUmaN
Copy link
Author

I am using Docker Desktop latest version.

I have had this problem for quite a while so I don't know that things would work better in the insider version.

I will give it a try when I can.

Can you tell me how I can provide more diagnostic info for you guys?

@chrmarti chrmarti changed the title Cannot fetch remove environment Could not fetch remote environment Sep 21, 2021
@chrmarti
Copy link
Contributor

@Tyriar This error message seems to originate from terminal code. Is there a way to diagnose this further?

@chrmarti chrmarti assigned Tyriar and unassigned chrmarti Sep 21, 2021
@maxpaj
Copy link

maxpaj commented Oct 3, 2021

I'm having a similar error. Can't start my WSL Ubuntu distro in VS Code, but it works fine through Powershell / cmd. Same error messages.

EDIT: Solved my issue. VM was missing network connectivity.

I turned on debugging for the extension (Settings -> Extensions > Remote - WSL) and got this in the terminal after reloading VS Code:

Log
[2021-10-03 13:10:27.072] Resolving wsl+ubuntu, resolveAttempt: 1
[2021-10-03 13:10:27.177] Starting VS Code Server inside WSL (Ubuntu)
[2021-10-03 13:10:27.177] Extension version: 0.58.2, Windows build: 19043. Multi distro support: available. WSL path support: enabled
[2021-10-03 13:10:27.177] No shell environment set or found for current distro.
[2021-10-03 13:10:27.353] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/7f6ab5485bbc008386c4386d08766667e155244e ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2021-10-03 13:10:27.536] Probing result: found
[2021-10-03 13:10:27.536] Server install found in WSL
[2021-10-03 13:10:27.538] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c 'env && VSCODE_WSL_DEBUG_INFO=true "$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 7f6ab5485bbc008386c4386d08766667e155244e stable .vscode-server 5000  ', cwd: undefined, env: {
[2021-10-03 13:10:27.538]   "ALLUSERSPROFILE": "C:\\ProgramData",
[2021-10-03 13:10:27.538]   "ANDROID_HOME": "C:\\Users\\maxim\\AppData\\Local\\Android\\Sdk",
[2021-10-03 13:10:27.538]   "ANDROID_SDK_ROOT": "C:\\Users\\maxim\\AppData\\Local\\Android\\Sdk",
[2021-10-03 13:10:27.538]   "APPDATA": "C:\\Users\\maxim\\AppData\\Roaming",
[2021-10-03 13:10:27.538]   "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true",
[2021-10-03 13:10:27.538]   "ChocolateyInstall": "C:\\ProgramData\\chocolatey",
[2021-10-03 13:10:27.538]   "ChocolateyLastPathUpdate": "132513301643109456",
[2021-10-03 13:10:27.538]   "ChocolateyToolsLocation": "C:\\tools",
[2021-10-03 13:10:27.538]   "CHROME_CRASHPAD_PIPE_NAME": "\\\\.\\pipe\\crashpad_17764_KXJWUJMLDTKUDVYK",
[2021-10-03 13:10:27.538]   "CommonProgramFiles": "C:\\Program Files\\Common Files",
[2021-10-03 13:10:27.538]   "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
[2021-10-03 13:10:27.538]   "CommonProgramW6432": "C:\\Program Files\\Common Files",
[2021-10-03 13:10:27.538]   "COMPUTERNAME": "FEDORA",
[2021-10-03 13:10:27.538]   "ComSpec": "C:\\WINDOWS\\system32\\cmd.exe",
[2021-10-03 13:10:27.538]   "DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
[2021-10-03 13:10:27.538]   "GOPATH": "C:\\Users\\maxim\\go",
[2021-10-03 13:10:27.538]   "GYP_MSVS_VERSION": "2015",
[2021-10-03 13:10:27.538]   "HOMEDRIVE": "C:",
[2021-10-03 13:10:27.538]   "HOMEPATH": "\\Users\\maxim",
[2021-10-03 13:10:27.538]   "IntelliJ IDEA": "C:\\Program Files\\JetBrains\\IntelliJ IDEA 2021.1\\bin;",
[2021-10-03 13:10:27.538]   "JAVA_HOME": "C:\\Program Files\\Java\\jdk1.8.0_202\\bin",
[2021-10-03 13:10:27.538]   "JetBrains Rider": "C:\\Program Files\\JetBrains\\JetBrains Rider 2020.3.3\\bin;",
[2021-10-03 13:10:27.538]   "LIBJABRA_TRACE_LEVEL": "debug",
[2021-10-03 13:10:27.539]   "LOCALAPPDATA": "C:\\Users\\maxim\\AppData\\Local",
[2021-10-03 13:10:27.539]   "LOGONSERVER": "\\\\FEDORA",
[2021-10-03 13:10:27.539]   "NUMBER_OF_PROCESSORS": "8",
[2021-10-03 13:10:27.539]   "OneDrive": "C:\\Users\\maxim\\OneDrive",
[2021-10-03 13:10:27.539]   "OneDriveConsumer": "C:\\Users\\maxim\\OneDrive",
[2021-10-03 13:10:27.539]   "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined",
[2021-10-03 13:10:27.539]   "OS": "Windows_NT",
[2021-10-03 13:10:27.539]   "Path": "C:\\Python39\\Scripts\\;C:\\Python39\\;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files\\Haskell\\bin;C:\\Program Files\\Haskell Platform\\8.6.3\\lib\\extralibs\\bin;C:\\Program Files\\Haskell Platform\\8.6.3\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\PuTTY\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\Haskell Platform\\8.6.3\\mingw\\bin;C:\\Program Files (x86)\\BaseX\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Kubernetes\\Minikube;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Go\\bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Git\\bin\\;C:\\Program Files\\Amazon\\AWSCLIV2\\;C:\\Program Files (x86)\\nodejs\\;;C:\\Program Files (x86)\\dotnet\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Users\\maxim\\.windows-build-tools\\python27;C:\\Users\\maxim\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin;C:\\Users\\maxim\\AppData\\Roaming\\npm\\node_modules\\windows-build-tools\\node_modules\\.bin;C:\\Users\\maxim\\AppData\\Roaming\\npm\\node_modules\\.bin;C:\\Python39\\Scripts\\;C:\\Python39\\;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files\\Haskell\\bin;C:\\Program Files\\Haskell Platform\\8.6.3\\lib\\extralibs\\bin;C:\\Program Files\\Haskell Platform\\8.6.3\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\PuTTY\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\Haskell Platform\\8.6.3\\mingw\\bin;C:\\Program Files (x86)\\BaseX\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Kubernetes\\Minikube;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Go\\bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\nodejs\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Program Files\\TortoiseSVN\\bin;C:\\Program Files\\Git\\bin\\;C:\\Users\\maxim\\.windows-build-tools\\python27\\;C:\\Users\\maxim\\AppData\\Roaming\\local\\bin;C:\\Users\\maxim\\AppData\\Roaming\\cabal\\bin;C:\\Users\\maxim\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\maxim\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files\\Amazon\\AWSCLI;C:\\Users\\maxim\\AppData\\Local\\Android\\Sdk;C:\\Users\\maxim\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\bin;C:\\Users\\maxim\\.dotnet\\tools;C:\\Users\\maxim\\go\\bin;C:\\ProgramData\\chocolatey\\lib\\ghc\\tools\\ghc-8.10.2\\bin;C:\\tools\\msys64;C:\\Program Files\\JetBrains\\JetBrains Rider 2020.3.3\\bin;C:\\Program Files\\JetBrains\\IntelliJ IDEA 2021.1\\bin;C:\\Users\\maxim\\.dotnet\\tools;C:\\Users\\maxim\\AppData\\Roaming\\npm",
[2021-10-03 13:10:27.539]   "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW",
[2021-10-03 13:10:27.539]   "PROCESSOR_ARCHITECTURE": "AMD64",
[2021-10-03 13:10:27.539]   "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 94 Stepping 3, GenuineIntel",
[2021-10-03 13:10:27.539]   "PROCESSOR_LEVEL": "6",
[2021-10-03 13:10:27.539]   "PROCESSOR_REVISION": "5e03",
[2021-10-03 13:10:27.539]   "ProgramData": "C:\\ProgramData",
[2021-10-03 13:10:27.539]   "ProgramFiles": "C:\\Program Files",
[2021-10-03 13:10:27.539]   "ProgramFiles(x86)": "C:\\Program Files (x86)",
[2021-10-03 13:10:27.539]   "ProgramW6432": "C:\\Program Files",
[2021-10-03 13:10:27.539]   "PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\AWS Tools\\PowerShell\\",
[2021-10-03 13:10:27.539]   "PUBLIC": "C:\\Users\\Public",
[2021-10-03 13:10:27.539]   "SESSIONNAME": "Console",
[2021-10-03 13:10:27.539]   "STACK_ROOT": "C:\\sr",
[2021-10-03 13:10:27.539]   "SystemDrive": "C:",
[2021-10-03 13:10:27.539]   "SystemRoot": "C:\\WINDOWS",
[2021-10-03 13:10:27.539]   "TEMP": "C:\\Users\\maxim\\AppData\\Local\\Temp",
[2021-10-03 13:10:27.539]   "TMP": "C:\\Users\\maxim\\AppData\\Local\\Temp",
[2021-10-03 13:10:27.539]   "USERDOMAIN": "FEDORA",
[2021-10-03 13:10:27.539]   "USERDOMAIN_ROAMINGPROFILE": "FEDORA",
[2021-10-03 13:10:27.539]   "USERNAME": "maxim",
[2021-10-03 13:10:27.539]   "USERPROFILE": "C:\\Users\\maxim",
[2021-10-03 13:10:27.539]   "VBOX_MSI_INSTALL_PATH": "C:\\Program Files\\Oracle\\VirtualBox\\",
[2021-10-03 13:10:27.539]   "windir": "C:\\WINDOWS",
[2021-10-03 13:10:27.539]   "_MSYS2_BASH": "C:\\tools\\msys64\\usr\\bin\\bash.exe",
[2021-10-03 13:10:27.539]   "_MSYS2_PREFIX": "x86_64",
[2021-10-03 13:10:27.539]   "VSCODE_WSL_EXT_LOCATION": "c:\\Users\\maxim\\.vscode\\extensions\\ms-vscode-remote.remote-wsl-0.58.2",
[2021-10-03 13:10:27.539]   "WSLENV": "VSCODE_WSL_EXT_LOCATION/up"
[2021-10-03 13:10:27.539] }}
[2021-10-03 13:10:27.651] USER=maxpaj
[2021-10-03 13:10:27.651] VSCODE_WSL_EXT_LOCATION=/mnt/c/Users/maxim/.vscode/extensions/ms-vscode-remote.remote-wsl-0.58.2
[2021-10-03 13:10:27.651] SHLVL=0
[2021-10-03 13:10:27.651] HOME=/home/maxpaj
[2021-10-03 13:10:27.651] WSL_DISTRO_NAME=Ubuntu
[2021-10-03 13:10:27.651] LOGNAME=maxpaj
[2021-10-03 13:10:27.651] NAME=FEDORA
[2021-10-03 13:10:27.651] WSL_INTEROP=/run/WSL/1655_interop
[2021-10-03 13:10:27.651] _=/usr/bin/sh
[2021-10-03 13:10:27.651] TERM=xterm-256color
[2021-10-03 13:10:27.651] PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Python39/Scripts/:/mnt/c/Python39/:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/Haskell/bin:/mnt/c/Program Files/Haskell Platform/8.6.3/lib/extralibs/bin:/mnt/c/Program Files/Haskell Platform/8.6.3/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Haskell Platform/8.6.3/mingw/bin:/mnt/c/Program Files (x86)/BaseX/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Kubernetes/Minikube:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Go/bin:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/bin/:/mnt/c/Program Files/Amazon/AWSCLIV2/:/mnt/c/Program Files (x86)/nodejs/:/mnt/c/Program Files (x86)/dotnet/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/maxim/.windows-build-tools/python27:/mnt/c/Users/maxim/AppData/Roaming/npm/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/c/Users/maxim/AppData/Roaming/npm/node_modules/windows-build-tools/node_modules/.bin:/mnt/c/Users/maxim/AppData/Roaming/npm/node_modules/.bin:/mnt/c/Python39/Scripts/:/mnt/c/Python39/:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/Haskell/bin:/mnt/c/Program Files/Haskell Platform/8.6.3/lib/extralibs/bin:/mnt/c/Program Files/Haskell Platform/8.6.3/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Haskell Platform/8.6.3/mingw/bin:/mnt/c/Program Files (x86)/BaseX/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Kubernetes/Minikube:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Go/bin:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/nodejs/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Program Files/TortoiseSVN/bin:/mnt/c/Program Files/Git/bin/:/mnt/c/Users/maxim/.windows-build-tools/python27/:/mnt/c/Users/maxim/AppData/Roaming/local/bin:/mnt/c/Users/maxim/AppData/Roaming/cabal/bin:/mnt/c/Users/maxim/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/maxim/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Program Files/Amazon/AWSCLI:/mnt/c/Users/maxim/AppData/Local/Android/Sdk:/mnt/c/Users/maxim/AppData/Local/Programs/Microsoft VS Code Insiders/bin:/mnt/c/Users/maxim/.dotnet/tools:/mnt/c/Users/maxim/go/bin:/mnt/c/ProgramData/chocolatey/lib/ghc/tools/ghc-8.10.2/bin:/mnt/c/tools/msys64:/mnt/c/Program Files/JetBrains/JetBrains Rider 2020.3.3/bin:/mnt/c/Program Files/JetBrains/IntelliJ IDEA 2021.1/bin:/mnt/c/Users/maxim/.dotnet/tools:/mnt/c/Users/maxim/AppData/Roaming/npm
[2021-10-03 13:10:27.651] LANG=C.UTF-8
[2021-10-03 13:10:27.651] SHELL=/bin/bash
[2021-10-03 13:10:27.651] PWD=/mnt/c/Users/maxim/AppData/Local/Programs/Microsoft VS Code
[2021-10-03 13:10:27.651] HOSTTYPE=x86_64
[2021-10-03 13:10:27.651] WSLENV=VSCODE_WSL_EXT_LOCATION/up
[2021-10-03 13:10:27.955] Setting up server environment: Looking for /home/maxpaj/.vscode-server/server-env-setup. Not found.
[2021-10-03 13:10:27.955] WSL version: 5.10.16.3-microsoft-standard-WSL2 Ubuntu
[2021-10-03 13:10:27.955] WSL2-shell-PID: 1658
[2021-10-03 13:10:27.955] Starting server: /home/maxpaj/.vscode-server/bin/7f6ab5485bbc008386c4386d08766667e155244e/server.sh  --port=0 --use-host-proxy --without-browser-env-var --disable-websocket-compression --print-ip-address --enable-remote-auto-shutdown  --log=trace 
[2021-10-03 13:10:27.955] 
[2021-10-03 13:10:27.955] 
[2021-10-03 13:10:27.955] *
[2021-10-03 13:10:27.955] * Visual Studio Code Server
[2021-10-03 13:10:27.955] *
[2021-10-03 13:10:27.955] * Reminder: You may only use this software with Visual Studio family products,
[2021-10-03 13:10:27.955] * as described in the license https://aka.ms/vscode-remote/license
[2021-10-03 13:10:27.955] *
[2021-10-03 13:10:27.955] 
[2021-10-03 13:10:27.955] Extension host agent listening on 45033
[2021-10-03 13:10:27.955] 
[2021-10-03 13:10:27.960] WSL resolver response: ::1:45033
[2021-10-03 13:10:27.960] To debug connection issues, open a local browser on http://[::1]:45033/version
[2021-10-03 13:10:27.960] No extension host environment set
[2021-10-03 13:10:27.962] + LOGGING_ARGS=--log=trace
[2021-10-03 13:10:27.962] + [ ! -d /home/maxpaj/.vscode-server ]
[2021-10-03 13:10:27.962] + CODE_PROFILE=/home/maxpaj/.vscode-server/server-env-setup
[2021-10-03 13:10:27.962] + printf Setting up server environment: Looking for %s.  /home/maxpaj/.vscode-server/server-env-setup
[2021-10-03 13:10:27.962] + [ -f /home/maxpaj/.vscode-server/server-env-setup ]
[2021-10-03 13:10:27.962] + echo Not found.
[2021-10-03 13:10:27.962] + VSCODE_REMOTE_BIN=/home/maxpaj/.vscode-server/bin
[2021-10-03 13:10:27.962] + uname -r
[2021-10-03 13:10:27.962] + WSL_VERSION=5.10.16.3-microsoft-standard-WSL2
[2021-10-03 13:10:27.962] + echo WSL version: 5.10.16.3-microsoft-standard-WSL2 Ubuntu
[2021-10-03 13:10:27.962] + dirname /mnt/c/Users/maxim/.vscode/extensions/ms-vscode-remote.remote-wsl-0.58.2/scripts/wslServer.sh
[2021-10-03 13:10:27.962] + /mnt/c/Users/maxim/.vscode/extensions/ms-vscode-remote.remote-wsl-0.58.2/scripts/wslDownload.sh 7f6ab5485bbc008386c4386d08766667e155244e stable /home/maxpaj/.vscode-server/bin
[2021-10-03 13:10:27.962] + [ ! -d /home/maxpaj/.vscode-server/bin/7f6ab5485bbc008386c4386d08766667e155244e ]
[2021-10-03 13:10:27.962] + RC=0
[2021-10-03 13:10:27.962] + [ 0 -ne 0 ]
[2021-10-03 13:10:27.962] + POLLING_ARGS=
[2021-10-03 13:10:27.962] + uname -r
[2021-10-03 13:10:27.962] + echo WSL2-shell-PID: 1658
[2021-10-03 13:10:27.962] + echo Starting server: /home/maxpaj/.vscode-server/bin/7f6ab5485bbc008386c4386d08766667e155244e/server.sh  --port=0 --use-host-proxy --without-browser-env-var --disable-websocket-compression --print-ip-address --enable-remote-auto-shutdown  --log=trace 
[2021-10-03 13:10:27.962] + [ -f /etc/alpine-release ]
[2021-10-03 13:10:27.962] + uname -m
[2021-10-03 13:10:27.962] + [ x86_64 = aarch64 ]
[2021-10-03 13:10:27.962] + export VSCODE_AGENT_FOLDER=/home/maxpaj/.vscode-server
[2021-10-03 13:10:27.962] + /home/maxpaj/.vscode-server/bin/7f6ab5485bbc008386c4386d08766667e155244e/server.sh  --port=0 --use-host-proxy --without-browser-env-var --disable-websocket-compression --print-ip-address --enable-remote-auto-shutdown  --log=trace

I went into the VM and tried to find the VS Code extension files and eventually noticed that the machine didn't have network connectivity. Which led me to this microsoft/WSL#5336 (comment). Now the machine has network connectivity and I can access the VM through VS Code.

@Tyriar
Copy link
Member

Tyriar commented Oct 4, 2021

@chrmarti you could check why

const remoteEnv = await this._remoteAgentService.getEnvironment();
is returning null

@chrmarti
Copy link
Contributor

chrmarti commented Oct 5, 2021

I see null would be returned if there was some error and also as a fallback when the channel is not established: https://github.com/microsoft/vscode/blame/main/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts#L55

@alexdima Can we add logging for these two cases? If we are hitting this code path too often for logging each time, we could maybe throw / propagate an error and log it in those cases where this is fatal.

@chrmarti chrmarti assigned alexdima and unassigned Tyriar Oct 5, 2021
@alexdima
Copy link
Member

alexdima commented Oct 7, 2021

@Tyriar I think I added the throw here when you were out last year. It is expected that sometimes we cannot connect to a remote, so it is expected that the env will be null in those cases. This connection error is handled somewhere else (it can even be delegated to be handled by the resolver extension). So, although an error case, it is expected that the environment is null and most pieces of code should try to not complain too loudly about that. But last year (when you were out), I could not figure out how to hook into our system a terminal process that is "dead"/"N/A"/etc. So I'd like to ask you what we can do to fail the creation of a terminal but in a silent way.

@Tyriar
Copy link
Member

Tyriar commented Oct 7, 2021

@chrmarti would a silent error be good here? Normally all terminals that fail launch show a notification

@github-actions
Copy link

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!

@chrmarti
Copy link
Contributor

@alexdima null seems to indicate cancel due to some problem then? Is the cause of it logged somewhere? If so, silently failing the terminal's creation sounds fine, otherwise the original cause could be thrown as an error for the terminal error handling to log and display.

@chrmarti chrmarti reopened this Oct 19, 2021
@alexdima
Copy link
Member

alexdima commented Oct 19, 2021

Is the cause of it logged somewhere?

Yes, the error is logged and handled somewhere else. But in our system we have tens of callers to IRemoteAgentService.getEnvironment(). It is expected that IRemoteAgentService.getEnvironment() will return null. Callers of IRemoteAgentService.getEnvironment() need to be able to handle null without throwing.

When I implemented terminal reconnection last year I was not familiar enough with the terminal code-base in order to handle the null value silently. This throw statement should be removed by someone familiar with the terminal code-base. The implication is that createProcess should be allowed to return null if it cannot create a terminal, silently. That will cause a ripple in the terminal code-base. But maybe the code can return a fake ITerminalChildProcess that doesn't do anything, I don't know what is best suited here.

@alexdima alexdima assigned meganrogge and unassigned alexdima Oct 19, 2021
@Tyriar Tyriar transferred this issue from microsoft/vscode-remote-release Oct 19, 2021
@Tyriar Tyriar added polish Cleanup and polish issue remote Remote system operations issues terminal Integrated terminal issues labels Oct 19, 2021
@Tyriar Tyriar added this to the October 2021 milestone Oct 19, 2021
@Tyriar Tyriar changed the title Could not fetch remote environment An extra "Could not fetch remote environment error" when there's an issue with remote connection Oct 19, 2021
@Tyriar Tyriar assigned meganrogge and unassigned meganrogge Oct 19, 2021
@meganrogge meganrogge removed their assignment Oct 20, 2021
@Tyriar Tyriar closed this as completed in 91d2bdd Oct 20, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue remote Remote system operations issues terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

9 participants