# Node memory issues - Migration lock

**URL:** <https://forum.ghost.org/t/node-memory-issues-migration-lock/57935>\
**Category:** Developer help\
**Created:** [June 4, 2025, 11:41pm UTC](https://forum.ghost.org/t/node-memory-issues-migration-lock/57935 "2025-06-04T23:41:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gill](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gill/32/36028_2.png) [@Gill](https://forum.ghost.org/u/Gill)\
**Post date:** [June 4, 2025, 11:41pm UTC](https://forum.ghost.org/t/node-memory-issues-migration-lock/57935/1 "2025-06-04T23:41:13Z")

</div>

I’m using docker container, and was trying to upgrade to new image from 5.119 to latest release and the docker container keeps rebooting with this error below. MySQL shows no migration locks in the table.

ERROR Migration lock was never released or currently a migration is running.  
Migration lock was never released or currently a migration is running.

“If you are sure no migration is running, check your data and if your database is in a broken state, you could run `yarn knex-migrator rollback`.”

Error ID: 500

My SQL v.8

**Select \* from migrations\_lock; → No records// No locks at the database level**

Server specs - 64GB RAM, 50GB allocated to NODE (v20) via docker compose

- NODE\_OPTIONS=–max-old-space-size=50000

Total Ghost posts - 60,000

Is it possible to disable this migration step or lock check? My production site is down now ☹

Do I need to do a fresh reinstall or is there any hope?

---

<div class="post-metadata">

**Author:** ![jannis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jannis/32/39718_2.png) [@jannis](https://forum.ghost.org/u/jannis)\
**Post date:** [June 5, 2025, 7:12am UTC](https://forum.ghost.org/t/node-memory-issues-migration-lock/57935/2 "2025-06-05T07:12:26Z")

</div>

Have a look here:

> [@Migration lock after updating Ghost](https://forum.ghost.org/t/migration-lock-after-updating-ghost/5625/5):
>
> The only recommend way to install Ghost is [using the Ghost-CLI.](https://docs.ghost.org/api/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';

Are you sure `migrations_lock` is empty? That would be unusual, since there should always be an entry – the “lock” itself is controlled with the `locked` table.

(also, cc-ing people is a bit odd – two of the accounts you mentioned have not been active here in years)

---

<div class="post-metadata">

**Author:** ![Gill](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gill/32/36028_2.png) [@Gill](https://forum.ghost.org/u/Gill)\
**Post date:** [June 5, 2025, 3:30pm UTC](https://forum.ghost.org/t/node-memory-issues-migration-lock/57935/3 "2025-06-05T15:30:18Z")

</div>

Thank you for your response. I cc’d users after seeing their posts with the same error and was hoping to get their attention. I was able to to recover my site using mysqldump import/export. But seems like it is a core limitation of Ghost CMS with large posts. The `JSON.Stringify()` limits prevents users from doing an export of all content via the admin UI. The same function causes lockups during database migrations because Ghost tries to create a backup (ghost/core/core/server/data/db/backup.js) before the migration, which never happens because of the hard limit and you are stuck in a loop.

It seems like a bug, which was reported on Github but never fixed.

> <https://github.com/TryGhost/Ghost/issues/19131>
>
> \### Issue Summary
> 
> Debug Information:
> OS: Ubuntu, v22.04.3 LTS
> Node …Version: v18.18.0
> Ghost Version: 5.72.0
> Ghost-CLI Version: 1.25.3
> Environment: production
> Command: 'ghost setup'
> 
> \### Steps to Reproduce
> 
> ✔ Setting up "ghost" system user
> ℹ Setting up "ghost" mysql user \[skipped\]
> Nginx is not installed. Skipping Nginx setup.
> ℹ Setting up Nginx \[skipped\]
> Nginx setup task was skipped, skipping SSL setup
> ℹ Setting up SSL \[skipped\]
> Systemd service has already been set up. Skipping Systemd setup
> ℹ Setting up Systemd \[skipped\]
> + sudo systemctl is-active ghost\_zee-com
> ? Do you want to start Ghost? Yes
> + sudo systemctl start ghost\_zee-com
> + sudo systemctl stop ghost\_zee-com
> ✖ Starting Ghost
> One or more errors occurred.
> 
> 1) GhostError
> 
> Message: Ghost was able to start, but errored during boot with: Migration lock was never released or currently a migration is running.
> Help: If you are sure no migration is running, check your data and if your database is in a broken state, you could run \`yarn knex-migrator rollback\`.
> Suggestion: journalctl -u ghost\_zee-com -n 50
> 
> Debug Information:
> OS: Ubuntu, v22.04.3 LTS
> Node Version: v18.18.0
> Ghost Version: 5.72.0
> Ghost-CLI Version: 1.25.3
> Environment: production
> Command: 'ghost setup'
> 
> \### Ghost Version
> 
> 5.72.0
> 
> \### Node.js Version
> 
> 18.18.0
> 
> \### How did you install Ghost?
> 
> ubuntu 22.04
> 
> \### Database type
> 
> MySQL 8
> 
> \### Browser & OS version
> 
> \_No response\_
> 
> \### Relevant log / error output
> 
> \`\`\`shell
> {
> message: {
> statusCode: 500,
> errorType: 'MigrationsAreLockedError',
> level: 'critical',
> message: 'Ghost was able to start, but errored during boot with: Migration lock was never released or currently a migration is running.',
> id: 500,
> help: 'If you are sure no migration is running, check your data and if your database is in a broken state, you could run \`yarn knex-migrator rollback\`.',
> name: 'MigrationsAreLockedError',
> code: null,
> property: null,
> redirect: null,
> hideStack: false
> }
> }
> Node.js v18.18.0
> \`\`\`
> 
> 
> \### Code of Conduct
> 
> \- \[X\] I agree to be friendly and polite to people in this repository
