Compare commits

...
Author SHA1 Message Date
MickLesk 7e8e9214f0 Homarr: replace the musl better-sqlite3 that v2.3.0 ships for Debian
The build-debian tarballs of v2.3.0 carry the Alpine build of
better_sqlite3.node, so the DB migration dies with ERR_DLOPEN_FAILED on
libc.musl and Homarr no longer starts after an update (#17783,
homarr-labs/homarr#7097). When the bundled module is musl, swap in
better-sqlite3's own glibc prebuild for the running Node ABI. The update runs
the check outside the release check, so containers already on 2.3.0 are
repaired too; it does nothing once upstream ships a correct tarball.
2026-10-08 14:57:24 +02:00
2 changed files with 24 additions and 0 deletions

No files matched your search

+12
View File
@@ -85,6 +85,18 @@ EOF
msg_ok "Started Services"
msg_ok "Updated successfully!"
fi
# v2.3.0's Debian build ships a musl better-sqlite3 (homarr-labs/homarr#7097).
mapfile -t MUSL_MODULES < <(find /opt/homarr -name better_sqlite3.node -exec grep -aqE "ld-musl|libc\.musl" {} \; -print)
if ((${#MUSL_MODULES[@]})); then
msg_info "Replacing musl better-sqlite3 build"
BSQ_VERSION=$(jq -r .version /opt/homarr/node_modules/better-sqlite3/package.json)
curl_with_retry "https://github.com/WiseLibs/better-sqlite3/releases/download/v${BSQ_VERSION}/better-sqlite3-v${BSQ_VERSION}-node-v$(node -p process.versions.modules)-linux-$(arch_resolve "x64" "arm64").tar.gz" /tmp/better-sqlite3.tar.gz
tar -xzf /tmp/better-sqlite3.tar.gz -C /tmp build/Release/better_sqlite3.node
for module in "${MUSL_MODULES[@]}"; do cp /tmp/build/Release/better_sqlite3.node "$module"; done
rm -rf /tmp/better-sqlite3.tar.gz /tmp/build
systemctl restart homarr
msg_ok "Replaced musl better-sqlite3 build"
fi
exit
}
+12
View File
@@ -25,6 +25,18 @@ NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/
setup_nodejs
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-debian-$(arch_resolve).tar.gz"
# v2.3.0's Debian build ships a musl better-sqlite3 (homarr-labs/homarr#7097).
mapfile -t MUSL_MODULES < <(find /opt/homarr -name better_sqlite3.node -exec grep -aqE "ld-musl|libc\.musl" {} \; -print)
if ((${#MUSL_MODULES[@]})); then
msg_info "Replacing musl better-sqlite3 build"
BSQ_VERSION=$(jq -r .version /opt/homarr/node_modules/better-sqlite3/package.json)
curl_with_retry "https://github.com/WiseLibs/better-sqlite3/releases/download/v${BSQ_VERSION}/better-sqlite3-v${BSQ_VERSION}-node-v$(node -p process.versions.modules)-linux-$(arch_resolve "x64" "arm64").tar.gz" /tmp/better-sqlite3.tar.gz
tar -xzf /tmp/better-sqlite3.tar.gz -C /tmp build/Release/better_sqlite3.node
for module in "${MUSL_MODULES[@]}"; do cp /tmp/build/Release/better_sqlite3.node "$module"; done
rm -rf /tmp/better-sqlite3.tar.gz /tmp/build
msg_ok "Replaced musl better-sqlite3 build"
fi
msg_info "Installing Homarr"
mkdir -p /opt/homarr_db
touch /opt/homarr_db/db.sqlite