-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
getting ERR_DLOPEN_FAILED after running re2 on alpine docker #180
Comments
I use Node on Alpine to run RE2: https://github.com/uhop/node-re2/blob/master/.github/actions/linux-alpine-node-18/Dockerfile and it works as anyone can see in the Actions tab. My guesses would be:
Please let me know if these suggestions help you in any way. |
I just encountered this issue after re-installing all npm packages on Node v20.3.1. Whenever I try to Error: Error relocating /home/container/node_modules/re2/build/Release/re2.node: _ZN4absl12lts_2023012518debugging_internal17AddressIsReadableEPKv: symbol not found
at Module._extensions..node (node:internal/modules/cjs/loader:1343:18)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object.<anonymous> (/home/container/node_modules/re2/re2.js:3:13)
at Module._compile (node:internal/modules/cjs/loader:1257:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12) {
code: 'ERR_DLOPEN_FAILED'
} The re2.node file exists in the Release directory, and I've encountered it on re2 1.19.1 and 1.20.1. |
Seeing the same error with:
re2 1.18.0 seems to build fine so something was introduced that's causing the errors between that version and at least 1.19.1 |
I'm also seeing this error after upgrading from Reproduction is easy, just add this Dockerfile to an empty folder and run FROM node:16.20.0-alpine3.17
WORKDIR /app
RUN DEVELOPMENT_SHOW_VERIFICATION_RESULTS=true npm add re2@1.20.1 |
I was able to build successfully with the following FROM node:16.20.0-alpine3.17
RUN apk add --no-cache python3 make gcc g++ linux-headers
WORKDIR /app
RUN DEVELOPMENT_SHOW_VERIFICATION_RESULTS=true npm add re2@1.20.1 I ran it on my ARM-based Mac M2 and there is no image for an ARM-based Linux. It failed to retrieve a proper cached |
Searching the web I've noticed a lot of complaints about Alpine doing something from version to version. As a reference for Node 16, I used
The |
With the hello world example of
and
we get
With
With
|
The symbol is obviously from absl and it looks like it's because you pull in vendor/abseil-cpp/absl/debugging/stacktrace.cc which includes stacktrace_x86-inl.inc which in turn includes address_is_readable.h but you don't include address_is_readable.cc as a target source in binding.gyp |
@uhop yeah, installing the native compilation tools gets the Docker image built because of the fallback. But as @rbitanga-manticore pointed it still fails during runtime with the missing symbol error. |
+1 |
|
Released on NPM as 1.20.2. Please test. |
This is still broken in v1.20.5 on alpine-arm, though the error message has changed.
This is reproducable with the app.js and Dockerfile from #180 (comment), simply by changing the version to 1.20.5 |
I've managed to fix this issue by adding the following targets to binding.gyp:
I'll submit a PR in a minute. |
Done, #195 |
versions:
Node.js v18.17.0
alpine3.18
re2@1.19.1
pnpm@7.30.5
error log:
{"time":"2023-07-19T22:48:36.3633975Z","level":"ERROR","msg":"node:internal/modules/cjs/loader:1340","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364227625Z","level":"ERROR","msg":" return process.dlopen(module, path.toNamespacedPath(filename));","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364270875Z","level":"ERROR","msg":" ^","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364308833Z","level":"ERROR","msg":"Error: /opt/build/scanner/node_modules/.pnpm/re2@1.19.1/node_modules/re2/build/Release/re2.node:","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364337083Z","level":"ERROR","msg":" at Module._extensions..n invalid ELF headerode (node:internal/modules/cjs/loader:1340:18)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.3643545Z","level":"ERROR","msg":" at Module.load (node:internal/modules/cjs/loader:1119:32)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.3643795Z","level":"ERROR","msg":" at Module._load (node:internal/modules/cjs/loader:960:12)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364399708Z","level":"ERROR","msg":" at Module.require (node:internal/modules/cjs/loader:1143:19)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364421542Z","level":"ERROR","msg":" at require (node:internal/modules/cjs/helpers:110:18)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364466958Z","level":"ERROR","msg":" at Object.<anonymous> (/opt/build/scanner/node_modules/.pnpm/re2@1.19.1/node_modules/re2/re2.js:3:13)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364493667Z","level":"ERROR","msg":" at Module._compile (node:internal/modules/cjs/loader:1256:14)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364508667Z","level":"ERROR","msg":" at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364523875Z","level":"ERROR","msg":" at Module.load (node:internal/modules/cjs/loader:1119:32)","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364551292Z","level":"ERROR","msg":" at Module._load (node:internal/modules/cjs/loader:960:12) {","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364568708Z","level":"ERROR","msg":" code: 'ERR_DLOPEN_FAILED'","workflow":"scanner"} {"time":"2023-07-19T22:48:36.364590167Z","level":"ERROR","msg":"}","workflow":"scanner"} {"time":"2023-07-19T22:48:36.3646285Z","level":"ERROR","msg":"Node.js v18.17.0","workflow":"scanner"}
The text was updated successfully, but these errors were encountered: