Pim-community-dev: Docker: SQLSTATE[HY000] [2002] No such file or directory

Created on 20 Jun 2018  ·  1Comment  ·  Source: akeneo/pim-community-dev

While trying to run bin/docker/pim-initialize.sh I receive this error:

Akeneo PIM requirements check:
09:52:34 ERROR     [console] Error thrown while running command "pim:installer:check-requirements --no-debug=1 --env=prod". Message: "SQLSTATE[HY000] [2002] No such file or directory" ["error" => PDOException { …},"command" => "pim:installer:check-requirements --no-debug=1 --env=prod","message" => "SQLSTATE[HY000] [2002] No such file or directory"] []

In PimRequirements.php line 250:

  SQLSTATE[HY000] [2002] No such file or directory  


pim:installer:check-requirements [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

The command terminated with an error code: 2002.

The script continues to run, and then I receive another error:

yarn run v1.6.0
warning package.json: No license field
$ yarn run sync && NODE_PATH=node_modules webpack --config $npm_package_config_source/webpack.config.js
warning package.json: No license field
$ NODE_PATH=node_modules node $npm_package_config_check --source=$npm_package_config_source
/srv/pim/vendor/akeneo/pim-community-dev/webpack.config.js:16
    throw new Error(`The web/js/require-paths.js module does not exist - You need to run
    ^

Error: The web/js/require-paths.js module does not exist - You need to run
    "bin/console pim:install" or "bin/console pim:installer:dump-require-paths" before
    running webpack 

    at Object.<anonymous> (/srv/pim/vendor/akeneo/pim-community-dev/webpack.config.js:16:11)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at requireConfig (/srv/pim/node_modules/webpack/bin/convert-argv.js:97:18)
    at /srv/pim/node_modules/webpack/bin/convert-argv.js:104:17
error Command failed with exit code 1.

CONTEXT
The problem happens running this command

docker-compose exec fpm bin/console --env=prod pim:install --force --symlink --clean

I've followed the instructions here, so I simply copied the parameters.yml.dist to parameters.yml and created the parameters_test.yml copying into the parameters from the documentation.

The error raises while trying to create the PDO connection.

I've dumped the content of the $parameters['parameters'] array, and obviously all the parameters are there.

So the problem is with docker-compose.yml file I think.

But as this is the first time I try to use Docker and Akeneo, I really don't know what to do to debug further.

Any help is appreciated... Thank you!

Most helpful comment

Ok, I had an illumination and simply searched for "Docker SQLSTATE[HY000] [2002] No such file or directory" on Google.

The first StackOverflow answer solved the issue thanks to this reply.

So, as in the docker-compose.yml file the mysql alias is "mysql", I changed the parameters.yml param parameters.database_host from localhost to mysql and now the error is solved.

>All comments

Ok, I had an illumination and simply searched for "Docker SQLSTATE[HY000] [2002] No such file or directory" on Google.

The first StackOverflow answer solved the issue thanks to this reply.

So, as in the docker-compose.yml file the mysql alias is "mysql", I changed the parameters.yml param parameters.database_host from localhost to mysql and now the error is solved.

Was this page helpful?
0 / 5 - 0 ratings