code-server: Fresh install on alpine returns 500
OS/Web Information
- Web Browser: firefox 89.0.1 (64-bit)
- Local OS: Alpine Linux v3.14
- Remote OS: Alpine Linux v3.14 (same as local)
- Remote Architecture: x64
- code-server --version: 3.11.0 4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd
Steps to reproduce
- Fresh install
code-serverthe npm way:
apk add npm alpine-sdk bash libstdc++ libc6-compat
npm config set python python3
npm install -g --unsafe-perm code-server
- Open
localhost:8080in a browser, on the same system - Provide the password automatically generated in
~/.config/code-server/config.yaml
Expected
The browser is able to connect to and display vscode.
Actual
The error 500 VS Code failed to load. exited unexpectedly with code 0 is displayed on screen.
Logs
# code-server --log trace
[2021-08-01T00:37:46.835Z] trace child:16034 got message {"message":{"type":"handshake","args":{"_":[],"bind-addr":"127.0.0.1:8080","auth":"password","password":"2f5b20cead0a8f27ac2b84ad","config":"/root/.config/code-server/config.yaml","log":"trace","user-data-dir":"/root/.local/share/code-server","extensions-dir":"/root/.local/share/code-server/extensions","verbose":true,"host":"127.0.0.1","port":8080,"proxy-domain":[],"usingEnvPassword":false,"usingEnvHashedPassword":false}}}
[2021-08-01T00:37:46.838Z] info code-server 3.11.0 4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd
[2021-08-01T00:37:46.838Z] info Using user-data-dir ~/.local/share/code-server
[2021-08-01T00:37:46.839Z] trace Using extensions-dir ~/.local/share/code-server/extensions
[2021-08-01T00:37:46.852Z] info Using config file ~/.config/code-server/config.yaml
[2021-08-01T00:37:46.852Z] info HTTP server listening on http://127.0.0.1:8080
[2021-08-01T00:37:46.852Z] info - Authentication is enabled
[2021-08-01T00:37:46.852Z] info - Using password from ~/.config/code-server/config.yaml
[2021-08-01T00:37:46.852Z] info - Not serving HTTPS
[2021-08-01T00:37:50.666Z] trace heartbeat
[2021-08-01T00:37:50.685Z] debug forking vs code...
[2021-08-01T00:37:51.025Z] error VS Code exited unexpectedly with code 0
[2021-08-01T00:37:51.876Z] debug forking vs code...
[2021-08-01T00:37:52.216Z] error VS Code exited unexpectedly with code 0
Screenshot
Notes
I don’t know if this is related, but the only user on my system is root (~ is /root).
What’s weird is, if I install code-server in a custom docker image using exactly the above script, I can actually start the server and connect to it without any issue (I encountered some issues when trying to use the c++ extension in a docker container, so I wanted to try a bare metal install).
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (9 by maintainers)
Okay so I tried again and it all worked. The key for me was to do everything on the root user, have both
npm configandyarn configset, and I also took a peek at thelibc6-compatpackage from alpine, the package sets a few symlinks and I have also done that (we don’t have that package for void).I can now run the server with my non-root user, the terminal also works. Thank you for the information!
I tried on Alpine and it worked. I followed https://github.com/cdr/code-server/blob/main/docs/npm.md#alpine but I had to additionally install
python3and I used yarn to set the config option instead of npm.From there I went to localhost:8080 in my browser and made sure the terminal worked (which it did).
Hmm interesting. Were you able to confirm that you have the same
spdlogfile structure I do?I think going into
lib/vscodeand runningyarnfrom there might be the next step.Thanks for the feedback! Actually, I ran the scipt twice, the logs were from the second run (so the dependencies were probably already downloaded). I can fresh install over again and send the logs of the first run tomorrow.
I’ve encountered other issues recently related to my nvidia graphics drivers, maybe is this related. For instance, I cannot load opengl 3d scenes with either firefox or chromium, because alpine lacks native support for this kind of application, and I can’t install the drivers because they seem to require glibc, where musl is instead shipped in alpine by default.
[EDIT] However, it doesn’t make sense to me that it would work to fresh install code-server in a docker container, but not on bare metal (using the same version of the same distro in both cases). So this should be unrelated actually.
Yes thank you for those logs!
The
npm rebuildoutput seems strange to me. It doesn’t seem to have actually rebuilt anything? Mine has lines like these:EDIT: These stars are package names but GitHub seems to have mangled them into asterisks thinking they are email addresses or something.
Maybe the dependencies didn’t actually download? It says the postinstall completed in 13 seconds which seems way too fast (for reference my Alpine Docker container took 173 seconds).
As a random sampling here’s what my spdlog build directory looks like:
No, it still doesn’t. Exactly the same error message as in the original post is displayed when I try to connect from firefox. I wonder what’s going on.
Pulling the image
codercom/code-server:latestsimply works out of the box, so maybe is my system configuration different from what the software expects.I just tried this:
You’ll find the output logs (stderr + stdout) included in the footer of this comment. Nothing seems out of place here neither.
Are there any known fixes for related issues currently (i.e. related to the
500 VS Code failed to load. exited unexpectedly with code 0error)?output
(click to show)
Hi @code-asher and @jsjoeio, thanks for the fast response!
I tried to reinstall code-server locally (after uninstalling it) with the verbose loglevel:
You can find stderr and stdout separately below.
Hopefully it’s not too hard to navigate through these logs. If you want me to share other information, don’t hesitate to ping me!
stderr
(click to show)
stdout
(click to show)