{"id":"86821ea7e8993b95","repo":"drizzle-team/drizzle-orm","slug":"failed-to-parse-migration-journalentry-tag","errorCode":null,"errorMessage":"Failed to parse migration: ${journalEntry.tag}","messagePattern":"Failed to parse migration: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-orm/src/durable-sqlite/migrator.ts","lineNumber":34,"sourceCode":"\t\tconst query = migrations[`m${journalEntry.idx.toString().padStart(4, '0')}`];\n\n\t\tif (!query) {\n\t\t\tthrow new Error(`Missing migration: ${journalEntry.tag}`);\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = query.split('--> statement-breakpoint').map((it) => {\n\t\t\t\treturn it;\n\t\t\t});\n\n\t\t\tmigrationQueries.push({\n\t\t\t\tsql: result,\n\t\t\t\tbps: journalEntry.breakpoints,\n\t\t\t\tfolderMillis: journalEntry.when,\n\t\t\t\thash: '',\n\t\t\t});\n\t\t} catch {\n\t\t\tthrow new Error(`Failed to parse migration: ${journalEntry.tag}`);\n\t\t}\n\t}\n\n\treturn migrationQueries;\n}\n\nexport async function migrate<\n\tTSchema extends Record<string, unknown>,\n>(\n\tdb: DrizzleSqliteDODatabase<TSchema>,\n\tconfig: MigrationConfig,\n): Promise<void> {\n\tconst migrations = readMigrationFiles(config);\n\n\tdb.transaction((tx) => {\n\t\ttry {\n\t\t\tconst migrationsTable = '__drizzle_migrations';\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-orm/src/durable-sqlite/migrator.ts#L16-L52","documentation":"Error \"Failed to parse migration: ${journalEntry.tag}\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Running Durable SQLite migrations when a journal entry's SQL cannot be read or parsed (corrupt, truncated, or missing migration file referenced by meta/_journal.json).","commonSituations":"Manually edited or partially copied migrations folder; mismatched journal and snapshot files; interrupted drizzle-kit generate.","solutions":["Ensure the migration folder passed to migrate() matches the folder generated by drizzle-kit generate, and that the .sql file content for the given tag is intact and valid SQL.","If the migration file was edited manually, regenerate it with drizzle-kit generate and re-run migrate()."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}