Title: localStorage: a malformed backing file aborts the process via CHECK · Issue #65878 · nodejs/node · GitHub
Open Graph Title: localStorage: a malformed backing file aborts the process via CHECK · Issue #65878 · nodejs/node
X Title: localStorage: a malformed backing file aborts the process via CHECK · Issue #65878 · nodejs/node
Description: Version v27.0.0-pre (9f7ae86d8b5) Platform Darwin 25.6.0 arm64 Subsystem webstorage, sqlite What steps will reproduce the bug? src/node_webstorage.cc asserts the SQLite type of every column it reads, but the backing file is a user-specif...
Open Graph Description: Version v27.0.0-pre (9f7ae86d8b5) Platform Darwin 25.6.0 arm64 Subsystem webstorage, sqlite What steps will reproduce the bug? src/node_webstorage.cc asserts the SQLite type of every column it read...
X Description: Version v27.0.0-pre (9f7ae86d8b5) Platform Darwin 25.6.0 arm64 Subsystem webstorage, sqlite What steps will reproduce the bug? src/node_webstorage.cc asserts the SQLite type of every column it read...
Opengraph URL: https://github.com/nodejs/node/issues/65878
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"localStorage: a malformed backing file aborts the process via CHECK","articleBody":"### Version\n\nv27.0.0-pre (`9f7ae86d8b5`)\n\n### Platform\n\n```text\nDarwin 25.6.0 arm64\n```\n\n### Subsystem\n\nwebstorage, sqlite\n\n### What steps will reproduce the bug?\n\n`src/node_webstorage.cc` asserts the SQLite type of every column it reads, but the backing file is a user-specified path. Node's own tables are `STRICT`, but the DDL is `CREATE TABLE IF NOT EXISTS`, so a file that already contains tables of those names is adopted as-is, `STRICT` or not.\n\n```js\n// craft.cjs\nconst { DatabaseSync } = require('node:sqlite');\nconst out = '/tmp/ws.db';\nfor (const s of ['', '-wal', '-shm']) require('node:fs').rmSync(out + s, { force: true });\n\n// Node's schema, minus STRICT. BLOB has no affinity, so a TEXT value stays TEXT.\nconst db = new DatabaseSync(out);\ndb.exec(`\n CREATE TABLE nodejs_webstorage(\n key BLOB NOT NULL, value BLOB NOT NULL, PRIMARY KEY(key));\n CREATE TABLE nodejs_webstorage_state(\n max_size INTEGER NOT NULL DEFAULT 10485760, total_size INTEGER NOT NULL,\n schema_version INTEGER NOT NULL DEFAULT 1,\n single_row_ INTEGER NOT NULL DEFAULT 1 CHECK(single_row_ = 1),\n PRIMARY KEY(single_row_));\n`);\n// A real UTF-16LE key, so that lookups still match; only the value is TEXT.\ndb.prepare('INSERT INTO nodejs_webstorage (key, value) VALUES (?, ?)')\n .run(Buffer.from('greeting', 'utf16le'), 'hello');\ndb.prepare('INSERT INTO nodejs_webstorage_state (total_size, schema_version)' +\n ' VALUES (0, 1)').run();\ndb.close();\n```\n\n```console\n$ node craft.cjs\n$ node --localstorage-file=/tmp/ws.db -e \"localStorage.getItem('greeting')\"\n```\n\n### How often does it reproduce? Is there a required condition?\n\nThe only condition is that the file exists with the wrong stored type.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nA thrown error.\n\n### What do you see instead?\n\n`SIGABRT`, exit 134:\n\n```\n# node[96447]: MaybeLocal\u003cValue> node::webstorage::Storage::Load(Local\u003cName>)\n# at ../src/node_webstorage.cc:354\n# Assertion failed: sqlite3_column_type(stmt.get(), 0) == 4\n```\n\n### Additional information\n\nSeparately, line 187 re-runs `init_sql_v0` and overwrites the result of the `sqlite3_prepare_v2()` five lines above it, so prepare failures go unreported. Given a `nodejs_webstorage_state` table with no `schema_version` column, the real error is replaced by `Error: bad parameter or other API misuse`.","author":{"url":"https://github.com/TrevorBurnham","@type":"Person","name":"TrevorBurnham"},"datePublished":"2026-09-07T15:12:25Z","url":"https://github.com/nodejs/node/issues/65878"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e0b3e9b0-3118-e22a-4edf-a6398f9290be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A724:11DC4A:7912E:A1C51:6AED0493 |
| html-safe-nonce | 663c64ddded3279e96df0ce5fab775f1064e0c570eb22b35dcae8f7f4843b60c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzI0OjExREM0QTo3OTEyRTpBMUM1MTo2QUVEMDQ5MyIsInZpc2l0b3JfaWQiOiIzMjgzMDAyNzk2Mjg2MjkxMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c7895b36fe86eeec38a917a4758d32372e5b19cbd6c900d11daba9e0cb151a82 |
| hovercard-subject-tag | issue:5376414914 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65878/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d6242bf9f2f3166f41da0c177001271ebff214071b63138212640a59fe90200c/nodejs/node/issues/65878 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d6242bf9f2f3166f41da0c177001271ebff214071b63138212640a59fe90200c/nodejs/node/issues/65878 |
| og:image:alt | Version v27.0.0-pre (9f7ae86d8b5) Platform Darwin 25.6.0 arm64 Subsystem webstorage, sqlite What steps will reproduce the bug? src/node_webstorage.cc asserts the SQLite type of every column it read... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TrevorBurnham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 21e10c535436b2122cfb44c76dfb4af296e371850fb60de16776f8a64e5c3ed8 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 302a6d707c3288a5f951258a2fa3e926b8c8f8cf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width