mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-26 08:51:14 +00:00
fix: clarify SQLite version error message to prevent user confusion (#108382)
* fix: clarify SQLite version error message to prevent user confusion The error message "3.44.6+" was misinterpreted by users as meaning "3.44.6 and above", when it actually means "3.44.6+ for the 3.44.x series only". This commit clarifies the error message to explicitly state that only specific patched versions (3.44.6+, 3.50.7+, and 3.51.3+) are safe, and that SQLite 3.46.1 is not among them. Changes: - Update error message in src/infra/node-sqlite.ts to clarify version requirements - Update test expectations in src/infra/node-sqlite.test.ts to match new error format - Fix unnecessary template literal expressions flagged by oxlint The code logic remains unchanged - SQLite 3.46.1 is correctly rejected as unsafe. * fix: clarify SQLite version error message to prevent user confusion The previous error message stated '3.44.6+' which users misinterpreted as '3.44.6 and above', leading to confusion when versions like 3.46.1 were rejected. The new message explicitly states '3.44.6+ in the 3.44.x series' and '3.50.7+ in the 3.50.x series' to make it clear that only specific minor version series received the WAL-reset bug fix. This matches the SQLite team's actual fix announcement which only backported the fix to 3.44.x and 3.50.x series, plus 3.51.3+. * fix(sqlite): align unsafe version diagnostics --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -625,7 +625,7 @@ install_alpine_node() {
|
||||
installed_version="$("$(node_bin)" -v 2>/dev/null || echo unknown)"
|
||||
required_version="$(required_node_version)"
|
||||
sqlite_version="$(linked_node_sqlite_version)"
|
||||
fail "Alpine Node package must provide Node >= ${required_version} with WAL-reset-safe SQLite 3.51.3+ (or patched 3.50.7+/3.44.6+); found Node ${installed_version}, SQLite ${sqlite_version}."
|
||||
fail "Alpine Node package must provide Node >= ${required_version} with WAL-reset-safe SQLite 3.51.3+, 3.50.7+ within 3.50.x, or 3.44.6+ within 3.44.x; found Node ${installed_version}, SQLite ${sqlite_version}."
|
||||
fi
|
||||
|
||||
installed_version="$("$(node_bin)" -v 2>/dev/null || echo unknown)"
|
||||
|
||||
@@ -221,7 +221,7 @@ function Check-Node {
|
||||
} else {
|
||||
$sqliteVersion
|
||||
}
|
||||
Write-Host "[!] Node.js $nodeVersion uses SQLite $sqliteVersionLabel; SQLite 3.51.3+ (or patched 3.50.7+/3.44.6+) is required" -ForegroundColor Yellow
|
||||
Write-Host "[!] Node.js $nodeVersion uses SQLite $sqliteVersionLabel; SQLite 3.51.3+, 3.50.7+ within 3.50.x, or 3.44.6+ within 3.44.x is required" -ForegroundColor Yellow
|
||||
return $false
|
||||
} else {
|
||||
Write-Host "[!] Node.js $nodeVersion found, but Node 22.22.3+, Node 24.15.0+, or Node 25.9.0+ is required" -ForegroundColor Yellow
|
||||
|
||||
@@ -42,11 +42,11 @@ async function withNodeSharedSqliteValue(value: unknown, run: () => Promise<void
|
||||
function expectedUnsafeSqliteError(version: string, shared: boolean): string {
|
||||
const wording = shared ? "uses shared system" : "embeds";
|
||||
const remediation = shared
|
||||
? "Upgrade the system SQLite library to 3.51.3+ (or patched 3.50.7+/3.44.6+), or use a Node build embedding a safe version."
|
||||
? "Upgrade the system SQLite library to one of those safe versions, or use a Node build embedding a safe version."
|
||||
: "Upgrade to Node 22.22.3+, 24.15.0+, or 25.9.0+ before retrying.";
|
||||
return (
|
||||
"SQLite support is unavailable or unsafe in this Node runtime. " +
|
||||
"OpenClaw requires SQLite 3.51.3+ (or patched 3.50.7+/3.44.6+) for WAL safety; " +
|
||||
"OpenClaw requires SQLite 3.51.3+, 3.50.7+ within 3.50.x, or 3.44.6+ within 3.44.x for WAL safety; " +
|
||||
`Node ${process.versions.node} ${wording} SQLite ${version}, which is affected by the upstream WAL-reset ` +
|
||||
`database corruption bug. ${remediation}`
|
||||
);
|
||||
@@ -69,7 +69,7 @@ describe("node SQLite safety", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it.each(["3.51.2", "3.51.0", "3.50.6", "3.49.1", "3.44.5", "invalid", "3.51"])(
|
||||
it.each(["3.51.2", "3.51.0", "3.50.6", "3.49.1", "3.46.1", "3.44.5", "invalid", "3.51"])(
|
||||
"rejects vulnerable or unknown SQLite %s",
|
||||
async (version) => {
|
||||
const { requireNodeSqlite } = await loadNodeSqliteWithVersion(version);
|
||||
|
||||
@@ -17,10 +17,10 @@ function assertSqliteWalResetSafeVersion(version: string, nodeVersion: string):
|
||||
variables?.node_shared_sqlite === true || variables?.node_shared_sqlite === "true";
|
||||
const wording = isShared ? "uses shared system" : "embeds";
|
||||
const remediation = isShared
|
||||
? "Upgrade the system SQLite library to 3.51.3+ (or patched 3.50.7+/3.44.6+), or use a Node build embedding a safe version."
|
||||
? "Upgrade the system SQLite library to one of those safe versions, or use a Node build embedding a safe version."
|
||||
: "Upgrade to Node 22.22.3+, 24.15.0+, or 25.9.0+ before retrying.";
|
||||
throw new Error(
|
||||
`OpenClaw requires SQLite 3.51.3+ (or patched 3.50.7+/3.44.6+) for WAL safety; ` +
|
||||
`OpenClaw requires SQLite 3.51.3+, 3.50.7+ within 3.50.x, or 3.44.6+ within 3.44.x for WAL safety; ` +
|
||||
`Node ${nodeVersion} ${wording} SQLite ${version}, which is affected by the upstream WAL-reset ` +
|
||||
`database corruption bug. ${remediation}`,
|
||||
);
|
||||
|
||||
@@ -701,7 +701,7 @@ describe("install-cli.sh", () => {
|
||||
expect(result.status).toBe(1);
|
||||
expect(readFileSync(apkLog, "utf8")).toContain("add --no-cache nodejs npm");
|
||||
expect(result.stdout).toContain(
|
||||
"Alpine Node package must provide Node >= 22.22.3 with WAL-reset-safe SQLite",
|
||||
"Alpine Node package must provide Node >= 22.22.3 with WAL-reset-safe SQLite 3.51.3+, 3.50.7+ within 3.50.x, or 3.44.6+ within 3.44.x",
|
||||
);
|
||||
expect(result.stdout).toContain("found Node v22.18.0, SQLite unavailable");
|
||||
} finally {
|
||||
|
||||
@@ -134,6 +134,7 @@ describe("install.ps1 failure handling", () => {
|
||||
"$cases = @{",
|
||||
" '3.44.5' = $false",
|
||||
" '3.44.6' = $true",
|
||||
" '3.46.1' = $false",
|
||||
" '3.50.6' = $false",
|
||||
" '3.50.7' = $true",
|
||||
" '3.51.2' = $false",
|
||||
@@ -503,6 +504,9 @@ describe("install.ps1 failure handling", () => {
|
||||
expect(checkNodeBody).toContain("$sqliteProbe | & $nodePath -");
|
||||
expect(checkNodeBody).not.toContain("& $nodePath -e");
|
||||
expect(checkNodeBody).toContain("Test-NodeSqliteSupported -Version $sqliteVersion");
|
||||
expect(checkNodeBody).toContain(
|
||||
"SQLite 3.51.3+, 3.50.7+ within 3.50.x, or 3.44.6+ within 3.44.x is required",
|
||||
);
|
||||
expect(source).toContain("Please install Node.js 24.15+ manually:");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user