mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #1905] Trying to run NPM and I get this error: error getaddrinfo EAI_AGAIN mariadb #1386
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#1386
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @newbieraf on GitHub (Mar 3, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1905
Hi All
First time posting here and a Linux newbie in general. I am running Docker and portainer on a Vultur cloud instance using Ubuntu. Essentially I am getting the "bad gateway" error when trying to log into NPM admin panel but upon digging in further I can see the error below when getting logs from the NPM container:
error getaddrinfo EAI_AGAIN mariadb
Ive made sure that the NPM container can ping the Maria container and the logs show that Maria DB is infact connecting without issue however I cannot work out what the above error means. Any hints? Below is my docker compose (without passwords)
Version: "3"
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# These ports are in format :
- '8080:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
environment:
DB_MYSQL_HOST: "mariadb"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "npm"
DB_MYSQL_PASSWORD: "XXX"
DB_MYSQL_NAME: "npm"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: 'jc21/mariadb-aria:latest'
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'XXX'
volumes:
- ./data/mysql:/var/lib/mysql
@the1ts commented on GitHub (Mar 4, 2022):
Looks like you've changed the DB_MYSQL_HOST to mariadb, but the service for mariadb is still called db: those need to match up.
@newbieraf commented on GitHub (Mar 4, 2022):
Thank you @the1ts where do I need to change that - I cant see it
@the1ts commented on GitHub (Mar 4, 2022):
You have taken the config from the full system page but changed
DB_MYSQL_HOST: "db"toDB_MYSQL_HOST: "mariadb"in only one place. This change is what broke your config.The
DB_MYSQL_HOSTvalue needs to point to the name of the service given in the mariadb section of the docker compose yaml. So in your config above the service is set to db:so
DB_MYSQL_HOST:"db"will work andDB_MYSQL_HOST:"mariadb"will error as you see.The easiest fix is just revert your change back to
DB_MYSQL_HOST:"db"@newbieraf commented on GitHub (Mar 4, 2022):
Got it thank you, Ive now changed DB_MYSQL_HOST back to "db" and kept everything else as default just for testing. I am now getting Access denied for user 'npm' which I guess is one step further.
For security obviously I need to change the default username and password, however for testing purposes it should still work correct?
@newbieraf commented on GitHub (Mar 5, 2022):
@the1ts any help would be appreciated
@the1ts commented on GitHub (Mar 5, 2022):
Not a huge amount to go on, but I'm guessing you haven't cleared out the DB files in data/mysql this means that the DB is starting with the old credentials. You can battle to change that yourself or do a fresh install.
I believe that the MYSQL_PASSWORD is set at first run only so remove the db files and set the MYSQL_PASSWORD and DB_MYSQL_PASSWORD to the new secure password.
This will get you back to first run and have to setup the username and password again, but it sounds like you have nothing to lose by doing a fresh install.
@newbieraf commented on GitHub (Mar 5, 2022):
Got it, I’ll. blow away the container inc any persistent directories and start again
@newbieraf commented on GitHub (Mar 9, 2022):
@the1ts thank you for your help ive tried the following with the same result (error) but this time let me give a bit more detail.
From the DB container:
[i] pre-init.d - processing /scripts/pre-init.d/01_secret-init.sh
[i] mysqld not found, creating....
[i] MySQL data directory not found, creating initial DBs
[i] Creating database: npm
[i] with character set: 'utf8' and collation: 'utf8_general_ci'
[i] Creating user: npm with password Dio8WBeAfijvJTcz6Cqa
2022-03-09 15:10:11 0 [Note] /usr/bin/mysqld (mysqld 10.4.15-MariaDB) starting as process 52 ...
2022-03-09 15:10:11 0 [Note] Plugin 'InnoDB' is disabled.
2022-03-09 15:10:11 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-03-09 15:10:11 1 [Warning] 'user' entry '@3b2780982056' ignored in --skip-name-resolve mode.
2022-03-09 15:10:11 1 [Warning] 'proxies_priv' entry '@% root@3b2780982056' ignored in --skip-name-resolve mode.
2022-03-09 15:10:11 1 [Warning] 'user' entry '@3b2780982056' ignored in --skip-name-resolve mode.
2022-03-09 15:10:11 1 [Warning] 'proxies_priv' entry '@% root@3b2780982056' ignored in --skip-name-resolve mode.
/scripts/run.sh: ignoring or entrypoint initdb empty /docker-entrypoint-initdb.d/*
MySQL init process done. Ready for start up.
exec /usr/bin/mysqld --user=mysql --console --skip-name-resolve --skip-networking=0
2022-03-09 15:10:11 0 [Note] /usr/bin/mysqld (mysqld 10.4.15-MariaDB) starting as process 1 ...
2022-03-09 15:10:12 0 [Note] Plugin 'InnoDB' is disabled.
2022-03-09 15:10:12 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-03-09 15:10:12 0 [Note] Server socket created on IP: '::'.
2022-03-09 15:10:12 0 [Warning] 'user' entry '@3b2780982056' ignored in --skip-name-resolve mode.
2022-03-09 15:10:12 0 [Warning] 'proxies_priv' entry '@% root@3b2780982056' ignored in --skip-name-resolve mode.
2022-03-09 15:10:12 0 [Note] Reading of all Master_info entries succeeded
2022-03-09 15:10:12 0 [Note] Added new Master_info '' to hash table
2022-03-09 15:10:12 0 [Note] /usr/bin/mysqld: ready for connections.
Version: '10.4.15-MariaDB' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
2022-03-09 15:10:14 3 [Warning] Access denied for user 'npm'@'172.18.0.3' (using password: YES)
2022-03-09 15:10:15 4 [Warning] Access denied for user 'npm'@'172.18.0.3' (using password: YES)
2022-03-09 15:10:16 5 [Warning] Access denied for user 'npm'@'172.18.0.3' (using password: YES)
From the App container:
[3/9/2022] [3:16:25 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'172.18.0.3' (using password: YES)
[3/9/2022] [3:16:26 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'172.18.0.3' (using password: YES)
[3/9/2022] [3:16:27 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'172.18.0.3' (using password: YES)
I am using portainer just in case that makes a difference.
Thanks
@Rodrigolmti commented on GitHub (May 9, 2022):
Having the same problem, I can connect to my mariadb using adminer and dbeaver using outside connection. But with npm I can't connect
Always receiving:
› ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'172.18.0.3' (using password: YES)
Already try to change the network to host and does not work.
@graves501 commented on GitHub (Aug 10, 2022):
I had a very similar log in both
jc21/nginx-proxy-managerandjc21/mariadb-ariaafter rebooting my server. In my case the issue was fixed to update the docker images to the latest build:docker-compose -f nginxproxymanager.yml up --force-recreate --build -d@github-actions[bot] commented on GitHub (Feb 22, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@github-actions[bot] commented on GitHub (Apr 7, 2025):
Issue was closed due to inactivity.