[GH-ISSUE #502] migration failed with error: show fields from proxy_host where field = 'forward_ip' #429

Closed
opened 2026-02-26 06:32:49 +03:00 by kerem · 3 comments
Owner

Originally created by @ThomLS on GitHub (Jul 12, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/502

I'm receving the following error while doing the normal set-up of NGINX proxy manager.

migration failed with error: show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

[7/12/2020] [3:34:14 PM] [Global ] › ✖ error show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

[7/12/2020] [3:34:15 PM] [Migrate ] › ℹ info Current database version: 20180929054513

[7/12/2020] [3:34:15 PM] [Migrate ] › ℹ info [forward_host] Migrating Up...

migration file "20181019052346_forward_host.js" failed

migration failed with error: show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

[7/12/2020] [3:34:15 PM] [Global ] › ✖ error show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

[7/12/2020] [3:34:16 PM] [Migrate ] › ℹ info Current database version: 20180929054513

[7/12/2020] [3:34:16 PM] [Migrate ] › ℹ info [forward_host] Migrating Up...

migration file "20181019052346_forward_host.js" failed

migration failed with error: show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

[7/12/2020] [3:34:16 PM] [Global ] › ✖ error show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

[7/12/2020] [3:34:17 PM] [Migrate ] › ℹ info Current database version: 20180929054513

[7/12/2020] [3:34:17 PM] [Migrate ] › ℹ info [forward_host] Migrating Up...

migration file "20181019052346_forward_host.js" failed

migration failed with error: show fields from proxy_host where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

Originally created by @ThomLS on GitHub (Jul 12, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/502 I'm receving the following error while doing the normal set-up of NGINX proxy manager. migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only [7/12/2020] [3:34:14 PM] [Global ] › ✖ error show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only [7/12/2020] [3:34:15 PM] [Migrate ] › ℹ info Current database version: 20180929054513 [7/12/2020] [3:34:15 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... migration file "20181019052346_forward_host.js" failed migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only [7/12/2020] [3:34:15 PM] [Global ] › ✖ error show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only [7/12/2020] [3:34:16 PM] [Migrate ] › ℹ info Current database version: 20180929054513 [7/12/2020] [3:34:16 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... migration file "20181019052346_forward_host.js" failed migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only [7/12/2020] [3:34:16 PM] [Global ] › ✖ error show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only [7/12/2020] [3:34:17 PM] [Migrate ] › ℹ info Current database version: 20180929054513 [7/12/2020] [3:34:17 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... migration file "20181019052346_forward_host.js" failed migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only
kerem 2026-02-26 06:32:49 +03:00
Author
Owner

@jaaacck commented on GitHub (Aug 27, 2020):

I am also getting the same issue with a brand new build today:

app_1  | [8/27/2020] [1:58:46 PM] [Migrate  ] › ℹ  info      Current database version: 20180929054513
app_1  | [8/27/2020] [1:58:46 PM] [Migrate  ] › ℹ  info      [forward_host] Migrating Up...
app_1  | migration file "20181019052346_forward_host.js" failed
app_1  | migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only
app_1  | [8/27/2020] [1:58:46 PM] [Global   ] › ✖  error     show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only
app_1  | [8/27/2020] [1:58:47 PM] [Migrate  ] › ℹ  info      Current database version: 20180929054513
app_1  | [8/27/2020] [1:58:47 PM] [Migrate  ] › ℹ  info      [forward_host] Migrating Up...
app_1  | migration file "20181019052346_forward_host.js" failed
app_1  | migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only
app_1  | [8/27/2020] [1:58:47 PM] [Global   ] › ✖  error     show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only
app_1  | [8/27/2020] [1:58:48 PM] [Migrate  ] › ℹ  info      Current database version: 20180929054513
app_1  | [8/27/2020] [1:58:48 PM] [Migrate  ] › ℹ  info      [forward_host] Migrating Up...
app_1  | migration file "20181019052346_forward_host.js" failed
app_1  | migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only
app_1  | [8/27/2020] [1:58:48 PM] [Global   ] › ✖  error     show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only

Any suggestions?

<!-- gh-comment-id:681970476 --> @jaaacck commented on GitHub (Aug 27, 2020): I am also getting the same issue with a brand new build today: ``` app_1 | [8/27/2020] [1:58:46 PM] [Migrate ] › ℹ info Current database version: 20180929054513 app_1 | [8/27/2020] [1:58:46 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... app_1 | migration file "20181019052346_forward_host.js" failed app_1 | migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only app_1 | [8/27/2020] [1:58:46 PM] [Global ] › ✖ error show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only app_1 | [8/27/2020] [1:58:47 PM] [Migrate ] › ℹ info Current database version: 20180929054513 app_1 | [8/27/2020] [1:58:47 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... app_1 | migration file "20181019052346_forward_host.js" failed app_1 | migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only app_1 | [8/27/2020] [1:58:47 PM] [Global ] › ✖ error show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only app_1 | [8/27/2020] [1:58:48 PM] [Migrate ] › ℹ info Current database version: 20180929054513 app_1 | [8/27/2020] [1:58:48 PM] [Migrate ] › ℹ info [forward_host] Migrating Up... app_1 | migration file "20181019052346_forward_host.js" failed app_1 | migration failed with error: show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only app_1 | [8/27/2020] [1:58:48 PM] [Global ] › ✖ error show fields from `proxy_host` where field = 'forward_ip' - ER_OPEN_AS_READONLY: Table '/var/tmp/#sql_1_0.MAI' is read only ``` Any suggestions?
Author
Owner

@jc21 commented on GitHub (Aug 27, 2020):

This is a mysql database issue. The MySQL database files have somehow changed permissions so that MySQL daemon is unable to open the file. Check the data permissions, if using a mysql/mariadb docker image for the database, the files need to be a specific user as well.

<!-- gh-comment-id:682214544 --> @jc21 commented on GitHub (Aug 27, 2020): This is a mysql database issue. The MySQL database files have somehow changed permissions so that MySQL daemon is unable to open the file. Check the data permissions, if using a mysql/mariadb docker image for the database, the files need to be a specific user as well.
Author
Owner

@jaaacck commented on GitHub (Aug 28, 2020):

This is a mysql database issue. The MySQL database files have somehow changed permissions so that MySQL daemon is unable to open the file. Check the data permissions, if using a mysql/mariadb docker image for the database, the files need to be a specific user as well.

Permissions were fine. Owned by MySQL:

[root@rcn-ops-hg1-dev nginxproxymanager]# docker exec -it nginxproxymanager_db_1 ls -la /var/lib/mysql
total 122924
drwxr-xr-x    5 mysql    mysql          243 Aug 27 14:11 .
drwxr-xr-x    1 root     root            19 Mar 10 08:20 ..
-rw-rw----    1 mysql    mysql            2 Aug 27 14:11 718a022dde16.pid
-rw-rw----    1 mysql    mysql        24576 Aug 27 14:11 aria_log.00000001
-rw-rw----    1 mysql    mysql           52 Aug 27 14:11 aria_log_control
-rw-r-----    1 mysql    mysql         1940 Aug 27 14:11 ib_buffer_pool
-rw-rw----    1 mysql    mysql     50331648 Aug 27 14:11 ib_logfile0
-rw-rw----    1 mysql    mysql     50331648 Aug 27 13:54 ib_logfile1
-rw-rw----    1 mysql    mysql     12582912 Aug 27 14:11 ibdata1
-rw-rw----    1 mysql    mysql     12582912 Aug 27 14:11 ibtmp1
-rw-rw----    1 mysql    mysql            0 Aug 27 13:54 multi-master.info
drwx------    2 mysql    mysql         4096 Aug 27 13:54 mysql
drwx------    2 mysql    mysql         4096 Aug 27 13:54 npm
drwx------    2 mysql    mysql           20 Aug 27 13:54 performance_schema

Ended up moving to MySQL and container started and connected without any issues. I could replicate this on multiple nodes within our environment.

Here was my docker-compose.yml:

[root@rcn-ops-hg1-dev nginxproxymanager]# cat docker-compose.yml 
version: '2'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '6080:80'
      - '6081:81'
      - '6443:443'
    volumes:
      - /opt/proxymanager/config.json:/app/config/production.json
      - /opt/proxymanager/data:/data
      - /opy/proxymanager/letsencrypt:/etc/letsencrypt
    depends_on:
      - db
    environment:
      DISABLE_IPV6: 'true'

  db:
    image: 'jc21/mariadb-aria:10.4'
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - /opt/proxymanager/data/mysql:/var/lib/mysql

Apart form the MariaDB hiccup the tool is working perfectly without a hitch

<!-- gh-comment-id:682440586 --> @jaaacck commented on GitHub (Aug 28, 2020): > This is a mysql database issue. The MySQL database files have somehow changed permissions so that MySQL daemon is unable to open the file. Check the data permissions, if using a mysql/mariadb docker image for the database, the files need to be a specific user as well. Permissions were fine. Owned by MySQL: ``` [root@rcn-ops-hg1-dev nginxproxymanager]# docker exec -it nginxproxymanager_db_1 ls -la /var/lib/mysql total 122924 drwxr-xr-x 5 mysql mysql 243 Aug 27 14:11 . drwxr-xr-x 1 root root 19 Mar 10 08:20 .. -rw-rw---- 1 mysql mysql 2 Aug 27 14:11 718a022dde16.pid -rw-rw---- 1 mysql mysql 24576 Aug 27 14:11 aria_log.00000001 -rw-rw---- 1 mysql mysql 52 Aug 27 14:11 aria_log_control -rw-r----- 1 mysql mysql 1940 Aug 27 14:11 ib_buffer_pool -rw-rw---- 1 mysql mysql 50331648 Aug 27 14:11 ib_logfile0 -rw-rw---- 1 mysql mysql 50331648 Aug 27 13:54 ib_logfile1 -rw-rw---- 1 mysql mysql 12582912 Aug 27 14:11 ibdata1 -rw-rw---- 1 mysql mysql 12582912 Aug 27 14:11 ibtmp1 -rw-rw---- 1 mysql mysql 0 Aug 27 13:54 multi-master.info drwx------ 2 mysql mysql 4096 Aug 27 13:54 mysql drwx------ 2 mysql mysql 4096 Aug 27 13:54 npm drwx------ 2 mysql mysql 20 Aug 27 13:54 performance_schema ``` Ended up moving to MySQL and container started and connected without any issues. I could replicate this on multiple nodes within our environment. Here was my docker-compose.yml: ```yaml [root@rcn-ops-hg1-dev nginxproxymanager]# cat docker-compose.yml version: '2' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: always ports: - '6080:80' - '6081:81' - '6443:443' volumes: - /opt/proxymanager/config.json:/app/config/production.json - /opt/proxymanager/data:/data - /opy/proxymanager/letsencrypt:/etc/letsencrypt depends_on: - db environment: DISABLE_IPV6: 'true' db: image: 'jc21/mariadb-aria:10.4' restart: always environment: MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - /opt/proxymanager/data/mysql:/var/lib/mysql ``` Apart form the MariaDB hiccup the tool is working perfectly without a hitch
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#429
No description provided.