ARTIFACTORY: Why do I get "Could not execute database migrations unknown migration in database"

Products
Frog_Artifactory
Content Type
Administration_Platform
AuthorFullName__c
Vignesh Surendrababu, Paul Pan
articleNumber
000005514
FirstPublishedDate
2022-12-21T08:43:03Z
lastModifiedDate
2025-05-15

ARTIFACTORY: Why do I get "Could not execute database migrations unknown migration in database"

If you experience issues with Artifactory failing to start and notice the following error in the metadata-service.log:
“Could not execute database migrations: unknown migration in database”

This indicates that the database is in an unknown migration state due to improperly applied upgrades.
This situation often arises during a failed upgrade attempt while attempting to downgrade or roll back.
Error snippet for reference: 
2022-11-22T11:58:34.814Z [jfmd ] [PANIC] [                ] [application.go:98             ] [main                ] - Could not execute database migrations unknown migration in database
jfrog.com/metadata/v7/services/common/db.validateNoUnknownMigrations
   jfrog.com/metadata/v7@v7.44.3/services/common/db/migrator_planner.go:61
jfrog.com/metadata/v7/services/common/db.findMigrationsToApply
   jfrog.com/metadata/v7@v7.44.3/services/common/db/migrator_planner.go:20
jfrog.com/metadata/v7/services/common/db.ApplyMigrationRecord
   jfrog.com/metadata/v7@v7.44.3/services/common/db/migrator.go:125
jfrog.com/metadata/v7/services/common/db.executeMigrations
   jfrog.com/metadata/v7@v7.44.3/services/common/db/migrator.go:67
jfrog.com/metadata/v7/services/common/db.runMigration
   jfrog.com/metadata/v7@v7.44.3/services/common/db/migrator.go:29

 

When downgrading Artifactory, it is advisable to restore to a VM and database snapshot taken before the upgrade was initialized.
However, if restoring from a snapshot is not feasible - perhaps due to an unavailable database backup or significant changes made since the last available snapshot—consider the following recovery steps:
 

1. Stop the Artifactory process and back up the current database as it is.
2. Identify all the table that starts with “md_”

select table_name FROM information_schema.tables WHERE table_name LIKE 'md_%';

3. Drop all the tables that start with “md_”
4. Start Artifactory again

Please note that if you choose this approach due to the lack of a functioning snapshot database to restore from, you will need to undergo metadata migration again, which should occur automatically unless configured otherwise after starting up Artifactory.