Skip to content

[Bug]: When using the command "code-server --install-extension", a failed installation returns exit code 0 #6367

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

Closed
4 tasks done
SantiSuarezMS opened this issue Aug 3, 2023 · 13 comments
Labels
bug Something isn't working upstream:vscode Needs to be fixed upstream in VSCode

Comments

@SantiSuarezMS
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Local OS: macOS
  • Remote OS: Ubuntu
  • Remote Architecture: amd64
  • code-server --version: 4.11.0

Steps to Reproduce

  1. On the Terminal run code-server --install-extension non.existing-extension && echo "Exit code: " "$?"
  2. Wait for the command to finish and check the output.

Expected

At the end of the output it should read:

Exit code:  1

Or any other non 0 appropriate exit code.

Actual

At the end of the output it reads:

Exit code:  1

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

As part of a pipeline, I have a script that install some extensions using code-server --install-extension, whenever one of the installed extensions fails I expect the whole script to fail, cascading to the pipeline fail so I can take action.
Instead, as it is returning 0 even when the task is failing, the build finishes with a false success.

@SantiSuarezMS SantiSuarezMS added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Aug 3, 2023
@turbotimon
Copy link

turbotimon commented Jan 11, 2024

@SantiSuarezMS don't you mean: "Actual: At the end of the output it reads: Exit code 0" (instead of 1) ?

I consider this a bug as well, or at least bad UX, as one can not use this command in a script and react to failing. Any comments from a contributor/developer on this?

@benz0li
Copy link
Contributor

benz0li commented Jan 11, 2024

I can reproduce this in GitHub Codespaces.

@benz0li
Copy link
Contributor

benz0li commented Jan 11, 2024

And it is present in both <install-path>/bin/code-server (i.e. code-server called from Terminal) as well as <install-path>/lib/vscode/bin/remote-cli/code-server (i.e. code-server called from code-server's Terminal).

IMHO rather a vscode (remote-cli) issue than a code-server issue.

@turbotimon
Copy link

turbotimon commented Jan 11, 2024

not exactly sure what you mean by "vscode (remot-cli)" but ms vscode (v1.84.2) behaves correctly: code --install-extension non.existing-extension will return 1. vscodium as well behaves correctly.

@code-asher
Copy link
Member

code-asher commented Jan 11, 2024

Yeah in the integrated terminal we just use the script that comes bundled with VS Code (the server/web CLI is different than the native one) so it sounds like an upstream bug.

@code-asher
Copy link
Member

code-asher commented Jan 11, 2024

We can fix what we can on our end though, the one that runs outside the integrated terminal. Will push that fix in a bit.

Edit: This one still does not quite work because the error does not appear to propagate so there is nothing to catch, but that needs to be fixed upstream.

code-asher added a commit that referenced this issue Jan 11, 2024
Addresses part of #6367.  The script bundled with VS Code still has the
same problem but it would be better to fix that one upstream.
@turbotimon
Copy link

Can we please an issue on the upstream repo then? I would like to do so, but as i'm not familiar with the server/web CLI version, i'm not sure where to place and how to describe it correctly..

@code-asher
Copy link
Member

Sorry for letting this fall through the cracks. If someone wants to submit this upstream, I think it should be sufficient to reproduce in Codespaces (I believe the command there will be code though and not code-server) and use that information to open the issue.

@michaelbrewer
Copy link

note this does work as expected in the microsoft code-server version

@code-asher
Copy link
Member

I tested after updating to 1.88.0 but unfortunately the problem persists. Not sure why Microsoft's works. 🤔 Does it work within the integrated terminal as well, or only outside? Codespace's is still broken too.

@code-asher
Copy link
Member

Ah nevermind I tested, it does not work in the integrated terminal with Microsoft's either.

@code-asher
Copy link
Member

Wait, I see why. I can fix the exit code from the external script, but the one from the integrated terminal is still an upstream bug.

code-asher added a commit that referenced this issue Apr 6, 2024
Addresses the part of #6367 that we can fix.
@code-asher
Copy link
Member

I will go ahead and close this as an upstream bug.

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
@code-asher code-asher added upstream:vscode Needs to be fixed upstream in VSCode and removed triage This issue needs to be triaged by a maintainer labels Jul 12, 2024
yiliang114 pushed a commit to yiliang114/code-server that referenced this issue Jan 23, 2025
Addresses part of coder#6367.  The script bundled with VS Code still has the
same problem but it would be better to fix that one upstream.
yiliang114 pushed a commit to yiliang114/code-server that referenced this issue Jan 23, 2025
Addresses the part of coder#6367 that we can fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream:vscode Needs to be fixed upstream in VSCode
Projects
None yet
Development

No branches or pull requests

5 participants