-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known #1734
Comments
Looks like the database information provided is invalid. (wrong database host address) |
What's the entire command you use to run the Docker container? Are you sure you refer to a database that can be reached from within the container? |
I found the problem I did not changed all CHANGEME Fields.... |
When i run the same command now, i get another error In Connection.php line 664: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = ff and table_name = migrations) In PDOConnection.php line 50: SQLSTATE[HY000] [2002] No such file or directory In PDOConnection.php line 46: SQLSTATE[HY000] [2002] No such file or directory ` I checked Database access for the User. It works with the cresendials provided in docker run command |
The sql statement from the errormessage does not work |
I got it |
@da4id if both the mysql and the firefly instance are running on the same server inside docker, just create a docker network with and connect both containers to it. Then |
I am running Firefly III version x.x.x
Description
I got error SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
when i try to run it in Docker. I followed the step by step tutorial for docker installaiton. The error comes up after i run
docker exec -it <container> php artisan migrate --seed
Extra info
Please add extra info here, such as OS, browser, and the output from the
/debug
-page of your Firefly III installation (click the version at the bottom).[2018-09-26 20:03:00] local.ERROR: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known {"exception":"[object] (Doctrine\DBAL\Driver\PDOException(code: 2002): SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known at /var/www/firefly-iii/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:50, PDOException(code: 2002): SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known at /var/www/firefly-iii/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:46, PDOException(code: 0): PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known at /var/www/firefly-iii/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:46)
[stacktrace]
#0 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(65): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=CHAN...', 'CHANGEME', 'CHANGEME', Array)
#1 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(98): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=CHAN...', 'CHANGEME', 'CHANGEME', Array)
#2 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(48): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection(Object(Doctrine\DBAL\Driver\PDOException), 'mysql:host=CHAN...', 'CHANGEME', 'CHANGEME', Array)
#3 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=CHAN...', Array, Array)
#4 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(182): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#6 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func(Object(Closure))
#7 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(248): Illuminate\Database\Connection->getPdo()
#8 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(234): Illuminate\Database\DatabaseManager->refreshPdoConnections('mysql')
#9 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(168): Illuminate\Database\DatabaseManager->reconnect('mysql')
#10 [internal function]: Illuminate\Database\DatabaseManager->Illuminate\Database\{closure}(Object(Illuminate\Database\MySqlConnection))
#11 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): call_user_func(Object(Closure), Object(Illuminate\Database\MySqlConnection))
#12 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php(735): Illuminate\Database\Connection->reconnect()
#13 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php(717): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection(Object(Illuminate\Database\QueryException), 'select * from i...', Array, Object(Closure))
#14 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php(627): Illuminate\Database\Connection->handleQueryException(Object(Illuminate\Database\QueryException), 'select * from i...', Array, Object(Closure))
#15 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\Database\Connection->run('select * from i...', Array, Object(Closure))
#16 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(18): Illuminate\Database\Connection->select('select * from i...', Array)
#17 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(169): Illuminate\Database\Schema\MySqlBuilder->hasTable('migrations')
#18 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(555): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists()
#19 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(97): Illuminate\Database\Migrations\Migrator->repositoryExists()
#20 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(63): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase()
#21 [internal function]: Illuminate\Database\Console\Migrations\MigrateCommand->handle()
#22 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#23 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#24 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#25 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#26 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php(179): Illuminate\Container\Container->call(Array)
#27 /var/www/firefly-iii/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#28 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#29 /var/www/firefly-iii/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/firefly-iii/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Database\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /var/www/firefly-iii/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 /var/www/firefly-iii/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 {main}
"}
In PDOConnection.php line 50:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
In PDOConnection.php line 46:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
In PDOConnection.php line 46:
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known
The text was updated successfully, but these errors were encountered: