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

libc version mismatch Node 18 - AWS Lambda #68

Open
lukeggchapman opened this issue May 24, 2023 · 2 comments · May be fixed by #70
Open

libc version mismatch Node 18 - AWS Lambda #68

lukeggchapman opened this issue May 24, 2023 · 2 comments · May be fixed by #70

Comments

@lukeggchapman
Copy link

lukeggchapman commented May 24, 2023

We ran into an issue when we updated to node 18 on AWS Lambda, the binary for node 18 in the node-s2-binaries bucket has been compiled with libc 2.29, whereas the nodejs18.x lambda container has 2.26 causing the following runtime error:

node:internal/modules/cjs/loader:1338
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /var/task/node_modules/@radarlabs/s2/lib/binding/Release/node-v108-linux-x64/s2.node)
    at Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/var/task/node_modules/@radarlabs/s2/index.js:5:12)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12) {
  code: 'ERR_DLOPEN_FAILED'
}

I've created an example repo reproducing the problem using the lambda docker container.

Currently the libc version mentioned in the node-pre-gyp versioning documentation isn't included in the package.json > binary > package_name property. I think it would be good to add this, I'll attempt to, and see what you think.

@jkao
Copy link
Collaborator

jkao commented Jun 13, 2023

yeah, ideally we should be pinning the versions of all dependencies. give it a go and I'll help out where I can

@lukeggchapman
Copy link
Author

Hi @jkao we're working around the issue at the moment by building it on a machine with x64 architecture and in a docker container that has a libc version that matches the version we need at runtime.
Then we copy the s2.node file into the ./node_modules/@radarlabs/s2/lib/binding/Release/node-v108-linux-x64/ directory before deploying.

I can add the libc to the node-pre-gyp package_name as I've suggested, but unless someone uploads all the different libc versions for node 18 to the binaries bucket you'll probably end up having to build it yourself anyway.

You can see an example of how we're building it in the linked example repo.

@lukeggchapman lukeggchapman linked a pull request Jun 14, 2023 that will close this issue
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.

2 participants