NginxProxyManager / NginxProxyManager/nginx-proxy-manager

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

Open
#4,942 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
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: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"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.