coder / code-server

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

`Error relocating /home/venom/.local/lib/code-server-4.90.2/lib/node: fcntl64: symbol not found` on Alpine Linux #6850

Open VenomousSteam81 opened 2 weeks ago

VenomousSteam81 commented 2 weeks ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. Install code-server
  2. Run code-server

Expected

Code server runs normally

Actual

The console outputs Error relocating /home/venom/.local/lib/code-server-4.90.2/lib/node: fcntl64: symbol not found

Logs

`Error relocating /home/venom/.local/lib/code-server-4.90.2/lib/node: fcntl64: symbol not found`

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

This cannot be tested in native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

Notes

I'm assuming that this is just an issue with Alpine altogether as native VSCode also doesn't run

VenomousSteam81 commented 2 weeks ago

Update: I installed the nodejs package, made a backup of the node file thats giving me problems, and copied the node file that I installed to the one that comes with code-server. This seems to work. It's probably not the safest option, but hey, whatever works!

VenomousSteam81 commented 2 weeks ago

Now I'm having another issue where the builtin terminal won't work. It just outputs * Restarting the terminal because the connection to the shell process was lost....

code-asher commented 2 weeks ago

Did you install it from GitHub releases or something? If so, yeah those are not compiled for Alpine. You will need to do two things:

  1. Replace the Node binary (which you already did)
  2. Recompile all the native Node modules (it should be enough to run npm rebuild in both the root and lib/vscode directories)

Building the modules requires a bunch of dependencies and can take a while. Our docs are a bit out of date here but I think you need:

apk add alpine-sdk bash libstdc++ libc6-compat krb5-dev python3
npm config set python python3

Although, some folks are having issues with this, so it might not work: https://github.com/coder/code-server/issues/6846

Related: https://github.com/coder/code-server/issues/3431

code-asher commented 2 weeks ago

A shorter but equivalent way of doing the recompilation is to install with npm (npm install -g code-server --unsafe-perm), rather than downloading the GitHub release first.

VenomousSteam81 commented 2 weeks ago

Did you install it from GitHub releases or something? If so, yeah those are not compiled for Alpine. You will need to do two things:

I used the install script. I think I will just recompile, since I already have it installed. But if it doesn't work, I will post here. Thank you!

code-asher commented 1 week ago

I used the install script.

Oooo, this is might a bug in the install script then! It is supposed to install via npm when it detects Alpine:

https://github.com/coder/code-server/blob/c26ac35b25b09e9d58e6716f2aae41d8d1dfbb6c/install.sh#L286

But I wonder if the detection logic is broken. Looks like it uses ID from /etc/os-release. Does yours say something other than alpine?

Edit: or did you use --method=standalone maybe? I think this forces installing from GitHub releases, and it only checks the architecture and not the OS. We should fix this to check for Alpine. The flag is also not named very well, it should probably be called --install-from-github or similar.