coder / code-server

VS Code in the browser
https://coder.com
MIT License
67.89k stars 5.58k forks source link

[Bug]:When starting the service with the --install-extension command, the code-server process will quickly end itself #6720

Closed 030525 closed 6 months ago

030525 commented 6 months ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

run command with --install-extension like : nohup ./code-server --port 5000 --host 0.0.0.0 --auth password --install-extension ms-python.python > mylog.out 2>&1 &

Expected

the code-server process should persist

Actual

code-server suicide in seconds

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

Are you accessing code-server over a secure context?

Notes

remove --install-extension , code-server works again

030525 commented 6 months ago

Does anyone know why it happened? This happens when I always start the service with the command with --install-extension. Even if I already have these extensions Or it may be related to the fact that I imported an external configuration file.

code-asher commented 6 months ago

--install-extension is not a service, it is meant to install the extension then exit (the same behavior as native VS Code and GitHub Codespaces).

You will want something like:

./code-server --install-extension ms-python.python > mylog.out 2>&1
nohup ./code-server --port 5000 --host 0.0.0.0 > mylog.out 2>&1 &
030525 commented 6 months ago

You are right, because the extension only needs to be downloaded once, instead of having --install-extension every time you start the service, so downloading the extension and starting the service should be two commands, and I mistakenly confused them together. I'm sorry that I don't know how to use it