passwordcockpit / passwordcockpit

Passwordcockpit is a simple, free, open source, self hosted, web based password manager for teams. It is made in PHP, Javascript, MySQL and it run on a docker service. It allows users with any kind of device to safely store, share and retrieve passwords, certificates, files and much more.
https://passwordcockpit.com
BSD 3-Clause "New" or "Revised" License
112 stars 18 forks source link

error in startup #92

Closed SSintermann closed 6 months ago

SSintermann commented 6 months ago

Hi there,

I am trying to get started and basically am using the default compose script with SSL disabled.

Log gives me funny stuff that I think has to do with not being able to access the DB. Maybe someone has a clue? `Retrying connection... PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'passwordcockpit_db_usr'@'192.168.64.3' (using password: YES) in /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:28  Stack trace:

0 /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php(28): PDO->__construct()

1 /var/www/html/vendor/doctrine/dbal/src/Connection.php(342): Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect()

2 /var/www/html/vendor/doctrine/dbal/src/Connection.php(406): Doctrine\DBAL\Connection->connect()

3 /var/www/html/vendor/doctrine/dbal/src/Connection.php(368): Doctrine\DBAL\Connection->getDatabasePlatformVersion()

4 /var/www/html/vendor/doctrine/dbal/src/Connection.php(285): Doctrine\DBAL\Connection->detectDatabasePlatform()

5 /var/www/html/vendor/roave/psr-container-doctrine/src/ConnectionFactory.php(55): Doctrine\DBAL\Connection->getDatabasePlatform()

6 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(29): Roave\PsrContainerDoctrine\ConnectionFactory->createWithConfig()

7 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(111): Roave\PsrContainerDoctrine\AbstractFactory->__invoke()

8 /var/www/html/vendor/roave/psr-container-doctrine/src/EntityManagerFactory.php(27): Roave\PsrContainerDoctrine\AbstractFactory->retrieveDependency()

9 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(29): Roave\PsrContainerDoctrine\EntityManagerFactory->createWithConfig()

10 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(613): Roave\PsrContainerDoctrine\AbstractFactory->__invoke()

11 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()

12 /var/www/html/config/cli-config.php(8): Laminas\ServiceManager\ServiceManager->get()

13 /var/www/html/vendor/doctrine/orm/bin/doctrine.php(41): require('...')

14 /var/www/html/vendor/doctrine/orm/bin/doctrine(4): include('...')

15 /var/www/html/vendor/bin/doctrine(119): include('...')

16 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000] [1045] Access denied for user 'passwordcockpit_db_usr'@'192.168.64.3' (using password: YES) in /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:30  Stack trace:

0 /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php(34): Doctrine\DBAL\Driver\PDO\Exception::new()

1 /var/www/html/vendor/doctrine/dbal/src/Connection.php(342): Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect()

2 /var/www/html/vendor/doctrine/dbal/src/Connection.php(406): Doctrine\DBAL\Connection->connect()

3 /var/www/html/vendor/doctrine/dbal/src/Connection.php(368): Doctrine\DBAL\Connection->getDatabasePlatformVersion()

4 /var/www/html/vendor/doctrine/dbal/src/Connection.php(285): Doctrine\DBAL\Connection->detectDatabasePlatform()

5 /var/www/html/vendor/roave/psr-container-doctrine/src/ConnectionFactory.php(55): Doctrine\DBAL\Connection->getDatabasePlatform()

6 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(29): Roave\PsrContainerDoctrine\ConnectionFactory->createWithConfig()

7 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(111): Roave\PsrContainerDoctrine\AbstractFactory->__invoke()

8 /var/www/html/vendor/roave/psr-container-doctrine/src/EntityManagerFactory.php(27): Roave\PsrContainerDoctrine\AbstractFactory->retrieveDependency()

9 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(29): Roave\PsrContainerDoctrine\EntityManagerFactory->createWithConfig()

10 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(613): Roave\PsrContainerDoctrine\AbstractFactory->__invoke()

11 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()

12 /var/www/html/config/cli-config.php(8): Laminas\ServiceManager\ServiceManager->get()

13 /var/www/html/vendor/doctrine/orm/bin/doctrine.php(41): require('...')

14 /var/www/html/vendor/doctrine/orm/bin/doctrine(4): include('...')

15 /var/www/html/vendor/bin/doctrine(119): include('...')

16 {main}

Next Doctrine\DBAL\Exception\ConnectionException: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'passwordcockpit_db_usr'@'192.168.64.3' (using password: YES) in /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:103  Stack trace:

0 /var/www/html/vendor/doctrine/dbal/src/Connection.php(1815): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()

1 /var/www/html/vendor/doctrine/dbal/src/Connection.php(1758): Doctrine\DBAL\Connection->handleDriverException()

2 /var/www/html/vendor/doctrine/dbal/src/Connection.php(344): Doctrine\DBAL\Connection->convertException()

3 /var/www/html/vendor/doctrine/dbal/src/Connection.php(406): Doctrine\DBAL\Connection->connect()

4 /var/www/html/vendor/doctrine/dbal/src/Connection.php(368): Doctrine\DBAL\Connection->getDatabasePlatformVersion()

5 /var/www/html/vendor/doctrine/dbal/src/Connection.php(285): Doctrine\DBAL\Connection->detectDatabasePlatform()

6 /var/www/html/vendor/roave/psr-container-doctrine/src/ConnectionFactory.php(55): Doctrine\DBAL\Connection->getDatabasePlatform()

7 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(29): Roave\PsrContainerDoctrine\ConnectionFactory->createWithConfig()

8 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(111): Roave\PsrContainerDoctrine\AbstractFactory->__invoke()

9 /var/www/html/vendor/roave/psr-container-doctrine/src/EntityManagerFactory.php(27): Roave\PsrContainerDoctrine\AbstractFactory->retrieveDependency()

10 /var/www/html/vendor/roave/psr-container-doctrine/src/AbstractFactory.php(29): Roave\PsrContainerDoctrine\EntityManagerFactory->createWithConfig()

11 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(613): Roave\PsrContainerDoctrine\AbstractFactory->__invoke()

12 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()

13 /var/www/html/config/cli-config.php(8): Laminas\ServiceManager\ServiceManager->get()

14 /var/www/html/vendor/doctrine/orm/bin/doctrine.php(41): require('...')

15 /var/www/html/vendor/doctrine/orm/bin/doctrine(4): include('...')

16 /var/www/html/vendor/bin/doctrine(119): include('...')

17 {main}

Next Laminas\ServiceManager\Exception\ServiceNotCreatedException: Service with name "Doctrine\ORM\EntityManagerInterface" could not be created. Reason: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'passwordcockpit_db_usr'@'192.168.64.3' (using password: YES) in /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php:620  Stack trace:

0 /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\ServiceManager\ServiceManager->doCreate()

1 /var/www/html/config/cli-config.php(8): Laminas\ServiceManager\ServiceManager->get()

2 /var/www/html/vendor/doctrine/orm/bin/doctrine.php(41): require('...')

3 /var/www/html/vendor/doctrine/orm/bin/doctrine(4): include('...')

4 /var/www/html/vendor/bin/doctrine(119): include('...')

 } thrown in /var/www/html/vendor/laminas/laminas-servicemanager/src/ServiceManager.php on line 620 Retrying connection...`

I left the passwords in the compose file on default setting for the first test and later change them when I have everything figured out.

Thanks a lot! Steven

SSintermann commented 6 months ago

I found that the DB has 192.168.64.2 while the pwcockpit container has ...3

Why would the container try to access the DB on the wrong IP? And where can I change that?

SSintermann commented 6 months ago

Ok, apparently MariaDB is denying access to that user from that IP - fair.

But why ;-)

SSintermann commented 6 months ago

OK, followed the advices https://wolfgang.gassler.org/reset-password-mariadb-mysql-docker/ https://gist.github.com/rordi/ab55c92848fd06884172ed22ae88d7df

to reset the password in MariaDB for the cockpitDBuser - apparently I messed something up in the beginning.

bu3tt1 commented 6 months ago

Is the problem solved? In all cases when using Docker you use the name of the service and not the IP. What did you do in particular? Is the database on the same network of the Passwordcockpit container?