[GH-ISSUE #387] Migrations fail on initial start up #329

Closed
opened 2026-02-26 06:32:20 +03:00 by kerem · 1 comment
Owner

Originally created by @chriskacerguis on GitHub (Apr 25, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/387

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
  • Are you sure you're not using someone else's docker image?
  • If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network?

Describe the bug
Starting the container for the first time, I am getting the following errors in my logs:

[4/25/2020] [8:24:25 PM] [Global   ] › ✖  error     insert into "setting" ("description", "id", "meta", "name", "value") values ($1, $2, $3, $4, $5) returning "id" - relation "setting" does not exist
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      Current database version: none
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] auth Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] user Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] user_permission Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] proxy_host Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] redirection_host Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] dead_host Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] stream Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] access_list Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] certificate Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] access_list_auth Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [initial-schema] audit_log Table created
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [websockets] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [websockets] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [forward_host] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [forward_host] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [http2_support] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [http2_support] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [http2_support] redirection_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [http2_support] dead_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [forward_scheme] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [forward_scheme] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [disabled] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [disabled] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [disabled] redirection_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [disabled] dead_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [disabled] stream Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [custom_locations] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [custom_locations] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [hsts] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [hsts] proxy_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [hsts] redirection_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [hsts] dead_host Table altered
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [settings] Migrating Up...
[4/25/2020] [8:24:26 PM] [Migrate  ] › ℹ  info      [settings] setting Table created
migration file "20190227065017_settings.js" failed
migration failed with error: insert into "setting" ("description", "id", "meta", "name", "value") values ($1, $2, $3, $4, $5) returning "id" - relation "setting" does not exist

[the log repeats that over and over]

  • What version of Nginx Proxy Manager is reported on the login page?
    v2.2.3

To Reproduce
Steps to reproduce the behavior:

  1. Created config.json file
  2. Ran the following in bash on Ubuntu 18.04
docker run --name=proxymanager \
--restart=always \
--network=internal \
-p 80:80 \
-p 81:81 \
-p 443:443 \
-v /opt/ssl:/ssl \
-v /opt/proxymanager/config.json:/app/config/production.json \
-v /opt/proxymanager/data:/data \
-v /opt/proxymanager/le:/etc/letsencrypt \
-d jc21/nginx-proxy-manager:latest

At that point I am unable to login, and when looking at the logs, I get the above error. (on a related note, I got 2 unable to find module body-parser and pg. I docker exec'd into the container and manually installed them with npm i pg and npm i body-parser

Interesting to note, the logs indicate that several tables were created, however when I log into the DB server, there are only two created migrations and migrations_lock

Expected behavior
I expected the container to start correctly, doing whatever it needs to do on first run. Then logging into and doing all the things.

Screenshots
n/a

Operating System
Ubuntu 18.04

Additional context
Docker version 19.03.8

root@server:/opt/proxymanager# more config.json 
{
  "database": {
    "engine": "postgres",
    "host": "XXXXXX",
    "name": "proxymanager",
    "user": "XXXXXX",
    "password": "XXXXXX",
    "port": 5432
  }
}

Originally created by @chriskacerguis on GitHub (Apr 25, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/387 **Checklist** - [x] Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - [x] Are you sure you're not using someone else's docker image? - [x] If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network? **Describe the bug** Starting the container for the first time, I am getting the following errors in my logs: ```sh [4/25/2020] [8:24:25 PM] [Global ] › ✖ error insert into "setting" ("description", "id", "meta", "name", "value") values ($1, $2, $3, $4, $5) returning "id" - relation "setting" does not exist [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info Current database version: none [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] auth Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] user Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] user_permission Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] proxy_host Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] redirection_host Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] dead_host Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] stream Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] access_list Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] certificate Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] access_list_auth Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [initial-schema] audit_log Table created [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [websockets] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [websockets] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [forward_host] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [http2_support] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [http2_support] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [http2_support] redirection_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [http2_support] dead_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [forward_scheme] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [forward_scheme] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [disabled] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [disabled] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [disabled] redirection_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [disabled] dead_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [disabled] stream Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [custom_locations] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [custom_locations] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [hsts] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [hsts] proxy_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [hsts] redirection_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [hsts] dead_host Table altered [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [settings] Migrating Up... [4/25/2020] [8:24:26 PM] [Migrate ] › ℹ info [settings] setting Table created migration file "20190227065017_settings.js" failed migration failed with error: insert into "setting" ("description", "id", "meta", "name", "value") values ($1, $2, $3, $4, $5) returning "id" - relation "setting" does not exist ``` [the log repeats that over and over] - What version of Nginx Proxy Manager is reported on the login page? v2.2.3 **To Reproduce** Steps to reproduce the behavior: 1. Created ```config.json``` file 2. Ran the following in bash on Ubuntu 18.04 ```sh docker run --name=proxymanager \ --restart=always \ --network=internal \ -p 80:80 \ -p 81:81 \ -p 443:443 \ -v /opt/ssl:/ssl \ -v /opt/proxymanager/config.json:/app/config/production.json \ -v /opt/proxymanager/data:/data \ -v /opt/proxymanager/le:/etc/letsencrypt \ -d jc21/nginx-proxy-manager:latest ``` At that point I am unable to login, and when looking at the logs, I get the above error. (on a related note, I got 2 unable to find module ```body-parser``` and ```pg```. I ```docker exec```'d into the container and manually installed them with ```npm i pg``` and ```npm i body-parser``` Interesting to note, the logs indicate that several tables were created, however when I log into the DB server, there are only two created ```migrations``` and ```migrations_lock``` **Expected behavior** I expected the container to start correctly, doing whatever it needs to do on first run. Then logging into and doing all the things. **Screenshots** n/a **Operating System** Ubuntu 18.04 **Additional context** Docker version 19.03.8 ```sh root@server:/opt/proxymanager# more config.json { "database": { "engine": "postgres", "host": "XXXXXX", "name": "proxymanager", "user": "XXXXXX", "password": "XXXXXX", "port": 5432 } } ```
kerem 2026-02-26 06:32:20 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@chriskacerguis commented on GitHub (Apr 25, 2020):

So I tried to use MySQL and it had no issues. I didn't see in the docs that Postgres would not work (but, I might have missed it), so feel free to close this if you don't want to support Postgres

[update]: ok, I found where you said you don't support it.

<!-- gh-comment-id:619438078 --> @chriskacerguis commented on GitHub (Apr 25, 2020): So I tried to use MySQL and it had no issues. I didn't see in the docs that Postgres would not work (but, I might have missed it), so feel free to close this if you don't want to support Postgres [update]: ok, I found where you said you don't support it.
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#329
No description provided.