Repository navigation
fix: explain why the native addon failed to load - #14
Merged
Merged
Conversation
The loader reported "Install librados2 and librbd1" whenever the failure message contained "librados", and the package path itself does (node_modules/node-librados/...). So a missing or unbuilt addon file was reported as missing Ceph libraries. The loader now tells the failures apart: - the addon file is missing: reinstall node-librados, or run "npm run build:native" in a checkout - the dynamic loader cannot load librados.so.N or librbd.so.N: names that library and says to install librados2 and librbd1 - anything else (wrong ELF class, undefined symbols) is rethrown unchanged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 21, 2026
## [1.2.3](v1.2.2...v1.2.3) (2026-11-21) ### Bug Fixes * explain why the native addon failed to load ([#14](#14)) ([e80d2f3](e80d2f3))
|
🎉 This PR is included in version 1.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
When the native addon failed to load, the error said "Unable to load Ceph client libraries. Install librados2 and librbd1" whenever the failure message contained
librados. The package's own install path (node_modules/node-librados/...) always contains it. So a missing or unbuilt addon file was reported as missing Ceph libraries, pointing people at the wrong fix.Reproduced with the published 1.2.1 in
node:24-bookworm-slim:causeERR_DLOPEN_FAILEDlibrados.so.2: cannot open shared object fileMODULE_NOT_FOUNDCannot find module '.../node-librados.node'The load-error handling now lives in
src-ts/load-error.tsand tells the failures apart:npm run build:native.librados.so.N/librbd.so.Nlibrados.so.2. Install librados2 and librbd1 from Ceph Squid or Tentacle.The new errors keep the original as
cause.How it was tested
tests/unit/load-error.test.ts(3 tests) uses the exact error messages captured from the real failures above. It includes the case wherelibradosappears only in the path, which the old check misreported.Checklist
npm run checkpassescoverage/api.json(none)IoContextusein_flight(state_)(not applicable)!in the title (none)🤖 Generated with Claude Code