Windows CRLF breaks SQLite trigger migrations: a ChatGPT Sites + Cloudflare D1 debugging story
CryptoDir · reddit · 2026-10-05
A detailed debugging writeup of a ChatGPT Sites managed deployment failing with incomplete input: SQLITEERROR during a Cloudflare D1 migration that creates two SQLite triggers.
Findings: local Wrangler/workerd tests passed; the Git file is LF (1,781 bytes), but Windows core.autocrlf=true converted the checkout to CRLF, and the packager preserved checkout bytes — the deployed archive was CRLF (1,816 bytes, 35 extra carriage returns). The triggers use uppercase BEGIN and SELECT RAISE(…) bodies, matching Cloudflare workers-sdk issues #14991 and #15314 on trigger parsing, keyword casing and line endings.
Fix: a narrowly scoped .gitattributes rule restoring LF for that migration, whose resulting bytes match the original Git blob exactly.
Open problem: Sites tools don't expose the migration ledger or trigger definitions, so it's unclear whether the failed migration was wholly rolled back, partially applied, or recorded. The author awaits read-only state confirmation from support and wants a minimal, data-preserving recovery — not a database reset.
More from coding & agent
- Designing a programming language for AI agents, not humans — mark_k · 2026-10-05
- Thoughtworks engineer tests local models for agentic coding on Apple M3 Max and M5 Pro — bibryam · 2026-10-05
- AI agents are about to flood the workforce, and no one's ready: WIRED — Dr_Singularity · 2026-10-05
- New Paper IGP-Bench Teaches AI Agents When to Stop Chasing a Wrong Idea — _sathvikr · 2026-10-05
- AI decompilation era: PS5 is 80% ported to PC and 'closed source' is ending — almmaasoglu · 2026-10-05
- Claude Code ignores steering messages, Codex always acknowledges them — Angaisb_ · 2026-10-05