Skip to content

Commit 81f3692

Browse files
t3dotggclaude
andcommitted
fix(server): migrate-dev-db busy error names the stale-descriptor escape hatch
Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 961116f commit 81f3692

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎apps/server/scripts/migrate-dev-db.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ export class MigrateDevDbDestinationBusyError extends Schema.TaggedErrorClass<Mi
9191
},
9292
) {
9393
override get message(): string {
94+
if (this.reason === "server-running") {
95+
return `Dev database at '${this.databasePath}' is open by a running server (pid ${this.pid ?? "unknown"} per server-runtime.json). Stop that server first; if that pid is not actually a T3 server (stale descriptor, reused pid), delete the server-runtime.json next to the database and retry.`;
96+
}
9497
const detail =
95-
this.reason === "server-running"
96-
? `a running server has it open (pid ${this.pid ?? "unknown"} per server-runtime.json)`
97-
: this.reason === "write-locked"
98-
? "the database is write-locked"
99-
: "another connection is holding its WAL";
98+
this.reason === "write-locked"
99+
? "the database is write-locked"
100+
: "another connection is holding its WAL";
100101
return `Dev database at '${this.databasePath}' looks in use (${detail}). Stop the dev server first; if none is running, delete the -wal/-shm files next to it.`;
101102
}
102103
}

0 commit comments

Comments
 (0)