Migration lock after updating Ghost


I’ve been running Ghost on a Heroku server for the past few months. It’s based on the Ghost on Heroku projecet. Today I tried upgrading the Ghost library from 2.9.1 to 2.14.1 and since I did I’ve been receiving the following error:

Unhandled rejection MigrationsAreLockedError: Migration lock was never released or currently a migration is running.

Reverting didn’t help and now I can’t modify my database become of this. Is there anything I can do?



This only appears if the migration process was destroyed while the migrator migrates your database. The lock was never released because the process was destroyed. Locking the database is important and protects multiple processes trying to migrate your database.

Did you run ghost update --rollback already? It should force a rollback from the CLI.



No I haven’t, let me give that a try



I tried running that command but it didn’t detect any Ghost installs. I think this is because my project uses the npm module for Ghost. The error says I can release the lock by running an Update SQL query but there are no entries in the migration_lock table of my database.

Are there any ways to rollback then?



The only recommend way to install Ghost is using the Ghost-CLI.

You can manually unlock the database. But be aware that you are responsible for manual actions like that. You should double check the health of your database before running this command.

UPDATE migrations_lock set locked=0 where lock_key='km01';


Thanks for the help Kate. Turns out it wasn’t a Ghost problem but my DB had reached the size limit on the free plan I used :disappointed:


closed #7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.