Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Improve broken database error logs

Chocobozzz6df5a0011df7
diff --git a/server/core/initializers/migrator.ts b/server/core/initializers/migrator.ts
index a6494fb162..934f826440 100644
--- a/server/core/initializers/migrator.ts
+++ b/server/core/initializers/migrator.ts
@@ -26,8 +26,12 @@ async function migrate () {
}
if (actualVersion === null) {
- await sequelizeTypescript.query('INSERT INTO "application" ("migrationVersion") VALUES (0)')
- actualVersion = 0
+ logger.error(
+ 'Cannot find migration version. The database is corrupted or incomplete. ' +
+ ' If it is a new install, the first run of PeerTube may have resulted in an error: check your previous logs to find it. ' +
+ ' Then, restart PeerTube with an empty database'
+ )
+ process.exit(-1)
}
// No need migrations, abort