Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange symbol not found error on docker image node:20.11.0-alpine #436

Closed
flevi29 opened this issue Jan 15, 2024 · 3 comments · Fixed by #437 or #441
Closed

Strange symbol not found error on docker image node:20.11.0-alpine #436

flevi29 opened this issue Jan 15, 2024 · 3 comments · Fixed by #437 or #441

Comments

@flevi29
Copy link

flevi29 commented Jan 15, 2024

Before providing more context with reproduction and whatnot I'd like to give the simple error, because I've spent way too much time on this already. I want to know whether there's any interest.

I am building a custom Node.js image for Directus on node:20.11.0-alpine, and with pnpm deploy, which works with a ton of symbolic links, which could also cause issues here (although probably not this one).
The build stage installs all the dependencies, but it's separate from the final stage which does not include these dependencies, my thinking is that they're build dependencies, not runtime ones. I tried having them on the same stage, it didn't help, but not on the stage where I build, because that would make my image very fat. Maybe I should try that too, however I wouldn't want my image to be almost a gigabyte.
The following is the error I am getting when all is bundled and pnpm deploy -ed:

cms-1  | node:internal/modules/cjs/loader:1473
cms-1  |   return process.dlopen(module, path.toNamespacedPath(filename));
cms-1  |                  ^
cms-1  |
cms-1  | Error: Error relocating /slma/node_modules/.pnpm/isolated-vm@4.6.0/node_modules/isolated-vm/out/isolated_vm.node: _ZN2v814ScriptCompiler24CompileFunctionInContextENS_5LocalINS_7ContextEEEPNS0_6SourceEmPNS1_INS_6StringEEEmPNS1_INS_6ObjectEEENS0_14CompileOptionsENS0_13NoCacheReasonEPNS1_INS_14ScriptOrModuleEEE: symbol not found
cms-1  |     at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
cms-1  |     at Module.load (node:internal/modules/cjs/loader:1207:32)
cms-1  |     at Module._load (node:internal/modules/cjs/loader:1023:12)
cms-1  |     at Module.require (node:internal/modules/cjs/loader:1235:19)
cms-1  |     at require (node:internal/modules/helpers:176:18)
cms-1  |     at Object.<anonymous> (/slma/node_modules/.pnpm/isolated-vm@4.6.0/node_modules/isolated-vm/isolated-vm.js:1:18)
cms-1  |     at Module._compile (node:internal/modules/cjs/loader:1376:14)
cms-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
cms-1  |     at Module.load (node:internal/modules/cjs/loader:1207:32)
cms-1  |     at Module._load (node:internal/modules/cjs/loader:1023:12) {
cms-1  |   code: 'ERR_DLOPEN_FAILED'
cms-1  | }
cms-1  |
cms-1  | Node.js v20.11.0
cms-1 exited with code 0

I've followed the README.md instructions for Alpine, and this still happens. Not sure why. If I'm building on node:20.11.0-bookworm-slim (Debian) it all works.

@flevi29 flevi29 changed the title Strange symbol not found error on node:20.11.0-alpine Strange symbol not found error on docker image node:20.11.0-alpine Jan 15, 2024
orgads added a commit to orgads/isolated-vm that referenced this issue Jan 16, 2024
orgads added a commit to orgads/isolated-vm that referenced this issue Jan 16, 2024
@laverdet
Copy link
Owner

I think some of these docker images strip symbol names from their distributed binaries. So project like isolated-vm which can't use NAN can fail to load. What you can do is start from the plain alpine docker image and compile node yourself (it is really very easy to compile node, since they distribute most of their dependencies).

laverdet pushed a commit that referenced this issue Jan 16, 2024
@orgads
Copy link
Contributor

orgads commented Jan 16, 2024

@laverdet Please reopen. Apparently it is not fixed.

@orgads
Copy link
Contributor

orgads commented Jan 16, 2024

Related: nodejs/node-v8#214

orgads added a commit to orgads/isolated-vm that referenced this issue Jan 16, 2024
CompileFunctionInContext was removed.

See nodejs/node-v8#214.

Fixes laverdet#436.
orgads added a commit to orgads/isolated-vm that referenced this issue Jan 16, 2024
CompileFunctionInContext was removed.

See nodejs/node-v8#214.

Fixes laverdet#436.
laverdet pushed a commit that referenced this issue Jan 16, 2024
CompileFunctionInContext was removed.

See nodejs/node-v8#214.

Fixes #436.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants