nuxsmin / sysPass

Systems Password Manager
https://syspass.org
GNU General Public License v3.0
971 stars 207 forks source link

Unable to connect to DB Warn to developer #1928

Open frohlichcortezh opened 5 months ago

frohlichcortezh commented 5 months ago

sysPass Version 3.2.11

Describe the bug After docker compose up, during installation.

To Reproduce Steps to reproduce the behavior:

  1. docker compose up
  2. syspass database server as the name of the container

Expected behavior Installation goes through

Screenshots Screenshot 2024-04-16 203437 image

Event log

[2024-04-16 23:34:22] syspass.EXCEPTION: logger {"message":"Unable to connect to DB
#0 /var/www/html/sysPass/lib/SP/Services/Install/Installer.php(190): SP\Services\Install\Installer->saveMasterPassword()
#1 /var/www/html/sysPass/lib/SP/Services/Install/Installer.php(99): SP\Services\Install\Installer->install()
#2 /var/www/html/sysPass/app/modules/web/Controllers/InstallController.php(94): SP\Services\Install\Installer->run(Object(SP\Services\Install\InstallData))
#3 [internal function]: SP\Modules\Web\Controllers\InstallController->installAction()
#4 /var/www/html/sysPass/lib/SP/Bootstrap.php(247): call_user_func_array(Array,Array)
#5 [internal function]: SP\Bootstrap->SP\{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollec>
#6 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Kl>
#7 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#8 /var/www/html/sysPass/lib/SP/Bootstrap.php(471): Klein\Klein->dispatch(Object(Klein\Request))
#9 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#10 /var/www/html/sysPass/index.php(28): require(String)","caller":"N/A"}
[2024-04-16 23:34:22] syspass.EXCEPTION: logger {"message":"(P) Unable to connect to DB
#0 /var/www/html/sysPass/lib/SP/Storage/Database/Database.php(175): SP\Storage\Database\Database->prepareQueryData(Object(SP\Storage\Database\QueryData))
#1 /var/www/html/sysPass/lib/SP/Repositories/Config/ConfigRepository.php(70): SP\Storage\Database\Database->doQuery(Object(SP\Storage\Database\QueryData))
#2 /var/www/html/sysPass/lib/SP/Services/Config/ConfigService.php(93): SP\Repositories\Config\ConfigRepository->create(Object(SP\DataModel\ConfigData))
#3 /var/www/html/sysPass/lib/SP/Services/Install/Installer.php(314): SP\Services\Config\ConfigService->create(Object(SP\DataModel\ConfigData))
#4 /var/www/html/sysPass/lib/SP/Services/Install/Installer.php(190): SP\Services\Install\Installer->saveMasterPassword()
#5 /var/www/html/sysPass/lib/SP/Services/Install/Installer.php(99): SP\Services\Install\Installer->install()
#6 /var/www/html/sysPass/app/modules/web/Controllers/InstallController.php(94): SP\Services\Install\Installer->run(Object(SP\Services\Install\InstallData))
#7 [internal function]: SP\Modules\Web\Controllers\InstallController->installAction()
#8 /var/www/html/sysPass/lib/SP/Bootstrap.php(247): call_user_func_array(Array, Array)
#9 [internal function]: SP\Bootstrap->SP\{closure}(Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteC>
#10 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure), Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Obj>
#11 /var/www/html/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route), Object(Klein\DataCollection\RouteCollection), Array)
#12 /var/www/html/sysPass/lib/SP/Bootstrap.php(471): Klein\Klein->dispatch(Object(Klein\Request))
#13 /var/www/html/sysPass/lib/Base.php(75): SP\Bootstrap::run(Object(DI\Container))
#14 /var/www/html/sysPass/index.php(28): require('/var/www/html/s...')
#15 {main}","caller":"N/A"}
frohlichcortezh commented 5 months ago

image

I'm able to connect to the DB with docker exec using the password set up in the .env with docker compose

frohlichcortezh commented 5 months ago

Logs DB:

2024-04-16 23:33:06 123706607097600 [Warning] 'user' entry 'sp_661f0ab24a7e7@b0a6dc856541' ignored in --skip-name-resolve mode.
2024-04-16 23:33:06 123706607097600 [Warning] 'db' entry 'syspass sp_661f0ab24a7e7@b0a6dc856541' ignored in --skip-name-resolve mode.
2024-04-16 23:33:06 123706602616576 [Warning] Access denied for user 'sp_661f0ab24a7e7'@'172.20.0.3' (using password: YES)
2024-04-16 23:34:22 123706602616576 [Warning] 'user' entry 'sp_661f0afe0ed3d@b0a6dc856541' ignored in --skip-name-resolve mode.
2024-04-16 23:34:22 123706602616576 [Warning] 'user' entry 'sp_661f0afe0ed3d@b0a6dc856541' ignored in --skip-name-resolve mode.
2024-04-16 23:34:22 123706602616576 [Warning] 'db' entry 'syspass sp_661f0afe0ed3d@b0a6dc856541' ignored in --skip-name-resolve mode.
2024-04-16 23:34:22 123706607097600 [Warning] Access denied for user 'sp_661f0afe0ed3d'@'172.20.0.3' (using password: YES)