ccarney16 / pterodactyl-containers

Pterodactyl Panel within a docker container
230 stars 78 forks source link

SQLSTATE[HY000] [1045] Access denied for user 'ptero'@'172.20.0.5' (using password: YES) #122

Closed g2bb closed 2 years ago

g2bb commented 2 years ago

Not sure what I am doing wrong here but whenever I go to create a user with docker-compose exec panel php artisan p:user:make it returns this:

In Exception.php line 18:

  SQLSTATE[HY000] [1045] Access denied for user 'ptero'@'172.20.0.5' (using password: YES)

In PDOConnection.php line 39:

  SQLSTATE[HY000] [1045] Access denied for user 'ptero'@'172.20.0.5' (using password: YES)

The only changes I have made are in the docker-compose.yml file where I changed the Panel 80 and 443 ports to 8082 and 4439 respectively, and the Dameon 8080 port to 8989 as I already have containers opening to those ports. Outside of that I have made NO configuration changes. Any help would be appreciated

ccarney16 commented 2 years ago

Password is incorrect, both MYSQL_PASSWORD in conf.d/mariadb.env and DB_PASSWORD in conf.d/panel.env need to be the same.

g2bb commented 2 years ago

Sorry to take so long to respond I have been extremely busy since your response. I am looking now at this and it looks like the password is the same in both files. I don't believe I made any changes to them initially. Is that a default password or am I missing a step in the setup where you set that password?

Edit: It might be worth noting 172.20.0.5 (the address that is being rejected) is the Panel container, 172.20.0.2 is my MySQL server. so it looks to me like it's trying to send a MySQL request to the wrong container but you would know much better than me if that is the case.

Edit 2: While poking around for the Exception.php and PD0Connection.php files I was able to find some logs in data/panel/storage/logs that might shed some more light on what is happening: https://paste.ee/p/UCmVE

g2bb commented 2 years ago

Haven you been able to look into this?

ccarney16 commented 2 years ago

the default configuration should work just fine. the mariadb container on first boot uses the password in mariadb.env. After that you need to change the password manually using the mysql command line, so any changes in password needs to be reflected in panel.env. the user account generated has a wildcard host string, so it should accept any connection. So my point still stands its an incorrect password. Is the panel itself working just fine?

g2bb commented 2 years ago

The logon for the panel shows up no problem but I obviously don't have a login to test any past that. I will note though that the panel is only accessible through the HTTP port and NOT the HTTPS port. Doubt that would have any bearing on this issue but thought it might be helpful to include

ccarney16 commented 2 years ago

If you havent done anything worthwhile, my suggestion would be to start over, delete your data directory and bring your project back online. That should solve the problem.

g2bb commented 2 years ago

Probably should have started with that, sorry. I was able to create the account but now I'm getting this on the login page: ERROR CSRF token mismatch. I'm not sure what CSRF is. Now that I've ran the setup a couple times I am totally comfortable blowing it away again if need be.

EDIT: wait that appears to be an issue with Brave browser, not sure what can be down about that IF that's even something that's your issue, it's entirely likely that it's an issue with Pterodactyl vanilla

ccarney16 commented 2 years ago

I'm not too sure with that error, are you running your panel behind a proxy?

g2bb commented 2 years ago

No I am connecting to the serverdirectly via :8082 in the browser. Firefox works just fine. I was able to find this answer pterodactyl/panel/issues/2719 now I just need to figure out how to do this, but I think I can do that. We can close this issue now, thanks for the help!

ghost commented 1 year ago

Maybe this is help I run into the same issue. Now pterodactyl works. The only thing I did different from the docs-guide: I download and tried to get it work within /home/UserName/pterodactyl

I did follow the guide and replaced the directory appropriately or at least i thought so. It did never work in /home/UserName/pterodactyl

I propyl did something wrong with giving permissions but i followed the guide with permissions also