[GH-ISSUE #221] Example not working - errors connecting to db #195

Closed
opened 2026-02-26 06:31:21 +03:00 by kerem · 4 comments
Owner

Originally created by @dbrosy on GitHub (Oct 30, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/221

Here is my config

{
  "database": {
    "engine": "mysql",
    "host": "db",
    "name": "npm",
    "user": "npm",
    "password": "npm",
    "port": 3306
  }
}
version: "3"
services:
  app:
    image: jc21/nginx-proxy-manager:latest
    container_name: nginx-proxy
    restart: always
    ports:
      - 80:80
      - 81:81
      - 443:443
    volumes:
      - ./config.json:/app/config/production.json
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db
    environment:
    # if you want pretty colors in your docker logs:
    - FORCE_COLOR=1
  db:
    image: mariadb:latest
    container_name: nginx-db
    restart: always
    ports:
      - 3306:3306    
    environment:
      MYSQL_ROOT_PASSWORD: "npm"
      MYSQL_DATABASE: "npm"
      MYSQL_USER: "npm"
      MYSQL_PASSWORD: "npm"
    volumes:
      - ./data/mysql:/var/lib/mysql

from app I can ping db
This is running a Docker version 19.03.4, build 9013bf583a

errors:

nginx-db | Database initialized
nginx-db | MySQL init process in progress...
nginx-db | 2019-10-30 12:25:20 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 106 ...
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Using Linux native AIO
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Uses event mutexes
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Number of pools: 1
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Using SSE2 crc32 instructions
nginx-db | 2019-10-30 12:25:20 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Completed initialization of buffer pool
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Creating shared tablespace for temporary tables
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Waiting for purge to start
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: 10.4.8 started; log sequence number 139827; transaction id 21
nginx-db | 2019-10-30 12:25:20 0 [Note] Plugin 'FEEDBACK' is disabled.
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
nginx-db | 2019-10-30 12:25:20 0 [Warning] 'user' entry 'root@726957271ec6' ignored in --skip-name-resolve mode.
nginx-db | 2019-10-30 12:25:20 0 [Warning] 'user' entry '@726957271ec6' ignored in --skip-name-resolve mode.
nginx-db | 2019-10-30 12:25:20 0 [Warning] 'proxies_priv' entry '@% root@726957271ec6' ignored in --skip-name-resolve mode.
nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Buffer pool(s) load completed at 191030 12:25:20
nginx-db | 2019-10-30 12:25:20 0 [Note] Reading of all Master_info entries succeeded
nginx-db | 2019-10-30 12:25:20 0 [Note] Added new Master_info '' to hash table
nginx-db | 2019-10-30 12:25:20 0 [Note] mysqld: ready for connections.
nginx-db | Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
nginx-proxy | [10/30/2019] [12:25:21 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:22 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:23 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:24 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:25 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:26 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:27 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:28 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:29 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:30 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:31 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:32 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:33 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:34 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:35 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:36 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:37 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:38 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:39 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:40 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:41 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:42 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:43 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-db | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
nginx-proxy | [10/30/2019] [12:25:44 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:45 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:46 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:47 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:48 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:49 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:50 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:51 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:52 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:53 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:54 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:55 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306
nginx-proxy | [10/30/2019] [12:25:56 PM] [Global   ] › ✖  error     connect ECONNREFUSED 172.19.0.2:3306

Is there something wrong with this app?

Originally created by @dbrosy on GitHub (Oct 30, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/221 Here is my config ``` { "database": { "engine": "mysql", "host": "db", "name": "npm", "user": "npm", "password": "npm", "port": 3306 } } ``` ``` version: "3" services: app: image: jc21/nginx-proxy-manager:latest container_name: nginx-proxy restart: always ports: - 80:80 - 81:81 - 443:443 volumes: - ./config.json:/app/config/production.json - ./data:/data - ./letsencrypt:/etc/letsencrypt depends_on: - db environment: # if you want pretty colors in your docker logs: - FORCE_COLOR=1 db: image: mariadb:latest container_name: nginx-db restart: always ports: - 3306:3306 environment: MYSQL_ROOT_PASSWORD: "npm" MYSQL_DATABASE: "npm" MYSQL_USER: "npm" MYSQL_PASSWORD: "npm" volumes: - ./data/mysql:/var/lib/mysql ``` from app I can ping db This is running a Docker version 19.03.4, build 9013bf583a errors: ``` nginx-db | Database initialized nginx-db | MySQL init process in progress... nginx-db | 2019-10-30 12:25:20 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 106 ... nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Using Linux native AIO nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Uses event mutexes nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Number of pools: 1 nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Using SSE2 crc32 instructions nginx-db | 2019-10-30 12:25:20 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Completed initialization of buffer pool nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: 128 out of 128 rollback segments are active. nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Creating shared tablespace for temporary tables nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Waiting for purge to start nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: 10.4.8 started; log sequence number 139827; transaction id 21 nginx-db | 2019-10-30 12:25:20 0 [Note] Plugin 'FEEDBACK' is disabled. nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool nginx-db | 2019-10-30 12:25:20 0 [Warning] 'user' entry 'root@726957271ec6' ignored in --skip-name-resolve mode. nginx-db | 2019-10-30 12:25:20 0 [Warning] 'user' entry '@726957271ec6' ignored in --skip-name-resolve mode. nginx-db | 2019-10-30 12:25:20 0 [Warning] 'proxies_priv' entry '@% root@726957271ec6' ignored in --skip-name-resolve mode. nginx-db | 2019-10-30 12:25:20 0 [Note] InnoDB: Buffer pool(s) load completed at 191030 12:25:20 nginx-db | 2019-10-30 12:25:20 0 [Note] Reading of all Master_info entries succeeded nginx-db | 2019-10-30 12:25:20 0 [Note] Added new Master_info '' to hash table nginx-db | 2019-10-30 12:25:20 0 [Note] mysqld: ready for connections. nginx-db | Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution nginx-proxy | [10/30/2019] [12:25:21 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:22 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:23 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:24 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:25 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:26 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:27 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:28 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:29 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:30 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:31 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:32 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:33 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:34 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:35 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:36 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:37 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:38 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:39 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:40 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:41 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:42 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:43 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-db | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. nginx-proxy | [10/30/2019] [12:25:44 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:45 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:46 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:47 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:48 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:49 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:50 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:51 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:52 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:53 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:54 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:55 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 nginx-proxy | [10/30/2019] [12:25:56 PM] [Global ] › ✖ error connect ECONNREFUSED 172.19.0.2:3306 ``` Is there something wrong with this app?
kerem 2026-02-26 06:31:21 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@dbrosy commented on GitHub (Oct 31, 2019):

apparently I didn't wait long enough. started working after 1 min

<!-- gh-comment-id:548314793 --> @dbrosy commented on GitHub (Oct 31, 2019): apparently I didn't wait long enough. started working after 1 min
Author
Owner

@brusezot commented on GitHub (Jan 17, 2020):

Why ? is there a possibility to resolve this problem ?

<!-- gh-comment-id:575622762 --> @brusezot commented on GitHub (Jan 17, 2020): Why ? is there a possibility to resolve this problem ?
Author
Owner

@jc21 commented on GitHub (Jan 19, 2020):

Depending on the host and a few factors, starting a Maria db for the first time takes longer than restarts. That's why the NPM app loops trying to connect on start.

<!-- gh-comment-id:576053556 --> @jc21 commented on GitHub (Jan 19, 2020): Depending on the host and a few factors, starting a Maria db for the first time takes longer than restarts. That's why the NPM app loops trying to connect on start.
Author
Owner

@uchagani commented on GitHub (Feb 27, 2020):

will you be willing to accept a PR that adds this to the docs? it will save a lot of time for people.

<!-- gh-comment-id:591831485 --> @uchagani commented on GitHub (Feb 27, 2020): will you be willing to accept a PR that adds this to the docs? it will save a lot of time for people.
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#195
No description provided.