NginxProxyManager / NginxProxyManager/nginx-proxy-manager
[Bug] "The migration directory is corrupt, the following files are missing:" when re-building the container
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34.2k
- Forks
- 3.9k
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 20
Description
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"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating 20251111090000_redirect_auto_scheme.js and the migration packaging used in the latest Docker image; the reported failure enters Knex's Migrator.latest at /app/node_modules/knex/lib/migrations/migrate/Migrator.js. Compare the migration files in the rebuilt image with the existing data/npm/database.sqlite state. Done means rebuilding the container no longer reports a missing migration and login works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, javascript, sqlite
- Domain
- database, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100