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

node error 'invalid ELF header' regarding lz4 dependency #289

Open
jansepke opened this issue Apr 2, 2025 · 2 comments
Open

node error 'invalid ELF header' regarding lz4 dependency #289

jansepke opened this issue Apr 2, 2025 · 2 comments
Assignees

Comments

@jansepke
Copy link

jansepke commented Apr 2, 2025

Hello, we are not able to execute this library as node is having issues with the lz4 dependency of this package. Can you please assist on how to use databricks-sql-nodejs in a standard Linux or Mac + NodeJS environment.

steps to reproduce:

npm install @databricks/sql
node -e "require('@databricks/sql')"

error message:

{...}/node_modules/@databricks/sql/dist/utils/lz4.js:10
            throw err;
            ^

Error: {...}/node_modules/lz4/build/Release/xxhash.node: invalid ELF header
    at Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/home/dejhjs3e/projects/databricks-node/node_modules/lz4/lib/utils.js:4:11)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
  code: 'ERR_DLOPEN_FAILED'
}

versions:

  • @databricks/sql: 1.10.0
  • npm: 10.8.2
  • node: v18.20.8, v20.16.0, v22.6.0 (tested all of them)
  • OS: Ubuntu 24.04.2 and Mac OS X 14.4.1

related issue: #270

@vadimgaidai
Copy link

Hi, I'm experiencing the same issue when using @databricks/sql (version 1.10.0)

When I run the project using Node v18.20.8, I get the following error:

/usr/src/app/node_modules/@databricks/sql/dist/utils/lz4.js:10
            throw err;
            ^
Error: {...}/node_modules/lz4/build/Release/xxhash.node: invalid ELF header
    at Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/usr/src/app/node_modules/lz4/lib/utils.js:4:11)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
  code: 'ERR_DLOPEN_FAILED'
}

I've also tested with other Node versions with the same result. Any updates or workarounds would be greatly appreciated. Thanks!

@jansepke
Copy link
Author

jansepke commented Apr 3, 2025

One possible workaround is to change the npm config

npm config set -L project omit optional
rm -rf node_modules
npm install @databricks/sql

then the problematic lz4 dependency will never get installed but also all other optional dependencies of your project

@madhav-db madhav-db self-assigned this Apr 7, 2025
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

No branches or pull requests

3 participants