[GH-ISSUE #577] Access Denied Error #485

Closed
opened 2026-02-26 06:33:03 +03:00 by kerem · 13 comments
Owner

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

I have been trying for days to get this working. I had started using Docker on my WIndows10 Server with no luck.

I've now moved onto a RPi3 also with no luck.

I've installed Docker on the RPi, I've created a docker-compose and config file. I've run the docker-compose up -d command.


This is the log from the app container:

Cron is enabled, launching it!,
Starting cron daemon now...,

writing mariadb config,
gomplate version 3.1.0, build 2f357bd5 (2018-11-30T02:51:36Z),
config is:,
input: /etc/templates/my.cnf.tmpl,
output: /etc/mysql/my.cnf,
,
rendered 1 template(s) with 0 error(s) in 4.535557ms,
chown data directory,
running mysql_install_db...,
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...,
2020-08-24 23:42:20 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory"),
OK,
,
To start mysqld at boot time you have to copy,
support-files/mysql.server to the right place for your system,
,
,
Two all-privilege accounts were created.,
One is root@localhost, it has no password, but you need to,
be system 'root' user to connect. Use, for example, sudo mysql,
The second is mysql@localhost, it has no password either, but,
you need to be the system 'mysql' user to connect.,
After connecting you can set the password, if you would need to be,
able to connect as any of these users with a password and without sudo,
,
See the MariaDB Knowledgebase at http://mariadb.com/kb or the,
MySQL manual for more instructions.,
,
You can start the MariaDB daemon with:,
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql',
,
You can test the MariaDB daemon with mysql-test-run.pl,
cd '/usr/mysql-test' ; perl mysql-test-run.pl,
,
Please report any problems at http://mariadb.org/jira,
,
The latest information about MariaDB is available at http://mariadb.org/.,
You can find additional information about the MySQL part at:,
http://dev.mysql.com,
Consider joining MariaDB's strong and vibrant community:,
https://mariadb.org/get-involved/,
,
finished mysql_install_db,
starting mariadb service,
200824 23:42:24 mysqld_safe Logging to '/var/lib/mysql/db9f8d613d39.err'.,
200824 23:42:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql,


This is the log from the DB

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] done.,
[services.d] starting services,
[services.d] done.,
Generating dummy SSL certificate...,
Generating a RSA private key,
...............+++++,
................+++++,
writing new private key to '/data/nginx/dummykey.pem',
-----,
Complete,
❯ Enabling IPV6 in hosts: /etc/nginx/conf.d,
❯ /etc/nginx/conf.d/include/block-exploits.conf,
❯ /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf,
❯ /etc/nginx/conf.d/include/assets.conf,
❯ /etc/nginx/conf.d/include/ip_ranges.conf,
❯ /etc/nginx/conf.d/include/proxy.conf,
❯ /etc/nginx/conf.d/include/force-ssl.conf,
❯ /etc/nginx/conf.d/include/ssl-ciphers.conf,
❯ /etc/nginx/conf.d/include/resolvers.conf,
❯ /etc/nginx/conf.d/production.conf,
❯ /etc/nginx/conf.d/default.conf,
❯ Enabling IPV6 in hosts: /data/nginx,
[8/24/2020] [11:42:28 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),
[8/24/2020] [11:42:29 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),
[8/24/2020] [11:42:30 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),
[8/24/2020] [11:42:31 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),
[8/24/2020] [11:42:32 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),
[8/24/2020] [11:42:33 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),
[8/24/2020] [11:42:34 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES),


My docker-compose file: You'll notice that I've changed the db image and the MARIADB from MYSQL in the bottom part of the file. I had the same problem being unable to get this working even with the original db and MYSQL language. This change was based on reading about what others have tried.

version: "3"
services:
app:
image: jc21/nginx-proxy-manager:2
restart: always
ports:
# Public HTTP Port:
- '80:80'
# Public HTTPS Port:
- '443:443'
# Admin Web Port:
- '81:81'
environment:
- TZ:America/New_York
volumes:
# Make sure this config.json file exists as per instructions above:
- ./config.json:/app/config/production.json
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: webhippie/mariadb:latest
restart: always
environment:
MARIADB_ROOT_PASSWORD: 'npm'
MARIADB_DATABASE: 'npm'
MARIADB_USER: 'npm'
MARIADB_PASSWORD: 'npm'
volumes:
- ./data/mysql:/var/lib/mysql


My config.json file

{
"database": {
"engine": "mysql",
"host": "db",
"name": "npm",
"user": "npm",
"password": "npm",
"port": 3306
}
}

Any suggestions?

Originally created by @adamgreenberg07 on GitHub (Aug 25, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/577 I have been trying for days to get this working. I had started using Docker on my WIndows10 Server with no luck. I've now moved onto a RPi3 also with no luck. I've installed Docker on the RPi, I've created a docker-compose and config file. I've run the docker-compose up -d command. ----------------------- **This is the log from the app container:** Cron is enabled, launching it!, Starting cron daemon now..., > writing mariadb config, gomplate version 3.1.0, build 2f357bd5 (2018-11-30T02:51:36Z), config is:, input: /etc/templates/my.cnf.tmpl, output: /etc/mysql/my.cnf, , rendered 1 template(s) with 0 error(s) in 4.535557ms, > chown data directory, > running mysql_install_db..., Installing MariaDB/MySQL system tables in '/var/lib/mysql' ..., 2020-08-24 23:42:20 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory"), OK, , To start mysqld at boot time you have to copy, support-files/mysql.server to the right place for your system, , , Two all-privilege accounts were created., One is root@localhost, it has no password, but you need to, be system 'root' user to connect. Use, for example, sudo mysql, The second is mysql@localhost, it has no password either, but, you need to be the system 'mysql' user to connect., After connecting you can set the password, if you would need to be, able to connect as any of these users with a password and without sudo, , See the MariaDB Knowledgebase at http://mariadb.com/kb or the, MySQL manual for more instructions., , You can start the MariaDB daemon with:, cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql', , You can test the MariaDB daemon with mysql-test-run.pl, cd '/usr/mysql-test' ; perl mysql-test-run.pl, , Please report any problems at http://mariadb.org/jira, , The latest information about MariaDB is available at http://mariadb.org/., You can find additional information about the MySQL part at:, http://dev.mysql.com, Consider joining MariaDB's strong and vibrant community:, https://mariadb.org/get-involved/, , > finished mysql_install_db, starting mariadb service, 200824 23:42:24 mysqld_safe Logging to '/var/lib/mysql/db9f8d613d39.err'., 200824 23:42:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql, --------------------- **This is the log from the DB** [s6-init] making user provided files available at /var/run/s6/etc...exited 0., [s6-init] ensuring user provided files have correct perms...exited 0., [fix-attrs.d] applying ownership & permissions fixes..., [fix-attrs.d] done., [cont-init.d] executing container initialization scripts..., [cont-init.d] done., [services.d] starting services, [services.d] done., Generating dummy SSL certificate..., Generating a RSA private key, ...............+++++, ................+++++, writing new private key to '/data/nginx/dummykey.pem', -----, Complete, ❯ Enabling IPV6 in hosts: /etc/nginx/conf.d, ❯ /etc/nginx/conf.d/include/block-exploits.conf, ❯ /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf, ❯ /etc/nginx/conf.d/include/assets.conf, ❯ /etc/nginx/conf.d/include/ip_ranges.conf, ❯ /etc/nginx/conf.d/include/proxy.conf, ❯ /etc/nginx/conf.d/include/force-ssl.conf, ❯ /etc/nginx/conf.d/include/ssl-ciphers.conf, ❯ /etc/nginx/conf.d/include/resolvers.conf, ❯ /etc/nginx/conf.d/production.conf, ❯ /etc/nginx/conf.d/default.conf, ❯ Enabling IPV6 in hosts: /data/nginx, [8/24/2020] [11:42:28 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), [8/24/2020] [11:42:29 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), [8/24/2020] [11:42:30 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), [8/24/2020] [11:42:31 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), [8/24/2020] [11:42:32 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), [8/24/2020] [11:42:33 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), [8/24/2020] [11:42:34 PM] [Global ] › ✖ error ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'pi_app_1.pi_default' (using password: YES), ------------------------------ **My docker-compose file: You'll notice that I've changed the db image and the MARIADB from MYSQL in the bottom part of the file. I had the same problem being unable to get this working even with the original db and MYSQL language. This change was based on reading about what others have tried.** version: "3" services: app: image: jc21/nginx-proxy-manager:2 restart: always ports: # Public HTTP Port: - '80:80' # Public HTTPS Port: - '443:443' # Admin Web Port: - '81:81' environment: - TZ:America/New_York volumes: # Make sure this config.json file exists as per instructions above: - ./config.json:/app/config/production.json - ./data:/data - ./letsencrypt:/etc/letsencrypt depends_on: - db db: image: webhippie/mariadb:latest restart: always environment: MARIADB_ROOT_PASSWORD: 'npm' MARIADB_DATABASE: 'npm' MARIADB_USER: 'npm' MARIADB_PASSWORD: 'npm' volumes: - ./data/mysql:/var/lib/mysql ------------------------ **My config.json file** { "database": { "engine": "mysql", "host": "db", "name": "npm", "user": "npm", "password": "npm", "port": 3306 } } Any suggestions?
kerem 2026-02-26 06:33:03 +03:00
Author
Owner

@appinteractive commented on GitHub (Aug 29, 2020):

SAME ISSUE HERE! @adamgreenberg07 could you fix it already?

<!-- gh-comment-id:683285957 --> @appinteractive commented on GitHub (Aug 29, 2020): SAME ISSUE HERE! @adamgreenberg07 could you fix it already?
Author
Owner

@adamgreenberg07 commented on GitHub (Aug 29, 2020):

No luck. I'm using an nginx proxy manager docker from jlesage right now. Based on the same nginx proxy manager

<!-- gh-comment-id:683286214 --> @adamgreenberg07 commented on GitHub (Aug 29, 2020): No luck. I'm using an nginx proxy manager docker from jlesage right now. Based on the same nginx proxy manager
Author
Owner

@appinteractive commented on GitHub (Aug 29, 2020):

@adamgreenberg07 seems like you cant change the db passwort without explosion. So we need to create the given user on our own before starting the server... could be fixed with a startup script in the db image which would create the user if not present

<!-- gh-comment-id:683287020 --> @appinteractive commented on GitHub (Aug 29, 2020): @adamgreenberg07 seems like you cant change the db passwort without explosion. So we need to create the given user on our own before starting the server... could be fixed with a startup script in the db image which would create the user if not present
Author
Owner

@montagsmodell commented on GitHub (Sep 13, 2020):

did you find any solution? I am having the same trouble and up until now could not get it to work.

<!-- gh-comment-id:691671978 --> @montagsmodell commented on GitHub (Sep 13, 2020): did you find any solution? I am having the same trouble and up until now could not get it to work.
Author
Owner

@montagsmodell commented on GitHub (Sep 13, 2020):

It finally worked for me after using the standard login credentials:

  MYSQL_ROOT_PASSWORD: ROOTPASSWORD
  MYSQL_DATABASE: DBNAME
  MYSQL_USER: DBUSERNAME
  MYSQL_PASSWORD: DBPASSWORD
<!-- gh-comment-id:691682717 --> @montagsmodell commented on GitHub (Sep 13, 2020): It finally worked for me after using the standard login credentials: MYSQL_ROOT_PASSWORD: ROOTPASSWORD MYSQL_DATABASE: DBNAME MYSQL_USER: DBUSERNAME MYSQL_PASSWORD: DBPASSWORD
Author
Owner

@nygage commented on GitHub (Jan 27, 2021):

Same issue here

<!-- gh-comment-id:768486788 --> @nygage commented on GitHub (Jan 27, 2021): Same issue here
Author
Owner

@appinteractive commented on GitHub (Feb 8, 2021):

It finally worked for me after using the standard login credentials:

  MYSQL_ROOT_PASSWORD: ROOTPASSWORD

  MYSQL_DATABASE: DBNAME

  MYSQL_USER: DBUSERNAME

  MYSQL_PASSWORD: DBPASSWORD

Security hole or back door 🚪 as a feature? The same what Mongo db does for years, not only in their docker images. Sometimes I get the impression that projects get payed for leaving the doors wide open.

<!-- gh-comment-id:775351839 --> @appinteractive commented on GitHub (Feb 8, 2021): > It finally worked for me after using the standard login credentials: > > > > MYSQL_ROOT_PASSWORD: ROOTPASSWORD > > MYSQL_DATABASE: DBNAME > > MYSQL_USER: DBUSERNAME > > MYSQL_PASSWORD: DBPASSWORD Security hole or back door 🚪 as a feature? The same what Mongo db does for years, not only in their docker images. Sometimes I get the impression that projects get payed for leaving the doors wide open.
Author
Owner

@chaptergy commented on GitHub (May 12, 2021):

This issue seems to be a mix of lots of different things. For setup on a raspberry pi please see https://github.com/jc21/nginx-proxy-manager/issues/212. If you changed the database credentials take a look at https://github.com/jc21/nginx-proxy-manager/issues/603. On other systems if you have an issue with the database, you could try a different database image.

<!-- gh-comment-id:839961719 --> @chaptergy commented on GitHub (May 12, 2021): This issue seems to be a mix of lots of different things. For setup on a raspberry pi please see https://github.com/jc21/nginx-proxy-manager/issues/212. If you changed the database credentials take a look at https://github.com/jc21/nginx-proxy-manager/issues/603. On other systems if you have an issue with the database, you could try a different database image.
Author
Owner

@nexusguy59 commented on GitHub (Nov 18, 2021):

Same here and I have done everything that has been suggested here and other places and I am still getting the same thing everytime.

image

very frustrating.....

<!-- gh-comment-id:973140906 --> @nexusguy59 commented on GitHub (Nov 18, 2021): Same here and I have done everything that has been suggested here and other places and I am still getting the same thing everytime. ![image](https://user-images.githubusercontent.com/4959383/142474697-dd8aa36f-f3ef-495b-801c-78955e97088e.png) very frustrating.....
Author
Owner

@montagsmodell commented on GitHub (Nov 18, 2021):

@nexusguy59 what does the log say?

<!-- gh-comment-id:973171146 --> @montagsmodell commented on GitHub (Nov 18, 2021): @nexusguy59 what does the log say?
Author
Owner

@MickMorley commented on GitHub (Mar 31, 2022):

I hope this helps someone. I was getting the same error when trying to set up my Nginx Proxy Manager using docker. My MariaDB was in a separate docker (on Unraid).

The problem was, I had an "@" in my DB_MYSQL_PASSWORD variable. I changed my password to a simple string --> "password" on my database for a test. I updated the docker variable and restarted. All worked.

<!-- gh-comment-id:1083982599 --> @MickMorley commented on GitHub (Mar 31, 2022): I hope this helps someone. I was getting the same error when trying to set up my Nginx Proxy Manager using docker. My MariaDB was in a separate docker (on Unraid). The problem was, I had an "@" in my DB_MYSQL_PASSWORD variable. I changed my password to a simple string --> "password" on my database for a test. I updated the docker variable and restarted. All worked.
Author
Owner

@cdiegosr commented on GitHub (Feb 16, 2023):

Hi!

Today I had the same problem of Bad Gateway after one update. I read and did all the indications here, my fix was:

  • Start a new container with PHPMyAdmin, on the same network
  • remove the user from the database
  • change this user's password
  • add the user back to the DB
  • update the docker-compose with the new password
  • rebuild NPM

Voilà

<!-- gh-comment-id:1433887428 --> @cdiegosr commented on GitHub (Feb 16, 2023): Hi! Today I had the same problem of Bad Gateway after one update. I read and did all the indications here, my fix was: - Start a new container with PHPMyAdmin, on the same network - remove the user from the database - change this user's password - add the user back to the DB - update the docker-compose with the new password - rebuild NPM Voilà
Author
Owner

@Optimus1008 commented on GitHub (May 25, 2024):

I hope this helps someone. I was getting the same error when trying to set up my Nginx Proxy Manager using docker. My MariaDB was in a separate docker (on Unraid).

The problem was, I had an "@" in my DB_MYSQL_PASSWORD variable. I changed my password to a simple string --> "password" on my database for a test. I updated the docker variable and restarted. All worked.

Same but with a "$"! Thank you so much for leading me to the right direction!

<!-- gh-comment-id:2131113466 --> @Optimus1008 commented on GitHub (May 25, 2024): > I hope this helps someone. I was getting the same error when trying to set up my Nginx Proxy Manager using docker. My MariaDB was in a separate docker (on Unraid). > > The problem was, I had an "@" in my DB_MYSQL_PASSWORD variable. I changed my password to a simple string --> "password" on my database for a test. I updated the docker variable and restarted. All worked. Same but with a "$"! Thank you so much for leading me to the right direction!
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#485
No description provided.