[GH-ISSUE #2990] migrations_lock database error, stuck on login page #2039

Closed
opened 2026-02-26 07:33:47 +03:00 by kerem · 5 comments
Owner

Originally created by @SteinMalte on GitHub (Jun 8, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2990

Hello,
I have an issue with my nginxproxymanager instance that I used for a couple of months.
One day I wanted to visist my grafana dashbaord but I was not forwarded. I found that my nginxproxymanager instance is unusable because of the following error that keeps me stuck on the login page of NPM with the "Bad Gateway" notification as shown in the screenshot below.

[6/8/2023] [10:08:29 PM] [Migrate  ] › ℹ  info      Current database version: 20211108145214
Can't take lock to run migrations: update `migrations_lock` set `is_locked` = 1 where `is_locked` = 0 - ER_OPEN_AS_READONLY: Table 'migrations_lock' is read only
If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock'
[6/8/2023] [10:08:29 PM] [Global   ] › ✖  error     update `migrations_lock` set `is_locked` = 1 where `is_locked` = 0 - ER_OPEN_AS_READONLY: Table 'migrations_lock' is read only

grafik

By the way this is my database log, as you can see I use the jc21/mariadb:latest image as intended by the docker-compose file on the official website.


[i] pre-init.d - processing /scripts/pre-init.d/01_secret-init.sh

[i] mysqld not found, creating....

[i] MySQL directory already present, skipping creation

2023-06-08 22:02:46 0 [Note] /usr/bin/mysqld (mysqld 10.4.15-MariaDB) starting as process 1 ...

2023-06-08 22:02:46 0 [Note] Plugin 'InnoDB' is disabled.

2023-06-08 22:02:46 0 [Note] Plugin 'FEEDBACK' is disabled.

2023-06-08 22:02:46 0 [Note] Server socket created on IP: '::'.

2023-06-08 22:02:46 0 [Warning] 'user' entry '@f3b7072f1615' ignored in --skip-name-resolve mode.

2023-06-08 22:02:46 0 [Warning] 'proxies_priv' entry '@% root@f3b7072f1615' ignored in --skip-name-resolve mode.

2023-06-08 22:02:46 0 [Note] Reading of all Master_info entries succeeded

2023-06-08 22:02:46 0 [Note] Added new Master_info '' to hash table

2023-06-08 22:02:46 0 [Note] /usr/bin/mysqld: ready for connections.

Version: '10.4.15-MariaDB'  socket: '/run/mysqld/mysqld.sock'  port: 3306  MariaDB Server

Basically I did not change anything manually, all of my updates are performed by watchtower.
I hope there is a way to recover my database so that I do not have to reconfigure eveyting.
Regards, Malte

Originally created by @SteinMalte on GitHub (Jun 8, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2990 Hello, I have an issue with my nginxproxymanager instance that I used for a couple of months. One day I wanted to visist my grafana dashbaord but I was not forwarded. I found that my nginxproxymanager instance is unusable because of the following error that keeps me stuck on the login page of NPM with the "Bad Gateway" notification as shown in the screenshot below. ``` [6/8/2023] [10:08:29 PM] [Migrate ] › ℹ info Current database version: 20211108145214 Can't take lock to run migrations: update `migrations_lock` set `is_locked` = 1 where `is_locked` = 0 - ER_OPEN_AS_READONLY: Table 'migrations_lock' is read only If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock' [6/8/2023] [10:08:29 PM] [Global ] › ✖ error update `migrations_lock` set `is_locked` = 1 where `is_locked` = 0 - ER_OPEN_AS_READONLY: Table 'migrations_lock' is read only ``` ![grafik](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/92629910/e7cd41c5-0580-492b-aec1-9c018da8a906) By the way this is my database log, as you can see I use the jc21/mariadb:latest image as intended by the docker-compose file on the official website. ``` [i] pre-init.d - processing /scripts/pre-init.d/01_secret-init.sh [i] mysqld not found, creating.... [i] MySQL directory already present, skipping creation 2023-06-08 22:02:46 0 [Note] /usr/bin/mysqld (mysqld 10.4.15-MariaDB) starting as process 1 ... 2023-06-08 22:02:46 0 [Note] Plugin 'InnoDB' is disabled. 2023-06-08 22:02:46 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-06-08 22:02:46 0 [Note] Server socket created on IP: '::'. 2023-06-08 22:02:46 0 [Warning] 'user' entry '@f3b7072f1615' ignored in --skip-name-resolve mode. 2023-06-08 22:02:46 0 [Warning] 'proxies_priv' entry '@% root@f3b7072f1615' ignored in --skip-name-resolve mode. 2023-06-08 22:02:46 0 [Note] Reading of all Master_info entries succeeded 2023-06-08 22:02:46 0 [Note] Added new Master_info '' to hash table 2023-06-08 22:02:46 0 [Note] /usr/bin/mysqld: ready for connections. Version: '10.4.15-MariaDB' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server ``` Basically I did not change anything manually, all of my updates are performed by watchtower. I hope there is a way to recover my database so that I do not have to reconfigure eveyting. Regards, Malte
kerem 2026-02-26 07:33:47 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@centralhardware commented on GitHub (Jul 1, 2023):

any solution? certificates are expiring, and it's no way to update them, due this error

<!-- gh-comment-id:1616084433 --> @centralhardware commented on GitHub (Jul 1, 2023): any solution? certificates are expiring, and it's no way to update them, due this error
Author
Owner

@SteinMalte commented on GitHub (Jul 1, 2023):

Yeah kind of, I switched the jc21/mariadb-aria:latest image for the offical mariadb:latest image in the docker-compose.yml and at at least it seems to be working at the moment my settings are not gone but it does not feel safe. On top of that it is throwing warnings as soon as someone tries to access nginxproxymanager so I really do not feel very good about this solution.
What I have found is that the installation manual on the NPM website seems like using a database was optional but I dont know if that is correct and havent tried without yet. Id advise you to use the mariadb image fix like I did and save your settings in case something does break forever.

<!-- gh-comment-id:1616093450 --> @SteinMalte commented on GitHub (Jul 1, 2023): Yeah kind of, I switched the jc21/mariadb-aria:latest image for the offical mariadb:latest image in the docker-compose.yml and at at least it seems to be working at the moment my settings are not gone but it does not feel safe. On top of that it is throwing warnings as soon as someone tries to access nginxproxymanager so I really do not feel very good about this solution. What I have found is that the installation manual on the NPM website seems like using a database was optional but I dont know if that is correct and havent tried without yet. Id advise you to use the mariadb image fix like I did and save your settings in case something does break forever.
Author
Owner

@nmatton commented on GitHub (Aug 22, 2023):

this fix also works for me, but as you said, probably not the cleaner one

<!-- gh-comment-id:1687891187 --> @nmatton commented on GitHub (Aug 22, 2023): this fix also works for me, but as you said, probably not the cleaner one
Author
Owner

@github-actions[bot] commented on GitHub (Apr 11, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2048791759 --> @github-actions[bot] commented on GitHub (Apr 11, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Jun 8, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2953428092 --> @github-actions[bot] commented on GitHub (Jun 8, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#2039
No description provided.