Closed benz0li closed 2 years ago
@code-asher Directories in ./node_modules/@node-rs
of code-server-4.0.2-linux-arm64.tar.gz
:
argon2
argon2-linux-x64-gnu
argon2-linux-x64-musl
Why are there argon2-linux-x64-gnu
and argon2-linux-x64-musl
instead of argon2-linux-arm64-gnu
?
i also got these errors in 4.0.2.
too many bugs after version 4.0, i have downgrade my code-server to3.12.
Also the armhf build..
app/node_modules/@node-rs/argon2/index.js:201
throw loadError
^
Error: Cannot find module '@node-rs/argon2-linux-arm-gnueabihf'
Require stack:
I have the same problem with the v4.0.2 docker image.
Hmm maybe there is something wrong with the cross-compilation step. It sets some variables that seem related to gcc...maybe we need something similar for Rust.
I am not sure how this works actually. The argon2
module has a bunch of optional dependencies for the various per-platform builds (@node-rs/argon2-win32-x64-msvc
for example). Does Node only download optional dependencies if they match the current platform? If so why does it download the wrong ones? We set NODE_CONFIG_ARCH
but maybe that is not enough.
@code-asher Directories in
./node_modules/@node-rs
ofcode-server-4.0.2-linux-arm64.tar.gz
:argon2 argon2-linux-x64-gnu argon2-linux-x64-musl
Why are there
argon2-linux-x64-gnu
andargon2-linux-x64-musl
instead ofargon2-linux-arm64-gnu
?
Thanks for mentioning this. I can temporarily fix it by manually downloading https://registry.yarnpkg.com/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.0.5.tgz
and put it into /usr/lib/code-server/node_modules/@node-rs/argon2-linux-arm64-gnu
.
Hmm maybe there is something wrong with the cross-compilation step. It sets some variables that seem related to gcc...maybe we need something similar for Rust.
Let me ping the node-rs team (they were super helpful when we made the migration).
cc @Brooooooklyn @yisibl - is there anything obvious we might have missed in the migration? Otherwise, I'll see if I can dig in and see where this is coming form.
Thanks for mentioning this. I can temporarily fix it by manually downloading
https://registry.yarnpkg.com/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.0.5.tgz
and put it into/usr/lib/code-server/node_modules/@node-rs/argon2-linux-arm64-gnu
.
@ljishen With this workaround I can build the docker image. But then, the following comes up when running the container:
[...]
[IPC Library: File Watcher (parcel, node.js)] Loading "@parcel/watcher" failed
[IPC Library: File Watcher (parcel, node.js)] Error: No native build was found for platform=linux arch=arm64 runtime=node abi=83 uv=1 armv=8 libc=glibc node=14.17.4
loaded from: /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher
at Function.load.path (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:59:9)
at load (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:21:30)
at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/index.js:1:42)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at r (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:101)
at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1723)
at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695)
at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300)
at Object.errorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10421)
at e.triggerErrorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:11059)
at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10765
at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1740)
at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695)
at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300)
at i._loadModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10430)
at i._resolve (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:452)
at i.defineModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:6142)
at v (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:1702)
at g (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2557)
at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:22221)
at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:30915)
at e._createAndEvalScript (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2601)
at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2240
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:73:3)
[IPC Library: File Watcher (parcel, node.js)] Here are the modules that depend on it:
[IPC Library: File Watcher (parcel, node.js)]% [ 'vs/platform/files/node/watcher/parcel/parcelWatcherService' ]
[...]
š Directory /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/build
in code-server-4.0.2-linux-arm64.tar.gz
is missing.
Bottom line: I'm skipping code-server v4.0.2.
Thanks for mentioning this. I can temporarily fix it by manually downloading
https://registry.yarnpkg.com/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.0.5.tgz
and put it into/usr/lib/code-server/node_modules/@node-rs/argon2-linux-arm64-gnu
.@ljishen With this workaround I can build the docker image. But then, the following comes up when running the container:
[...] [IPC Library: File Watcher (parcel, node.js)] Loading "@parcel/watcher" failed [IPC Library: File Watcher (parcel, node.js)] Error: No native build was found for platform=linux arch=arm64 runtime=node abi=83 uv=1 armv=8 libc=glibc node=14.17.4 loaded from: /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher at Function.load.path (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:59:9) at load (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:21:30) at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/index.js:1:42) at Module._compile (internal/modules/cjs/loader.js:1072:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) at Module.load (internal/modules/cjs/loader.js:937:32) at Function.Module._load (internal/modules/cjs/loader.js:778:12) at Module.require (internal/modules/cjs/loader.js:961:19) at require (internal/modules/cjs/helpers.js:92:18) at r (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:101) at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1723) at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695) at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300) at Object.errorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10421) at e.triggerErrorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:11059) at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10765 at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1740) at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695) at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300) at i._loadModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10430) at i._resolve (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:452) at i.defineModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:6142) at v (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:1702) at g (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2557) at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:22221) at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:30915) at e._createAndEvalScript (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2601) at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2240 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:73:3) [IPC Library: File Watcher (parcel, node.js)] Here are the modules that depend on it: [IPC Library: File Watcher (parcel, node.js)]% [ 'vs/platform/files/node/watcher/parcel/parcelWatcherService' ] [...]
š Directory
/opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/build
incode-server-4.0.2-linux-arm64.tar.gz
is missing.Bottom line: I'm skipping code-server v4.0.2.
I didn't build the image. I used the latest one from here https://hub.docker.com/r/codercom/code-server/tags
To run a container, I changed the entrypoint to bash, then I can do the change I mentioned. Finally, I ran the original entrypoint /usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 .
under dir /home/coder
. This is what I see under that dir inside the container
$ ls /usr/lib/code-server/node_modules/@node-rs/argon2-linux-arm64-gnu
argon2.linux-arm64-gnu.node package.json README.md
I have the same problem
I am using Ubuntu 21.10 on my phone installed via proot-distoro how can I fix it ?
FWIW, this appears to be the offending commit: https://github.com/coder/code-server/commit/723469ab5bed3ba9fbb3e8d5ecbfcd9a3bee2d88
I've solved it for myself by running 4.0.1, which doesn't seem to have that problem.
In https://github.com/coder/code-server/pull/4733/files, I removed this:
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
export npm_config_build_from_source=true
I wonder if adding it back in would fix this.
I'm going to start working on this soon and will post my notes as I investigate. Thank you all for chiming in! Apologies for the issues.
These are the notes as I investigate. I'll update this comment as not to spam this thread.
Could not reproduce with @benz0li's steps (I think they reverted back to 4.0.1).
code-server@beta
npm packageI tried using a Coder workspace with Ubuntu/Node and following these steps:
yarn init -y
yarn add code-server@beta
(see if it still exists on latest main
, link)The installation works just fine. And I'm able to run code-server.
docker run -it --name code-server -p 127.0.0.1:8080:8080 \
-v "$HOME/.config:/home/coder/.config" \
-v "$PWD:/home/coder/project" \
-u "$(id -u):$(id -g)" \
-e "DOCKER_USER=$USER" \
codercom/code-server:latest
localhost:8080
Maybe using npm_config_build_from_source=true
and having Rust/Cargo in CI
TODO revisit workaround
npm_config_build_from_source
It's weird...I can't find any docs on this š¤ And there isn't much coming up in DDG.
It doesn't appear that napi-rs
supports this yet based on this issue: https://github.com/napi-rs/napi-rs/issues/447
So unfortunately I don't think that will work.
npm_config_build_from_source
might work! You might need Rust and Cargo installed. I looked more into optionalDependencies
but I did not see anything in the docs about it only downloading some of them based on platform.
I found a Temporary solution for this problem.
sudo apt remove code-server
@ljishen could you provide repro steps by chance? I tried using the 4.0.2 Docker image (on macOS) but couldn't reproduce this.
sudo apt remove code-server
wget (url chosen)
Note: I am using Ubuntu 21.10
@ljishen could you provide repro steps by chance? I tried using the 4.0.2 Docker image (on macOS) but couldn't reproduce this.
I think this problem is specific to arm64 machines. So maybe you try on one of those machines.
I think this problem is specific to arm64 machines. So maybe you try on one of those machines.
Ah, figured so. I don't have one sadly but currently trying to emulate one with QEMU. Not having much luck unfortunately.
Okay @code-asher and I have gone down quite the rabbit hole. I'll try my best to summarize what we know. We added @node-rs/argon2
to replace node-argon2
so that code-server would work on environments like Termux. Unfortunately something broke with our cross-compilation step leading to this bug. We can't get node-rs
to install the correct prebuilt binaries.
There doesn't appear to any solutions to our problem so the only option we have left is to revert https://github.com/coder/code-server/commit/723469ab5bed3ba9fbb3e8d5ecbfcd9a3bee2d88
Root cause seems to be this: https://github.com/npm/arborist/pull/231
Optional dependencies are only downloaded for the current platform rather than the target platform.
Long-term solution probably involves modifying that behavior in npm to use the target platform instead but in the meantime revert seems like the way to go.
Optional dependencies are only downloaded for the current platform rather than the target platform.
It appears there are workarounds.
But yarn 1.x has a workaround for this scenario, you can use --ignore-platform flag to let yarn install all the platform binaries for you. And yarn 2+ here is supportedArchitectures for this case.
Long-term solution probably involves modifying that behavior in npm to use the target platform instead but in the meantime revert seems like the way to go.
Looks like there is an open RFC discussing package distributions which might address some of these issues.
Haha I completely spaced that we use yarn not npm.
Same thing happened here today I am no raspberry pi 4
@ItzMiracleOwO please wait for the next release!
What's the glitch?
What's the glitch?
wdym?
You can just run this commands
cd /usr/lib/code-server
npm install @node-rs/argon2-linux-arm64-gnu
Same for me.
picode@raspberrypi:~ $ code-server
/usr/lib/code-server/node_modules/@node-rs/argon2/index.js:201
throw loadError
^
Error: Cannot find module '@node-rs/argon2-linux-arm64-gnu'
Require stack:
- /usr/lib/code-server/node_modules/@node-rs/argon2/index.js
- /usr/lib/code-server/out/node/util.js
- /usr/lib/code-server/out/node/cli.js
- /usr/lib/code-server/out/node/entry.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/usr/lib/code-server/node_modules/@node-rs/argon2/index.js:172:31)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/code-server/node_modules/@node-rs/argon2/index.js',
'/usr/lib/code-server/out/node/util.js',
'/usr/lib/code-server/out/node/cli.js',
'/usr/lib/code-server/out/node/entry.js'
]
}
You can just run this commands
cd /usr/lib/code-server
npm install @node-rs/argon2-linux-arm64-gnu
This just threw a ton of errors.
2028 warn EBADENGINE Unsupported engine {
2028 warn EBADENGINE package: 'code-server@4.0.2',
2028 warn EBADENGINE required: { node: '>= 14' },
2028 warn EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
2028 warn EBADENGINE }
2044 error code EACCES
2045 error syscall rename
2046 error path /usr/lib/code-server/node_modules/escodegen/node_modules/deep-is
2047 error dest /usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg
2048 error errno -13
2049 error Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'
2049 error [Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'] {
2049 error errno: -13,
2049 error code: 'EACCES',
2049 error syscall: 'rename',
2049 error path: '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is',
2049 error dest: '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'
2049 error }
2050 error The operation was rejected by your operating system.
2050 error It is likely you do not have the permissions to access this file as the current user
2050 error
2050 error If you believe this might be a permissions issue, please double-check the
2050 error permissions of the file and its containing directories, or try running
2050 error the command again as root/Administrator.
You can just run this commands
cd /usr/lib/code-server
npm install @node-rs/argon2-linux-arm64-gnu
This just threw a ton of errors.
2028 warn EBADENGINE Unsupported engine { 2028 warn EBADENGINE package: 'code-server@4.0.2', 2028 warn EBADENGINE required: { node: '>= 14' }, 2028 warn EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' } 2028 warn EBADENGINE }
2044 error code EACCES 2045 error syscall rename 2046 error path /usr/lib/code-server/node_modules/escodegen/node_modules/deep-is 2047 error dest /usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg 2048 error errno -13 2049 error Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg' 2049 error [Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'] { 2049 error errno: -13, 2049 error code: 'EACCES', 2049 error syscall: 'rename', 2049 error path: '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is', 2049 error dest: '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg' 2049 error } 2050 error The operation was rejected by your operating system. 2050 error It is likely you do not have the permissions to access this file as the current user 2050 error 2050 error If you believe this might be a permissions issue, please double-check the 2050 error permissions of the file and its containing directories, or try running 2050 error the command again as root/Administrator.
u need sudo and ur node version is lower the required version
Actully I tried to manually install the module but it return 404
If It requires Root administration make sure you are in a super user privileges or as root You can search on google how to add superuser privilege in your Linux distribution
@jsjoeio you can consider switch back to @node-rs/argon2
again since https://github.com/npm/cli/pull/6755 landed
@Brooooooklyn That's amazing! I'm not involved in the project anymore but maybe someone else from the team/community can. Thanks for flagging!
Is there an existing issue for this?
OS/Web Information
code-server --version
: code-server 4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7ddSteps to Reproduce
git clone https://gitlab.b-data.ch/jupyterlab/julia/docker-stack.git
cd docker-stack/ver
docker build -t julia-ver -f latest.Dockerfile .
Expected
Successful build
Actual
https://gitlab.b-data.ch/jupyterlab/r/r-ver/-/jobs/20883
Logs
Screenshot/Video
No response
Does this issue happen in VS Code?
Are you accessing code-server over HTTPS?
Notes
Related issues: