tobybatch / kimai2

Docker containers for the kimai2 web application including docker-compose and kubernetes/helm deployment.
MIT License
183 stars 96 forks source link

Problem with kimai:import:v1 - SQLSTATE[HY000] [2002] Connection refused .. #550

Closed raywitzel closed 8 months ago

raywitzel commented 8 months ago

Describe the bug A clear and concise description of what the bug is. I tried migrating Kima1 to Kima2; the Kimai applications run in containers. Therefore I go insite the container (with kimai2) and start to import the database form the old one.

In the result I got some error messages: ... deprecation.INFO: User Deprecated: The "url" connection parameter is deprecated. ... ... ErrorException ... An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused ...

Here is the whole log data from kimai:import:v1

```shell root@b672e1e3d5b8:/opt/kimai# root@b672e1e3d5b8:/opt/kimai# bin/console doctrine:schema:drop --full-database --force && bin/console kimai:install -n && bin/console kimai:import:v1 --global --fix-utf8 --fix-email=example.com --fix-timesheet --skip-error-rates --prefix="kimai1_" "mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8" "passwort_alt" -vvv Dropping database schema... [OK] Database schema dropped successfully! Kimai installation running ... ============================== Database `kimai_new` for connection named default already exists. Skipped. [notice] Migrating up to DoctrineMigrations\Version20230819090536 [2023-10-27T12:40:25.653180+00:00] deprecation.INFO: User Deprecated: Doctrine\DBAL\Connection::getEventManager is deprecated. (Connection.php:301 called by DependencyFactory.php:203, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Doctrine\\DBAL\\Connection::getEventManager is deprecated. (Connection.php:301 called by DependencyFactory.php:203, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:40:49.833842+00:00] deprecation.INFO: User Deprecated: Passing an instance of DateTimeImmutable is deprecated, use Doctrine\DBAL\Types\DateTimeImmutableType::convertToDatabaseValue() instead. (DateTimeType.php:57 called by UTCDateTimeType.php:37, https://github.com/doctrine/dbal/pull/6017, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Passing an instance of DateTimeImmutable is deprecated, use Doctrine\\DBAL\\Types\\DateTimeImmutableType::convertToDatabaseValue() instead. (DateTimeType.php:57 called by UTCDateTimeType.php:37, https://github.com/doctrine/dbal/pull/6017, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:41:47.493405+00:00] deprecation.INFO: User Deprecated: The "collate" option is deprecated in favor of "collation" and will be removed in 4.0. (AbstractMySQLPlatform.php:564 called by AbstractMySQLPlatform.php:500, https://github.com/doctrine/dbal/issues/5214, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"collate\" option is deprecated in favor of \"collation\" and will be removed in 4.0. (AbstractMySQLPlatform.php:564 called by AbstractMySQLPlatform.php:500, https://github.com/doctrine/dbal/issues/5214, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:44:51.949461+00:00] deprecation.INFO: User Deprecated: Relying on the default string column length on MySQL is deprecated, specify the length explicitly. (AbstractMySQLPlatform.php:233 called by AbstractPlatform.php:258, https://github.com/doctrine/dbal/issues/3263, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Relying on the default string column length on MySQL is deprecated, specify the length explicitly. (AbstractMySQLPlatform.php:233 called by AbstractPlatform.php:258, https://github.com/doctrine/dbal/issues/3263, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [notice] finished in 290735.2ms, used 54M memory, 65 migrations executed, 241 sql queries [OK] Successfully migrated to version : DoctrineMigrations\Version20230819090536 Rebuilding your cache, please be patient ... // Clearing the cache for the prod environment with debug false [OK] Cache for the "prod" environment (debug=false) was successfully cleared. // Warming up the cache for the prod environment with debug false [OK] Cache for the "prod" environment (debug=false) was successfully warmed. [OK] Congratulations! Successfully installed Kimai version 2.1.0 12:45:24 INFO [deprecation] User Deprecated: The "url" connection parameter is deprecated. Please use Doctrine\DBAL\Tools\DsnParser to parse a database url before calling Doctrine\DBAL\DriverManager. (DriverManager.php:262 called by DriverManager.php:173, https://github.com/doctrine/dbal/pull/5843, package doctrine/dbal) [ "exception" => ErrorException { #message: "User Deprecated: The "url" connection parameter is deprecated. Please use Doctrine\DBAL\Tools\DsnParser to parse a database url before calling Doctrine\DBAL\DriverManager. (DriverManager.php:262 called by DriverManager.php:173, https://github.com/doctrine/dbal/pull/5843, package doctrine/dbal)" #code: 0 #file: "./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php" #line: 210 #severity: E_USER_DEPRECATED trace: { ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210 { …} ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:108 { …} ./vendor/doctrine/dbal/src/DriverManager.php:262 { …} ./vendor/doctrine/dbal/src/DriverManager.php:173 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:256 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->execute(InputInterface $input, OutputInterface $output): int^ › // create reading database connection to Kimai 1 › $this->connection = $connection = DriverManager::getConnection(['url' => $options['url']]); › $this->connection->getConfiguration()->setSQLLogger(null); // FIXME @deprecated } ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } } ] [2023-10-27T12:45:24.686751+00:00] deprecation.INFO: User Deprecated: The "url" connection parameter is deprecated. Please use Doctrine\DBAL\Tools\DsnParser to parse a database url before calling Doctrine\DBAL\DriverManager. (DriverManager.php:262 called by DriverManager.php:173, https://github.com/doctrine/dbal/pull/5843, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"url\" connection parameter is deprecated. Please use Doctrine\\DBAL\\Tools\\DsnParser to parse a database url before calling Doctrine\\DBAL\\DriverManager. (DriverManager.php:262 called by DriverManager.php:173, https://github.com/doctrine/dbal/pull/5843, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] 12:45:24 INFO [deprecation] User Deprecated: Not configuring a schema manager factory is deprecated. Use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:226 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal) [ "exception" => ErrorException { #message: "User Deprecated: Not configuring a schema manager factory is deprecated. Use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:226 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal)" #code: 0 #file: "./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php" #line: 210 #severity: E_USER_DEPRECATED trace: { ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210 { …} ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:108 { …} ./vendor/doctrine/dbal/src/Connection.php:226 { …} ./vendor/doctrine/dbal/src/DriverManager.php:197 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:256 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->execute(InputInterface $input, OutputInterface $output): int^ › // create reading database connection to Kimai 1 › $this->connection = $connection = DriverManager::getConnection(['url' => $options['url']]); › $this->connection->getConfiguration()->setSQLLogger(null); // FIXME @deprecated } ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } } ] [2023-10-27T12:45:24.698215+00:00] deprecation.INFO: User Deprecated: Not configuring a schema manager factory is deprecated. Use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:226 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Not configuring a schema manager factory is deprecated. Use Doctrine\\DBAL\\Schema\\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:226 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] 12:45:24 INFO [deprecation] User Deprecated: Doctrine\DBAL\Configuration::setSQLLogger is deprecated, use setMiddlewares() and Logging\Middleware instead. (Configuration.php:87 called by KimaiImporterCommand.php:257, https://github.com/doctrine/dbal/pull/4967, package doctrine/dbal) [ "exception" => ErrorException { #message: "User Deprecated: Doctrine\DBAL\Configuration::setSQLLogger is deprecated, use setMiddlewares() and Logging\Middleware instead. (Configuration.php:87 called by KimaiImporterCommand.php:257, https://github.com/doctrine/dbal/pull/4967, package doctrine/dbal)" #code: 0 #file: "./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php" #line: 210 #severity: E_USER_DEPRECATED trace: { ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210 { …} ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:108 { …} ./vendor/doctrine/dbal/src/Configuration.php:87 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:257 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->execute(InputInterface $input, OutputInterface $output): int^ › $this->connection = $connection = DriverManager::getConnection(['url' => $options['url']]); › $this->connection->getConfiguration()->setSQLLogger(null); // FIXME @deprecated › /** @var Connection $c */ } ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } } ] [2023-10-27T12:45:24.699726+00:00] deprecation.INFO: User Deprecated: Doctrine\DBAL\Configuration::setSQLLogger is deprecated, use setMiddlewares() and Logging\Middleware instead. (Configuration.php:87 called by KimaiImporterCommand.php:257, https://github.com/doctrine/dbal/pull/4967, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Doctrine\\DBAL\\Configuration::setSQLLogger is deprecated, use setMiddlewares() and Logging\\Middleware instead. (Configuration.php:87 called by KimaiImporterCommand.php:257, https://github.com/doctrine/dbal/pull/4967, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] 12:45:24 INFO [deprecation] User Deprecated: Relying on a fallback connection used to determine the database platform while connecting to a non-existing database is deprecated. Either use an existing database name in connection parameters or omit the database name if the platform and the server configuration allow that. (Connection.php:464 called by Connection.php:410, https://github.com/doctrine/dbal/pull/5707, package doctrine/dbal) [ "exception" => ErrorException { #message: "User Deprecated: Relying on a fallback connection used to determine the database platform while connecting to a non-existing database is deprecated. Either use an existing database name in connection parameters or omit the database name if the platform and the server configuration allow that. (Connection.php:464 called by Connection.php:410, https://github.com/doctrine/dbal/pull/5707, package doctrine/dbal)" #code: 0 #file: "./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php" #line: 210 #severity: E_USER_DEPRECATED trace: { ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210 { …} ./vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:108 { …} ./vendor/doctrine/dbal/src/Connection.php:464 { …} ./vendor/doctrine/dbal/src/Connection.php:410 { …} ./vendor/doctrine/dbal/src/Connection.php:317 { …} ./vendor/doctrine/dbal/src/Connection.php:851 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion(Connection $connection, SymfonyStyle $io): bool^ › { › $optionColumn = $connection->quoteIdentifier('option'); › $qb = $connection->createQueryBuilder(); } ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 { …} ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } } ] [2023-10-27T12:45:24.702497+00:00] deprecation.INFO: User Deprecated: Relying on a fallback connection used to determine the database platform while connecting to a non-existing database is deprecated. Either use an existing database name in connection parameters or omit the database name if the platform and the server configuration allow that. (Connection.php:464 called by Connection.php:410, https://github.com/doctrine/dbal/pull/5707, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Relying on a fallback connection used to determine the database platform while connecting to a non-existing database is deprecated. Either use an existing database name in connection parameters or omit the database name if the platform and the server configuration allow that. (Connection.php:464 called by Connection.php:410, https://github.com/doctrine/dbal/pull/5707, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:45:24.686751+00:00] deprecation.INFO: User Deprecated: The "url" connection parameter is deprecated. Please use Doctrine\DBAL\Tools\DsnParser to parse a database url before calling Doctrine\DBAL\DriverManager. (DriverManager.php:262 called by DriverManager.php:173, https://github.com/doctrine/dbal/pull/5843, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"url\" connection parameter is deprecated. Please use Doctrine\\DBAL\\Tools\\DsnParser to parse a database url before calling Doctrine\\DBAL\\DriverManager. (DriverManager.php:262 called by DriverManager.php:173, https://github.com/doctrine/dbal/pull/5843, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:45:24.698215+00:00] deprecation.INFO: User Deprecated: Not configuring a schema manager factory is deprecated. Use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:226 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Not configuring a schema manager factory is deprecated. Use Doctrine\\DBAL\\Schema\\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:226 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:45:24.699726+00:00] deprecation.INFO: User Deprecated: Doctrine\DBAL\Configuration::setSQLLogger is deprecated, use setMiddlewares() and Logging\Middleware instead. (Configuration.php:87 called by KimaiImporterCommand.php:257, https://github.com/doctrine/dbal/pull/4967, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Doctrine\\DBAL\\Configuration::setSQLLogger is deprecated, use setMiddlewares() and Logging\\Middleware instead. (Configuration.php:87 called by KimaiImporterCommand.php:257, https://github.com/doctrine/dbal/pull/4967, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:45:24.702497+00:00] deprecation.INFO: User Deprecated: Relying on a fallback connection used to determine the database platform while connecting to a non-existing database is deprecated. Either use an existing database name in connection parameters or omit the database name if the platform and the server configuration allow that. (Connection.php:464 called by Connection.php:410, https://github.com/doctrine/dbal/pull/5707, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Relying on a fallback connection used to determine the database platform while connecting to a non-existing database is deprecated. Either use an existing database name in connection parameters or omit the database name if the platform and the server configuration allow that. (Connection.php:464 called by Connection.php:410, https://github.com/doctrine/dbal/pull/5707, package doctrine/dbal) at /opt/kimai/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} [] [2023-10-27T12:45:24.705679+00:00] console.CRITICAL: Error thrown while running command "kimai:import:v1 --global --fix-utf8 --fix-email='example.com' --fix-timesheet --skip-error-rates --prefix=kimai1_ 'mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8' passwort_alt -vvv". Message: "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused" {"exception":"[object] (Doctrine\\DBAL\\Exception\\ConnectionException(code: 2002): An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused at /opt/kimai/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:101)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34)","command":"kimai:import:v1 --global --fix-utf8 --fix-email='example.com' --fix-timesheet --skip-error-rates --prefix=kimai1_ 'mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8' passwort_alt -vvv","message":"An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused"} [] 12:45:24 CRITICAL [console] Error thrown while running command "kimai:import:v1 --global --fix-utf8 --fix-email='example.com' --fix-timesheet --skip-error-rates --prefix=kimai1_ 'mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8' passwort_alt -vvv". Message: "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused" [ "exception" => Doctrine\DBAL\Exception\ConnectionException^ { #message: "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused" #code: 2002 #file: "./vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php" #line: 101 -previous: Doctrine\DBAL\Driver\PDO\Exception^ { #message: "SQLSTATE[HY000] [2002] Connection refused" #code: 2002 #file: "./vendor/doctrine/dbal/src/Driver/PDO/Exception.php" #line: 28 -previous: PDOException { #message: "SQLSTATE[HY000] [2002] Connection refused" #code: 2002 #file: "./vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php" #line: 34 +errorInfo: [ "HY000", 2002, "Connection refused" ] trace: { ./vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34 { …} ./vendor/doctrine/dbal/src/Connection.php:377 { …} ./vendor/doctrine/dbal/src/Connection.php:452 { …} ./vendor/doctrine/dbal/src/Connection.php:410 { …} ./vendor/doctrine/dbal/src/Connection.php:317 { …} ./vendor/doctrine/dbal/src/Connection.php:851 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion(Connection $connection, SymfonyStyle $io): bool^ › { › $optionColumn = $connection->quoteIdentifier('option'); › $qb = $connection->createQueryBuilder(); } ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 { …} ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } } -sqlState: "HY000" trace: { ./vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28 { …} ./vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:40 { …} ./vendor/doctrine/dbal/src/Connection.php:377 { …} ./vendor/doctrine/dbal/src/Connection.php:452 { …} ./vendor/doctrine/dbal/src/Connection.php:410 { …} ./vendor/doctrine/dbal/src/Connection.php:317 { …} ./vendor/doctrine/dbal/src/Connection.php:851 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion(Connection $connection, SymfonyStyle $io): bool^ › { › $optionColumn = $connection->quoteIdentifier('option'); › $qb = $connection->createQueryBuilder(); } ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 { …} ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } } -query: null trace: { ./vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:101 { …} ./vendor/doctrine/dbal/src/Connection.php:1938 { …} ./vendor/doctrine/dbal/src/Connection.php:1886 { …} ./vendor/doctrine/dbal/src/Connection.php:379 { …} ./vendor/doctrine/dbal/src/Connection.php:452 { …} ./vendor/doctrine/dbal/src/Connection.php:410 { …} ./vendor/doctrine/dbal/src/Connection.php:317 { …} ./vendor/doctrine/dbal/src/Connection.php:851 { …} ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 { KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion(Connection $connection, SymfonyStyle $io): bool^ › { › $optionColumn = $connection->quoteIdentifier('option'); › $qb = $connection->createQueryBuilder(); } ./var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 { …} ./vendor/symfony/console/Command/Command.php:326 { …} ./vendor/symfony/console/Application.php:1081 { …} ./vendor/symfony/framework-bundle/Console/Application.php:91 { …} ./vendor/symfony/console/Application.php:320 { …} ./vendor/symfony/framework-bundle/Console/Application.php:80 { …} ./vendor/symfony/console/Application.php:174 { …} ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …} ./vendor/autoload_runtime.php:29 { …} ./bin/console:13 { …} } }, "command" => "kimai:import:v1 --global --fix-utf8 --fix-email='example.com' --fix-timesheet --skip-error-rates --prefix=kimai1_ 'mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8' passwort_alt -vvv", "message" => "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused" ] 12:45:24 DEBUG [console] Command "kimai:import:v1 --global --fix-utf8 --fix-email='example.com' --fix-timesheet --skip-error-rates --prefix=kimai1_ 'mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8' passwort_alt -vvv" exited with code "2002" [ "command" => "kimai:import:v1 --global --fix-utf8 --fix-email='example.com' --fix-timesheet --skip-error-rates --prefix=kimai1_ 'mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8' passwort_alt -vvv", "code" => 2002 ] In ExceptionConverter.php line 101: [Doctrine\DBAL\Exception\ConnectionException (2002)] An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused Exception trace: at /opt/kimai/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:101 Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:1938 Doctrine\DBAL\Connection->handleDriverException() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:1886 Doctrine\DBAL\Connection->convertException() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:379 Doctrine\DBAL\Connection->connect() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:452 Doctrine\DBAL\Connection->getDatabasePlatformVersion() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:410 Doctrine\DBAL\Connection->detectDatabasePlatform() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:317 Doctrine\DBAL\Connection->getDatabasePlatform() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:851 Doctrine\DBAL\Connection->quoteIdentifier() at /opt/kimai/var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion() at /opt/kimai/var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->execute() at /opt/kimai/vendor/symfony/console/Command/Command.php:326 Symfony\Component\Console\Command\Command->run() at /opt/kimai/vendor/symfony/console/Application.php:1081 Symfony\Component\Console\Application->doRunCommand() at /opt/kimai/vendor/symfony/framework-bundle/Console/Application.php:91 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/kimai/vendor/symfony/console/Application.php:320 Symfony\Component\Console\Application->doRun() at /opt/kimai/vendor/symfony/framework-bundle/Console/Application.php:80 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/kimai/vendor/symfony/console/Application.php:174 Symfony\Component\Console\Application->run() at /opt/kimai/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /opt/kimai/vendor/autoload_runtime.php:29 require_once() at /opt/kimai/bin/console:13 In Exception.php line 28: [Doctrine\DBAL\Driver\PDO\Exception (2002)] SQLSTATE[HY000] [2002] Connection refused Exception trace: at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28 Doctrine\DBAL\Driver\PDO\Exception::new() at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:40 Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:377 Doctrine\DBAL\Connection->connect() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:452 Doctrine\DBAL\Connection->getDatabasePlatformVersion() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:410 Doctrine\DBAL\Connection->detectDatabasePlatform() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:317 Doctrine\DBAL\Connection->getDatabasePlatform() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:851 Doctrine\DBAL\Connection->quoteIdentifier() at /opt/kimai/var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion() at /opt/kimai/var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->execute() at /opt/kimai/vendor/symfony/console/Command/Command.php:326 Symfony\Component\Console\Command\Command->run() at /opt/kimai/vendor/symfony/console/Application.php:1081 Symfony\Component\Console\Application->doRunCommand() at /opt/kimai/vendor/symfony/framework-bundle/Console/Application.php:91 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/kimai/vendor/symfony/console/Application.php:320 Symfony\Component\Console\Application->doRun() at /opt/kimai/vendor/symfony/framework-bundle/Console/Application.php:80 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/kimai/vendor/symfony/console/Application.php:174 Symfony\Component\Console\Application->run() at /opt/kimai/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /opt/kimai/vendor/autoload_runtime.php:29 require_once() at /opt/kimai/bin/console:13 In Driver.php line 34: [PDOException (2002)] SQLSTATE[HY000] [2002] Connection refused Exception trace: at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34 PDO->__construct() at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34 Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:377 Doctrine\DBAL\Connection->connect() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:452 Doctrine\DBAL\Connection->getDatabasePlatformVersion() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:410 Doctrine\DBAL\Connection->detectDatabasePlatform() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:317 Doctrine\DBAL\Connection->getDatabasePlatform() at /opt/kimai/vendor/doctrine/dbal/src/Connection.php:851 Doctrine\DBAL\Connection->quoteIdentifier() at /opt/kimai/var/plugins/ImportBundle/Command/KimaiImporterCommand.php:585 KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->checkDatabaseVersion() at /opt/kimai/var/plugins/ImportBundle/Command/KimaiImporterCommand.php:264 KimaiPlugin\ImportBundle\Command\KimaiImporterCommand->execute() at /opt/kimai/vendor/symfony/console/Command/Command.php:326 Symfony\Component\Console\Command\Command->run() at /opt/kimai/vendor/symfony/console/Application.php:1081 Symfony\Component\Console\Application->doRunCommand() at /opt/kimai/vendor/symfony/framework-bundle/Console/Application.php:91 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/kimai/vendor/symfony/console/Application.php:320 Symfony\Component\Console\Application->doRun() at /opt/kimai/vendor/symfony/framework-bundle/Console/Application.php:80 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/kimai/vendor/symfony/console/Application.php:174 Symfony\Component\Console\Application->run() at /opt/kimai/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /opt/kimai/vendor/autoload_runtime.php:29 require_once() at /opt/kimai/bin/console:13 kimai:import:v1 [--country [COUNTRY]] [--currency [CURRENCY]] [--prefix PREFIX] [--timezone [TIMEZONE]] [--language [LANGUAGE]] [--global] [--fix-utf8] [--fix-email FIX-EMAIL] [--fix-timesheet] [--skip-error-rates] [--merge-customer] [--merge-project] [--merge-user] [--merge-team] [--create-team] [--alias-as-account-number] [--meta-comment META-COMMENT] [--meta-location META-LOCATION] [--meta-tracking-number META-TRACKING-NUMBER] [--skip-teams] [--skip-team-customers] [--skip-team-projects] [--skip-team-activities] [--check-already-imported] [--] root@b672e1e3d5b8:/opt/kimai# ```

To Reproduce I have used several containers. One for Kimai Version 1.24.0 and one for Kimai Version 2.1.0. The new Kimai obtained the plugin ImportBundle in addition. All Container worked fine, the old one and the new one, one next to the other. But I can't import the mysql data from the old one to the new one. To do this I run the following command inside the container (with Kimai Version 2.1.0):

root@bb85f01551ba:/opt/kimai# bin/console doctrine:schema:drop --full-database --force && bin/console kimai:install -n && bin/console kimai:import:v1 --global --fix-utf8 --fix-email=example.com --fix-timesheet  --skip-error-rates --prefix="kimai1_" "mysql://kimaiuser_old@127.0.0.1:3336/kimai_old?charset=utf8" "passwort_alt" -vvv

The pocedure stopped with error messages; you can see these messages above.
I assume that there is a problem with the deprecated "url" connection parameter! But I am not sure.

Desktop (please complete the following information):

Docker compose file (with passwords redacted)

Container with Kimai version 1.24.0

version: "3.5"

services:
  app:
    container_name: kimai_old
    image: kimai/kimai2:apache-1.24.0-prod
    restart: always
    ports:
      - 30405:8001
    depends_on:
        - db_kimai_old
    environment:
      - DATABASE_URL=mysql://kimaiuser_old:${DATABASE_PASSWORD}@db_kimai_old:3306/kimai_old
      - TRUSTED_HOSTS=localhost,192.168.0.217,127.0.0.1
      - APP_ENV=prod
#      - APP_ENV=dev

  db_kimai_old:
    image: mysql:8.0.34
    container_name: db_kimai_old
    restart: always
    environment:
      - MYSQL_DATABASE=kimai_old
      - MYSQL_USER=kimaiuser_old
      - MYSQL_PASSWORD=${DATABASE_PASSWORD}
      - MYSQL_ROOT_PASSWORD=password_2_old
    ports:
      - 3336:3306

  phpmyadmin:
    container_name: phpmyadmin_old
    image: phpmyadmin
    restart: always
    ports:
      - 9091:80
    environment:
      - PMA_ARBITRARY=1

volumes:
  mysql-data:
    driver: local

.env related to Kimai 1.24.0

COMPOSE_PROJECT_NAME=old_kimai
DATABASE_PASSWORD=passwort_alt

Container with the new Kimai version 2.1.0

version: "3.5"

services:
  app:
    container_name: kimai_new
    image: kimai/kimai2:apache-2.1.0-prod
    restart: always
    ports:
      - 40802:8001
    depends_on:
        - db_kimai_new
    environment:
      - DATABASE_URL=mysql://kimaiuser_new:${DATABASE_PASSWORD}@db_kimai_new:3306/kimai_new
      - TRUSTED_HOSTS=localhost,192.168.0.217,127.0.0.1
      - APP_ENV=prod
#      - APP_ENV=dev
    volumes:
       - ./kimai-var:/opt/kimai/var

  db_kimai_new:
    image: mysql:latest
    container_name: db_kimai_new
    restart: always
    environment:
      - MYSQL_DATABASE=kimai_new
      - MYSQL_USER=kimaiuser_new
      - MYSQL_PASSWORD=${DATABASE_PASSWORD}
      - MYSQL_ROOT_PASSWORD=password_2

  phpmyadmin:
    image: phpmyadmin
    container_name: phpmyadmin_new
    restart: always
    ports:
      - 8081:80
    environment:
      - PMA_ARBITRARY=1

volumes:
  mysql-data:
    driver: local

.env related to Kimai 2.1.0

COMPOSE_PROJECT_NAME=new_kimai
DATABASE_PASSWORD=passwort_neu

Additional context Can anyone help me?

kevinpapst commented 8 months ago

You are trying to "IMPORT FROM KIMAI 1" - see this: https://www.kimai.org/documentation/versions.html#kimai-1 This is a software that is not maitained since 2015 and it never had a Docker image.

You want a super normal update from Kimai (2) 1.24.0 to Kimai (2) 2.1.0 Which already happened after you upgraded your docker image.

You nuked your entire database by running these commands. I hope you have a backup. Mount it and start the container and you are good to go.