Repository navigation
Closed
Description
Description
When deploying a new blank site I see this error when attempting to update any page on a site. Replicated with new site, D1 db, and bucket. Only occurs when editing a published page or post.
Steps to reproduce
- Create a new site using the Deploy to cloud button
- Create admin account and login
- Create a page or post
- Add Contents and click save
- Re-open post or page and edit any content
- Click publish
- Failed toast pops up with above log in the cloudflare logs.
Environment
EmDash - 0.4.0
Node 22
Cloudflare workers
Logs / error output
{ "message": "Content publish error: Error: D1_ERROR: database disk image is malformed: SQLITE_CORRUPT (extended: SQLITE_CORRUPT_VTAB)", "level": "error", "$workers": { "truncated": false, "event": { "request": { "url": "https://emdas.example.com/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "method": "POST", "path": "/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish" } }, "outcome": "ok", "scriptName": "example-com-emdash", "eventType": "fetch", "executionModel": "stateless", "scriptVersion": { "id": "2c05b7ee-8c16-46f4-84e7-97deb96e87d6" }, "requestId": "9ee4d9627fd4573a" }, "$metadata": { "id": "01KPGMT6SJA7PQTJ48600W6ZDH", "requestId": "9ee4d9627fd4573a", "trigger": "POST /_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "service": "example-com-emdash", "level": "error", "error": "Content publish error: Error: D1_ERROR: database disk image is malformed: SQLITE_CORRUPT (extended: SQLITE_CORRUPT_VTAB)", "message": "Content publish error: Error: D1_ERROR: database disk image is malformed: SQLITE_CORRUPT (extended: SQLITE_CORRUPT_VTAB)", "account": "483669ea821828435edea4557f0620ea", "type": "cf-worker", "fingerprint": "b64558f2c0cad7b5e17f30191a8fb5e3", "origin": "fetch", "messageTemplate": "Content publish error: Error: D1_ERROR: database disk image is malformed: SQLITE_CORRUPT (extended: SQLITE_CORRUPT_VTAB)", } }{ "message": "POST https://emdash.example.com/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "level": "error", "$workers": { "event": { "request": { "cf": { "requestHeaderNames": {}, "botManagement": { "detectionIds": {}, "corporateProxy": false, "verifiedBot": false, "jsDetection": { "passed": false, }, "staticResource": false, "score": 99, }, "isEUCountry": false, "tlsClientAuth": { "certRFC9440TooLarge": false, "certChainRFC9440TooLarge": false, "certPresented": "0", "certVerified": "NONE", "certRevoked": "0", "certIssuerDN": "", "certSubjectDN": "", "certIssuerDNRFC2253": "", "certSubjectDNRFC2253": "", "certIssuerDNLegacy": "", "certSubjectDNLegacy": "", "certSerial": "", "certIssuerSerial": "", "certSKI": "", "certIssuerSKI": "", "certFingerprintSHA1": "", "certFingerprintSHA256": "", "certNotBefore": "", "certNotAfter": "", "certRFC9440": "", "certChainRFC9440": "" }, "httpProtocol": "HTTP/3", "clientAcceptEncoding": "gzip, deflate, br", "requestPriority": "", "colo": "N/A", "asOrganization": "n/a", "country": "US", "city": "redacted", "continent": "NA", "region": "redacted", "regionCode": "NA", "timezone": "America/New_York", "longitude": "-redacted", "latitude": "redacted", "postalCode": "removed", "metroCode": "n/a", "tlsVersion": "TLSv1.3", "tlsCipher": "AEAD-AES256-GCM-SHA384", "tlsClientRandom": "wTqNGGU/lKt/OMu26rWBl38qL8YAE7UMyS1zVf78Xrw=", "tlsClientCiphersSha1": "Vvu1Wqm1r1OJOzu1ymEBLTp6Bxo=", "tlsClientExtensionsSha1": "5pSNXikPa/3pTynT+T6ETjQsEYQ=", "tlsClientExtensionsSha1Le": "otS3Q5sCQV2RmDJaBvTzr4DwJAc=", "tlsClientHelloLength": "1478", "verifiedBotCategory": "", "edgeRequestKeepAliveStatus": 1, "clientTcpRtt": 0, "clientQuicRtt": 26, "asn": n/a, "edgeL4": { "deliveryRate": 19336647, } }, "url": "https://emdash.example.com/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "method": "POST", "headers": { "accept": "*/*", "accept-encoding": "gzip, br", "accept-language": "en-US,en;q=0.9", "cf-connecting-ip": "redacted", "cf-ipcountry": "US", "cf-ray": "9ee4d9627fd4573a", "cf-visitor": "{"scheme":"https"}", "connection": "Keep-Alive", "content-length": "0", "cookie": "REDACTED", "host": "emdash.example.com", "origin": "https://emdash.example.com", "priority": "u=3, i", "referer": "https://emdash.example.com/_emdash/admin/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.4 Safari/605.1.15", "x-emdash-request": "1", "x-forwarded-proto": "https", "x-real-ip": "redacted" }, "path": "/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish" }, "rayId": "9ee4d9627fd4573a", "response": { "status": 500, } }, "truncated": false, "scriptName": "example-com-emdash", "outcome": "ok", "eventType": "fetch", "executionModel": "stateless", "scriptVersion": { "id": "2c05b7ee-8c16-46f4-84e7-97deb96e87d6" }, "requestId": "9ee4d9627fd4573a", "cpuTimeMs": 9, "wallTimeMs": 448, }, "$metadata": { "id": "01KPGMT6MJ8HMS9QKBRRNCNWB3", "requestId": "9ee4d9627fd4573a", "trigger": "POST /_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "service": "example-com-emdash", "level": "error", "error": "POST https://emdash.example.com/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "message": "POST https://emdash.example.com/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", "account": "483669ea821828435edea4557f0620ea", "type": "cf-worker-event", "fingerprint": "1a50c4deb71e224689a699e1a96190e5", "origin": "fetch", "messageTemplate": "POST https://emdash.example.com/_emdash/api/content/pages/01KPGMSTHB085S85Z1ESJNPKZ0/publish", } }
Activity
wchiquito commentedon Apr 19, 2026
Same error in a local environment trying to publish the page: About (emdash-demo (/emdash/demos/simple/)).
Environment
EmDash: commit ada4ac7 (HEAD -> main, origin/main, origin/HEAD)
Node.js: v25.9.0
SQLite: 3.46.1
Logs / error output
mahmingtea commentedon Apr 21, 2026
Same issue, after installing 0.6.0

even database direct change is showing this issue
database disk image is malformed: SQLITE_CORRUPT (extended: SQLITE_CORRUPT_VTAB)contestra commentedon Apr 21, 2026
Adding a data point that may help triage:
Same
SQLITE_CORRUPT_VTABreproduces on[email protected](post-PR #313). Specifically, anUPDATE ec_posts SET deleted_at = NULL ...failed today with:Hypothesis on why PR #313 didn't fully resolve this: PR #313 removes the
verifyAndRepairIndexstartupINSERTthat originally caused #252, which protects newly-created tenants going forward. But tenants whose FTS shadow tables were already corrupted before PR #313 landed don't get healed automatically — the corruption persists in their D1 and surfaces on the next mutation that fires an FTS trigger. The startup-time integrity-check that used to attempt the repair (and which #313 removed for being unsafe) was, paradoxically, also the only thing that would have detected and rebuilt corrupted indexes from earlier failed transactions.Recovery confirmed working — the FTS5-native
'rebuild'command clears the corruption with no data loss, and subsequent operations succeed:(Replace
_emdash_fts_postswith the relevant FTS table name per affected collection —_emdash_fts_answers,_emdash_fts_pages, etc.) Took ~5 seconds; the underlyingec_*content data is untouched; affected admin operations resumed working immediately.Suggested follow-ups (in addition to whatever's already being investigated for fresh corruption on 0.6.0):
INSERT INTO {fts_table}({fts_table}) VALUES('rebuild')on every FTS shadow table. Would clear latent corruption from pre-fix(core): remove FTS5 integrity-check to prevent D1 shadow table corruption #313 tenants automatically.SQLITE_CORRUPT_VTABat query time and self-heal by invoking the rebuild command before retrying the operation. Avoids requiring operators to discover the recovery command via deep-dive debugging.Happy to share more diagnostic output (D1 logs, schema state of the affected FTS shadow tables before/after the rebuild) if useful for narrowing down the residual cause that's still hitting
@mahmingteaon 0.6.0.mahmingtea commentedon Apr 22, 2026
INSERT INTO _emdash_fts_pages(_emdash_fts_pages) VALUES('rebuild');ran this directly in my D1 studio, issue still persist.
I have this same issue in my previous version 0.4.0. Delete everything d1, kv, r2 and fresh deployed again with 0.6.0. Also im not on paid worker so i disabled dynamic worker for plugin, no other changes.
Right now i have only one page and that is where my issue is.
When i enter this page from admin dashboard, all my unpublished changes were there. But when i refresh the page my published version was showing up with publish button enabled.
Clicking publish button return
{"error":{"code":"CONTENT_PUBLISH_ERROR","message":"Failed to publish content"}}mahmingtea commentedon Apr 22, 2026
This is interesting!
Now everything works after i disable the Search feature from content types
jcheese1 commentedon Apr 23, 2026
im getting this too, and disabling search fixed it for me as well. cc @ascorbic
ascorbic commentedon Apr 25, 2026
/ultrabonk can you investigate and see if you can find a root cause and propose a fix
ask-bonk commentedon Apr 25, 2026
@ascorbic Bonk workflow was cancelled.
View workflow run · To retry, trigger Bonk again.
ask-bonk commentedon Apr 25, 2026
Created PR #768
github run
ci(bonk): fix concurrency cancellation, missing PR templates, long ti…
ci(bonk): fix concurrency cancellation, missing PR templates, long ti…