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

code serve-web fails when offline #202967

Open
mcg1969 opened this issue Jan 22, 2024 · 10 comments · May be fixed by #213233
Open

code serve-web fails when offline #202967

mcg1969 opened this issue Jan 22, 2024 · 10 comments · May be fixed by #213233
Assignees
Labels
code-cli feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors
Milestone

Comments

@mcg1969
Copy link

mcg1969 commented Jan 22, 2024

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 #197747 (comment), 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
@connor4312
Copy link
Member

connor4312 commented Jan 23, 2024

The most recent version is cached only on memory, and does not persist between restarts. This is something we could add. Code pointer:

pub async fn get_latest_release(&self) -> Result<Release, CodeError> {

@connor4312 connor4312 added feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors code-cli labels Jan 23, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Jan 23, 2024
@mcg1969
Copy link
Author

mcg1969 commented Jan 23, 2024

It seems to me you can obtain the last saved version from lru.json ... or as the name implies, the most recently used, which might be even better. In fact, this is a separate issue, but I would prefer the ability to disable the check altogether if a saved version exists.

@microsoft microsoft deleted a comment from VSCodeTriageBot Jan 23, 2024
@weartist
Copy link
Contributor

I'll try to submit a PR to fix this

@Charlie-H7
Copy link

@weartist Are you still working on this?

@weartist
Copy link
Contributor

weartist commented Apr 3, 2024

@weartist Are you still working(工作) on this?

Sorry I didn't continue this anymore, if anyone is interested, you can continue this PR

@codewithunknown
Copy link

codewithunknown commented May 22, 2024

Hello 👋,

Currently, I'm exploring VSCode to contribute . I might be having difficulty understanding the issue. Link.

Here are the steps I've followed:

  • I set up VSCode on my local machine.
  • I installed all dependencies.
  • I ran yarn && ./scripts/code.sh in the terminal.
  • I then ran code serve-web. It opened a new VSCode window with the internet connection open. However, when I disconnected from the internet and ran the same command again, there were no errors as mentioned above. It still opened a new VSCode window.

Can anyone please assist me with this for contributing?

image

@RitamM16
Copy link

RitamM16 commented May 22, 2024

Hello @connor4312 , I have raised a PR #213233 solving this issue

@RitamM16
Copy link

Hello 👋,

Currently, I'm exploring VSCode to contribute . I might be having difficulty understanding the issue. Link.

Here are the steps I've followed:

* I set up VSCode on my local machine.

* I installed all dependencies.

* I ran` yarn && ./scripts/code.sh` in the terminal.

* I then ran `code serve-web`. It opened a new VSCode window with the internet connection open. However, when I disconnected from the internet and ran the same command again, there were no errors as mentioned above. It still opened a new VSCode window.

Can anyone please assist me with this for contributing?

image

This is something I have also faced when trying to use the command in WSL

@codewithunknown
Copy link

Great @RitamM16 🙌,

but can you please help me in understand the issue and also check this Link and help me in understand vscode for contributing

also for starting vscode from local code I am using

./scripts/code.sh

is this correct approach also what if i had changes in my code and needs to restart or re-compiled what command should be used

one last doubt I facing huge confusion in understanding which folder contains the relevant code😅
can you please help me in this

@RitamM16
Copy link

😅 Honestly I have also just jumped into this code base. I am also figuring things out myself.
I mostly ignored most of the setup steps and went to the cli directory directly, which had the rust code and was easy enough to start by following the CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-cli feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants