Closed ljleb closed 3 years ago
Thanks for the details @lebel-louisjacob! I really wish we had a better way to debug these issues 🤔
I wonder if there could be a dependency missing or something. cc @code-asher - any ideas? (P.S. I know I've asked for help on similar issues. I always forget where we keep that list of dependencies we expect them to have. I promise this time I'll update our docs so I can stop bugging you 😂)
Ahaha yup I'm not sure if npm install -g
swallows the logs like yarn global add
does but if it doesn't then posting the install logs could
help us figure out the issue.
If it does swallow the logs then moving to the install directory then
going to lib/vscode
and running npm rebuild
and posting those logs
might work.
Hi @code-asher and @jsjoeio, thanks for the fast response!
I tried to reinstall code-server locally (after uninstalling it) with the verbose loglevel:
npm uninstall -g --unsafe-perm code-server > /dev/null 2>&1
npm install --loglevel verbose -g --unsafe-perm code-server
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!
Thanks for the logs! Nothing looks out of place there 🤔
If it does swallow the logs then moving to the install directory then going to
lib/vscode
and runningnpm rebuild
and posting those logs might work.
Did you give this a try?
I just tried this:
cd /usr/local/lib/node_modules/code-server/lib/vscode
npm --loglevel verbose rebuild
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 0
error)?
Great! Now when you run code-server
does it work as expected?
Are there any known fixes for related issues currently (i.e. related to the 500 VS Code failed to load. exited unexpectedly with code 0 error)?
Not that I'm aware. Usually that means vscode didn't build properly 🤔 cc @code-asher
Great! Now when you run
code-server
does it work as expected?
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:latest
simply works out of the box, so maybe is my system configuration different from what the software expects.
Argh, sorry that didn't work.
Hmm, well at least that works.
The other thing I can try to do is create a workspace on our enterprise platform using Alpine Linux v3.14 in the base image and then install code-server with the install script to see if that reproduces.
Yes thank you for those logs!
The npm rebuild
output 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.
npm info run ***@***.*** install node_modules/native-is-elevated node-gyp rebuild
npm info run ***@***.*** install node_modules/native-watchdog node-gyp rebuild
npm info run ***@***.*** install node_modules/node-pty node scripts/install.js
npm info run ***@***.*** install node_modules/nsfw node-gyp rebuild
npm info run ***@***.*** install node_modules/spdlog node-gyp rebuild
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:
/ # tree /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build
/usr/local/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build
├── Makefile
├── Release
│ ├── obj.target
│ │ ├── spdlog
│ │ │ └── src
│ │ │ ├── logger.o
│ │ │ └── main.o
│ │ └── spdlog.node
│ └── spdlog.node
├── binding.Makefile
├── config.gypi
└── spdlog.target.mk
4 directories, 8 files
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.
Hmm interesting. Were you able to confirm that you have the same
spdlog
file structure I do?
I think going into lib/vscode
and running yarn
from there might be
the next step.
Hello, I am on a void linux system with musl libc. I ran into the same issue. And rebuilding vscode did not help. I have the same file structure:
$ tree node_modules/spdlog/build
node_modules/spdlog/build
├── Makefile
├── Release
│ ├── obj.target
│ │ ├── spdlog
│ │ │ └── src
│ │ │ ├── logger.o
│ │ │ └── main.o
│ │ └── spdlog.node
│ └── spdlog.node
├── binding.Makefile
├── config.gypi
└── spdlog.target.mk
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 python3
and I used yarn to set the config
option instead of npm.
docker run --rm -it -p 8080:8080 alpine sh
ldd --version # Confirm musl
apk add alpine-sdk bash libstdc++ libc6-compat yarn python3
yarn config set python python3
yarn global add code-server
code-server --host 0.0.0.0 --auth none
From there I went to localhost:8080 in my browser and made sure the terminal worked (which it did).
Unfortunately that did not work for me.
Still the same 500 error.
Is it possible to package your working version and upload it? Would it help at determining whether it is some sort of build-time error or run-time error?
Okay so I tried again and it all worked. The key for me was to do everything on the root user, have both npm config
and yarn config
set, and I also took a peek at the libc6-compat
package 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!
Hooray! I'm going to close this out sine we haven't heard from @lebel-louisjacob and we've confirmed it works.
OS/Web Information
Steps to reproduce
code-server
the npm way:localhost:8080
in a browser, on the same system~/.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
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).