vscode: `code serve-web` fails when offline

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.85.2
  • OS Version: Linux x64

Steps to Reproduce:

  1. Fire up code serve-web once, and play around with it
  2. Shut it down
  3. Disconnect from the internet
  4. Try to fire up code serve-web again

What should happen:

According to https://github.com/microsoft/vscode/issues/197747#issuecomment-1804296012, it should continue to use the last downloaded version.

What actually happens:

Error serving request: Could not check for update: error requesting https://update.code.visualstudio.com/api/latest/server-linux-x64-web/stable: error sending request for url (https://update.code.visualstudio.com/api/latest/server-linux-x64-web/stable): error trying to connect: dns error: failed to lookup address information: Name does not resolve

Here’s the full command line:

/tools/vscode/code serve-web --disable-telemetry --without-connection-token --accept-server-license-terms --user-data-dir /home/user/.local/vscode/User --server-data-dir /home/user/.local/vscode/Server --cli-data-dir /home/user/.local/vscode/Cli --extensions-dir /tools/vscode/extensions --port 7050 --host 0.0.0.0

I recognize that this is a duplicate of #197747, but the linked comment above suggests that in fact the behavior documented here should not be happening. The contents of the serve-web directory are up to date:

bash-5.1$ pwd
/home/user/.local/vscode/Cli/serve-web
bash-5.1$ ls -l
total 8
drwxr-sr-x 7 1002 23456 4096 Jan 21 23:05 8b3775030ed1a69b13e4f4c628c612102e30a681
-rw-rw-r-- 1 1002 23456   44 Jan 22 01:06 lru.json

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17 (9 by maintainers)

Most upvoted comments

@connor4312 the PR in flight (#213233) only seems to leverage the cache once UpdateCheckFailed happens. I feel like I have seen cases where, while offline, the request to update.code.visualstudio.com does not fail immediately, but hangs for a long time/seemingly forever.

Would you be open to a PR where an additional command line flag like --use-cached-server were added so that the user can opt to explicitly use the cached server (and skip the update.code.visualstudio.com request altogether) rather than have to wait for UpdateCheckFailed to occur?

@connor4312 the PR in flight (#213233) only seems to leverage the cache once UpdateCheckFailed happens. I feel like I have seen cases where, while offline, the request to update.code.visualstudio.com does not fail immediately, but hangs for a long time/seemingly forever.

Would you be open to a PR where an additional command line flag like --use-cached-server were added so that the user can opt to explicitly use the cached server (and skip the update.code.visualstudio.com request altogether) rather than have to wait for UpdateCheckFailed to occur?

+1 this would be a great idea