drizzle-team/drizzle-orm · error · Error
Failed to parse migration: ${journalEntry.tag}
Error message
Failed to parse migration: ${journalEntry.tag} What it means
Error "Failed to parse migration: ${journalEntry.tag}" thrown in drizzle-team/drizzle-orm.
Source
Thrown at drizzle-orm/src/durable-sqlite/migrator.ts:34
const query = migrations[`m${journalEntry.idx.toString().padStart(4, '0')}`];
if (!query) {
throw new Error(`Missing migration: ${journalEntry.tag}`);
}
try {
const result = query.split('--> statement-breakpoint').map((it) => {
return it;
});
migrationQueries.push({
sql: result,
bps: journalEntry.breakpoints,
folderMillis: journalEntry.when,
hash: '',
});
} catch {
throw new Error(`Failed to parse migration: ${journalEntry.tag}`);
}
}
return migrationQueries;
}
export async function migrate<
TSchema extends Record<string, unknown>,
>(
db: DrizzleSqliteDODatabase<TSchema>,
config: MigrationConfig,
): Promise<void> {
const migrations = readMigrationFiles(config);
db.transaction((tx) => {
try {
const migrationsTable = '__drizzle_migrations';
View on GitHub (pinned to b7862528fd)
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().
When it happens
Trigger: 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).
Common situations: Manually edited or partially copied migrations folder; mismatched journal and snapshot files; interrupted drizzle-kit generate.
AI-assisted analysis of drizzle-team/drizzle-orm@b7862528fd (2026-08-03).
Data as JSON: /data/errors/86821ea7e8993b95.json.
Report an issue: GitHub.