[GH-ISSUE #4942] [Bug] "The migration directory is corrupt, the following files are missing:" when re-building the container #3070

Open
opened 2026-02-26 07:37:45 +03:00 by kerem · 9 comments
Owner

Originally created by @ViNoS-ab on GitHub (Nov 15, 2025).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4942

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?

Describe the bug
I rebuilt the npm image, then i couldn't login
checked the logs and :

[11/15/2025] [5:47:05 AM] [Migrate  ] › ℹ  info      Current database version: none
[11/15/2025] [5:47:05 AM] [Global   ] › ✖  error     The migration directory is corrupt, the following files are missing: 20251111090000_redirect_auto_scheme.js Error: The migration directory is corrupt, the following files are missing: 20251111090000_redirect_auto_scheme.js
    at validateMigrationList (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:566:11)
    at Migrator.latest (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:69:7)
ls -lna data/npm
total 204
drwxr-xr-x 7    0    0   4096 Nov 14 00:35 .
drwxr-xr-x 6 1001 1002   4096 Jul 30 11:58 ..
-rw-r--r-- 1    0    0     13 Jul 28 18:02 .gitignore
drwxr-xr-x 2    0    0   4096 Jul 28 22:37 access
-rw-r--r-- 1 1001 1002    259 Oct 22 09:09 cleanup.log //ignore this
drwxr-xr-x 3    0    0   4096 Oct 28 21:51 custom_ssl
-rwxrwxrwx 1    0    0 147456 Nov 14 00:35 database.sqlite
-rw-r--r-- 1    0    0   2186 Jul 28 22:38 keys.json
drwxr-xr-x 3    0    0   4096 Jul 29 14:35 letsencrypt-acme-challenge
drwxr-xr-x 2    0    0  20480 Nov 13 21:22 logs
drwxr-xr-x 9    0    0   4096 Jul 28 22:37 nginx

Nginx Proxy Manager Version
v2.12.6

To Reproduce
I had a running npm container, then I rebuilt the container from :latest image and i had this error, I am using sqlite

Operating System
Ubuntu server

Additional context
docker-compose

  nginx-proxy-manager:
    image: jc21/nginx-proxy-manager:latest
    container_name: dns-npm
    environment:
      DB_SQLITE_FILE: "/data/database.sqlite"
    volumes:
      - ./data/npm:/data
      - ./data/letsencrypt:/etc/letsencrypt
      - ./data/letsencrypt/logs:/tmp/letsencrypt-log
      - ./data/letsencrypt-acme-challenge:/data/letsencrypt-acme-challenge
    ports:
      - "${HTTP_PORT:-80}:80"
      - "${HTTPS_PORT:-443}:443"
      - "${NPM_PORT:-81}:81"
Originally created by @ViNoS-ab on GitHub (Nov 15, 2025). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4942 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes - [https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1907](url) - however it is closed and the solution didn't work for me **Describe the bug** I rebuilt the npm image, then i couldn't login checked the logs and : ```log [11/15/2025] [5:47:05 AM] [Migrate ] › ℹ info Current database version: none [11/15/2025] [5:47:05 AM] [Global ] › ✖ error The migration directory is corrupt, the following files are missing: 20251111090000_redirect_auto_scheme.js Error: The migration directory is corrupt, the following files are missing: 20251111090000_redirect_auto_scheme.js at validateMigrationList (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:566:11) at Migrator.latest (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:69:7) ``` ```bash ls -lna data/npm total 204 drwxr-xr-x 7 0 0 4096 Nov 14 00:35 . drwxr-xr-x 6 1001 1002 4096 Jul 30 11:58 .. -rw-r--r-- 1 0 0 13 Jul 28 18:02 .gitignore drwxr-xr-x 2 0 0 4096 Jul 28 22:37 access -rw-r--r-- 1 1001 1002 259 Oct 22 09:09 cleanup.log //ignore this drwxr-xr-x 3 0 0 4096 Oct 28 21:51 custom_ssl -rwxrwxrwx 1 0 0 147456 Nov 14 00:35 database.sqlite -rw-r--r-- 1 0 0 2186 Jul 28 22:38 keys.json drwxr-xr-x 3 0 0 4096 Jul 29 14:35 letsencrypt-acme-challenge drwxr-xr-x 2 0 0 20480 Nov 13 21:22 logs drwxr-xr-x 9 0 0 4096 Jul 28 22:37 nginx ``` **Nginx Proxy Manager Version** v2.12.6 **To Reproduce** I had a running npm container, then I rebuilt the container from :latest image and i had this error, I am using sqlite **Operating System** Ubuntu server **Additional context** docker-compose ```yml nginx-proxy-manager: image: jc21/nginx-proxy-manager:latest container_name: dns-npm environment: DB_SQLITE_FILE: "/data/database.sqlite" volumes: - ./data/npm:/data - ./data/letsencrypt:/etc/letsencrypt - ./data/letsencrypt/logs:/tmp/letsencrypt-log - ./data/letsencrypt-acme-challenge:/data/letsencrypt-acme-challenge ports: - "${HTTP_PORT:-80}:80" - "${HTTPS_PORT:-443}:443" - "${NPM_PORT:-81}:81" ```
Author
Owner

@ViNoS-ab commented on GitHub (Nov 15, 2025):

for now i am using jc21/nginx-proxy-manager:2.13.2
and it is working
but using latest will cause the error
this is because in the error, the missing migration file is 20251111090000_redirect_auto_scheme.js which was added 4 days ago

<!-- gh-comment-id:3536286159 --> @ViNoS-ab commented on GitHub (Nov 15, 2025): for now i am using jc21/nginx-proxy-manager:2.13.2 and it is working but using latest will cause the error this is because in the error, the missing migration file is `20251111090000_redirect_auto_scheme.js` which was added 4 days ago
Author
Owner

@jc21 commented on GitHub (Nov 18, 2025):

Yes, this is expected behaviour for anyone who upgrades to newer releases and then downgrades for whatever reason.

This migration was added in v2.13.3 and has been applied to your database. You mentioned initially using v2.12.6 which is not going to work with a 2.13.3 database.

<!-- gh-comment-id:3547301412 --> @jc21 commented on GitHub (Nov 18, 2025): Yes, this is expected behaviour for anyone who upgrades to newer releases and then downgrades for whatever reason. This migration was added in [v2.13.3](https://github.com/NginxProxyManager/nginx-proxy-manager/releases/tag/v2.13.3) and has been applied to your database. You mentioned initially using v2.12.6 which is not going to work with a 2.13.3 database.
Author
Owner

@poprhythm commented on GitHub (Nov 18, 2025):

I was also getting this error after doing an update to latest yesterday. I also tried to revert to a 2.12 version, but it didn't work as you'd mentioned. I'm back at latest (2.13.5) right now. The nginx configuration is working great, but I can no longer log into the web ui. Here is the error:

[11/18/2025] [1:04:31 PM] [Express  ] › ⚠  warning   Cannot read properties of null (reading 'id')
[11/18/2025] [1:04:32 PM] [Access   ] › ✖  error     reports:hosts 1 Permission Denied
[11/18/2025] [1:04:50 PM] [Express  ] › ⚠  warning   error is not defined
<!-- gh-comment-id:3547581695 --> @poprhythm commented on GitHub (Nov 18, 2025): I was also getting this error after doing an update to latest yesterday. I also tried to revert to a 2.12 version, but it didn't work as you'd mentioned. I'm back at latest (2.13.5) right now. The nginx configuration is working great, but I can no longer log into the web ui. Here is the error: ``` [11/18/2025] [1:04:31 PM] [Express ] › ⚠ warning Cannot read properties of null (reading 'id') [11/18/2025] [1:04:32 PM] [Access ] › ✖ error reports:hosts 1 Permission Denied [11/18/2025] [1:04:50 PM] [Express ] › ⚠ warning error is not defined ```
Author
Owner

@kmarius commented on GitHub (Dec 5, 2025):

Is there an issue with the migrations? I updated to 2.13.5 13 days ago and had no problems. Today I changed the name of an access list and now the web UI broke. The Dashboard does not load and the logs show the same errors as for @poprhythm. I did not up- or downgrade to any other version.

Edit: Seems to be a different problem. I restored from a backup and noticed that there was a mismatch between the Username for the Access List > Authorization and the login username (which I changed at some point)

<!-- gh-comment-id:3617123441 --> @kmarius commented on GitHub (Dec 5, 2025): Is there an issue with the migrations? I updated to 2.13.5 13 days ago and had no problems. Today I changed the name of an access list and now the web UI broke. The Dashboard does not load and the logs show the same errors as for @poprhythm. I did not up- or downgrade to any other version. Edit: Seems to be a different problem. I restored from a backup and noticed that there was a mismatch between the Username for the Access List > Authorization and the login username (which I changed at some point)
Author
Owner

@JakobTewes commented on GitHub (Dec 15, 2025):

also got problems with the thing. What was the fix for you, @kmarius?

<!-- gh-comment-id:3655999044 --> @JakobTewes commented on GitHub (Dec 15, 2025): also got problems with the thing. What was the fix for you, @kmarius?
Author
Owner

@kmarius commented on GitHub (Dec 15, 2025):

also got problems with the thing. What was the fix for you, @kmarius?

I restored the configuration from a backup and removed all Authorizations from all Access Lists via the UI (tbf I don't remember adding any). If you don't have a backup you could try modifying the database.sqlite. My access_list_auth table is now empty.

Another thing that I thought about afterwards is that I was proxying the web ui via NPM, maybe it works if you access it directly via its port on the container.

<!-- gh-comment-id:3656094887 --> @kmarius commented on GitHub (Dec 15, 2025): > also got problems with the thing. What was the fix for you, [@kmarius](https://github.com/kmarius)? I restored the configuration from a backup and removed all Authorizations from all Access Lists via the UI (tbf I don't remember adding any). If you don't have a backup you could try modifying the `database.sqlite`. My `access_list_auth` table is now empty. Another thing that I thought about afterwards is that I was proxying the web ui via NPM, maybe it works if you access it directly via its port on the container.
Author
Owner

@poprhythm commented on GitHub (Dec 15, 2025):

I also rolled back and I remember having to adjust the database as well. I don't remember exactly, but I think a database migration row had to be removed. I was also using it with an NPM proxy - I had to directly access the server by IP during the process.

<!-- gh-comment-id:3656112364 --> @poprhythm commented on GitHub (Dec 15, 2025): I also rolled back and I remember having to adjust the database as well. I don't remember exactly, but I think a database migration row had to be removed. I was also using it with an NPM proxy - I had to directly access the server by IP during the process.
Author
Owner

@JakobTewes commented on GitHub (Dec 15, 2025):

Found a working solution for me. Was (as always ;-)) a dns issue:

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/5085

<!-- gh-comment-id:3656247638 --> @JakobTewes commented on GitHub (Dec 15, 2025): Found a working solution for me. Was (as always ;-)) a dns issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/5085
Author
Owner

@lastplace1990 commented on GitHub (Dec 25, 2025):

I am having the same issues as of today exactly. I had to pin the latest build 2.13.5 to make this work for me. But when using latest it fails and my logs show the same error:

The migration directory is corrupt, the following files are missing: 20251111090000_redirect_auto_scheme.js
<!-- gh-comment-id:3691008282 --> @lastplace1990 commented on GitHub (Dec 25, 2025): I am having the same issues as of today exactly. I had to pin the latest build `2.13.5` to make this work for me. But when using `latest` it fails and my logs show the same error: ``` The migration directory is corrupt, the following files are missing: 20251111090000_redirect_auto_scheme.js
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#3070
No description provided.