[Bug] "The migration directory is corrupt, the following files are missing:" when re-building the container
Checklist
- Have you pulled and found the error with
jc21/nginx-proxy-manager:latestdocker 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
- 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 :
[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"
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
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.
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