Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Install of 5.0.9 fails to run on Alpine ("_ZSt28__throw_bad_array_new_lengthv: symbol not found") #1625

Description

@tianon

Issue Summary

When installing on Alpine, the module installs correctly but then fails at runtime.

Relevant logs or output

$ docker run -it --rm --pull=always node:16-alpine3.15 sh
16-alpine3.15: Pulling from library/node
Digest: sha256:3cc4a16286bc01e141dcfec735f3ebfaf8bdb6ab7ff216f9a7073bd08cee1fa7
Status: Image is up to date for node:16-alpine3.15
/ # node --version
v16.16.0
/ # npm --version
8.11.0
/ # npm install -g sqlite3
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

added 104 packages, and audited 105 packages in 10s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New minor version of npm available! 8.11.0 -> 8.14.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.14.0
npm notice Run npm install -g npm@8.14.0 to update!
npm notice 
/ # npm info sqlite3

sqlite3@5.0.9 | BSD-3-Clause | deps: 4 | versions: 92
Asynchronous, non-blocking SQLite3 bindings
https://github.com/TryGhost/node-sqlite3

keywords: sql, sqlite, sqlite3, database

dist
.tarball: https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.9.tgz
.shasum: 421b9c065480f1c589f89cabd6d0ea9575a69855
.integrity: sha512-e2lEKevUF65UJu4IIuuFytgW7yNMkmCkfyn66jXWeb7OcdHvRo7nXhF+IQ25iW6x2grB0DyKdGCpx8Rd8EkA2Q==
.unpackedSize: 3.2 MB

dependencies:
@mapbox/node-pre-gyp: ^1.0.0 node-addon-api: ^4.2.0       node-gyp: 8.x                tar: ^6.1.11                 

maintainers:
- springmeyer <dane.springmeyer@gmail.com>
- kkaefer <mail@kkaefer.com>
- tmcw <tom@macwright.com>
- erisds <github.erisds@gmail.com>
- yhahn <young@mapbox.com>
- mapsam <sam@mapbox.com>
- zmully <mully@mapbox.com>
- kewde_ <kewde@particl.io>
- daniellockyer <hi@daniellockyer.com>

dist-tags:
alpha: 3.1.10-alpha  latest: 5.0.9        

published 6 days ago by daniellockyer <hi@daniellockyer.com>
/var/lib/ghost # node -p 'require("sqlite3")'
node:internal/modules/cjs/loader:1189
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Error relocating /var/lib/ghost/node_modules/sqlite3/lib/binding/napi-v6-linux-musl-x64/node_sqlite3.node: _ZSt28__throw_bad_array_new_lengthv: symbol not found
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/var/lib/ghost/node_modules/sqlite3/lib/sqlite3-binding.js:4:17)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Version

5.0.9

Node.js Version

16.16.0

How did you install the library?

npm install sqlite3, yarn add sqlite3; Linux, x86_64, Alpine 3.15 (specifically, failing to update https://github.com/docker-library/ghost to Ghost 5.4.1; TryGhost/docker-library-ghost#320)

Activity

  1. tianon commented on Jul 20, 2022

    @tianon
    Author

    Interestingly, this appears to work successfully on Alpine 3.16, so I suppose this is perhaps a problem of Node's pre-built modules support not being specific enough about musl version or something like that?

  2. tianon commented on Jul 20, 2022

    @tianon
    Author

    Can confirm -- updating to Alpine 3.16 fixed the issue for my specific need, so I'm 100% OK with this being closed, but I'll let maintainers here make the determination of whether this is still useful to chase further for use cases outside mine. 😄 ❤️

  3. daniellockyer commented on Jul 22, 2022

    @daniellockyer
    Contributor

    I wonder if it would resolve if I targeted a specific Alpine version in our binary building script 🤔 I'll give it a go next week and if it works, I'll release a new version to restore compatibility.

  4. daniellockyer commented on Jul 24, 2022

    @daniellockyer
    Contributor

    The issue should be fixed in master - I'll do a release this week 🙂

  5. daniellockyer commented on Jul 31, 2022

    @daniellockyer
    Contributor

    Released in v5.0.11 🙂

  6. tianon commented on Aug 1, 2022

    @tianon
    Author

    Confirmed working in both Alpine 3.15 and 3.16! Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions