Skip to content
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

Failing to connect as root to mariadb, perhaps other issues as well #268

Closed
TomFaulkner opened this issue Jun 30, 2021 · 4 comments
Closed

Comments

@TomFaulkner
Copy link
Contributor

TomFaulkner commented Jun 30, 2021

I moved from another server some time ago and finally got around to setting up wallabag again. I have an existing database and as of today the most recent wallabag/wallabag image.

Perhaps among other issues, it seems to fail while attempting to connect to the database as root. I have shelled into the wallabag container and connected using the mysql command as root using the password copied from the compose file. I have also connected as the wallabag user. I have also verified that the database is in-tact and accessible by the wallabag user.

I have also added POPULATE_DATABASE=False, but this didn't seem to change anything. I have also tried removing the MYSQL_ROOT_PASSWORD variable.

Relevant compose file pieces:

  wallabag:
    image: wallabag/wallabag
    restart: always
    environment:
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
      - SYMFONY__ENV__DATABASE_HOST=wallabag-db
      - SYMFONY__ENV__DATABASE_PORT=3306
      - SYMFONY__ENV__DATABASE_NAME=wallabag
      - SYMFONY__ENV__DATABASE_PASSWORD=wallypass
      - SYMFONY__ENV__DOMAIN_NAME=https://wallabag.mydomain.com
      - POPULATE_DATABASE=False
      - MYSQL_ROOT_PASSWORD="strong and complicated password"

  wallabag-db:
    image: mariadb:latest
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD="strong and complicated password"
    volumes:
      - ./shaarli-wallabag-data/wallabag/maria:/var/lib/mysql

The output on startup is:

wallabag_1     | Starting provisioner...
wallabag_1     | [WARNING]: Found both group and host with same name: localhost
wallabag_1     | [WARNING]: Platform linux on host localhost is using the discovered Python
wallabag_1     | interpreter at /usr/bin/python3, but future installation of another Python
wallabag_1     | interpreter could change this. See https://docs.ansible.com/ansible/2.9/referen
wallabag_1     | ce_appendices/interpreter_discovery.html for more information.
wallabag_1     | PLAY [localhost] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var TASK [Gathering Facts] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] TASK [needed dirs] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] => (item=/var/www/wallabag/app) ok: [localhost] => (item=/var/www/wallabag/app/config) ok: [localhost] => (item=/var/www/wallabag/data) ok: [localhost] => (item=/var/www/wallabag/data/assets) ok: [localhost] => (item=/var/www/wallabag/data/db) TASK [write parameters.yml] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var changed: [localhost] TASK [stat] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [notify install for sqlite] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [wait for db container] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] TASK [add mariadb db] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [add mariadb user] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [postgresql db] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [add postgresql user] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [remove cache] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var changed: [localhost] TASK [run composer] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var fatal: [localhost]: FAILED! => {"changed": true, "cmd": "SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist", "delta": "0:00:05.528671", "end": "2021-06-29 23:57:50.981711", "msg": "non-zero return code", "rc": 1, "start": "2021-06-29 23:57:45.453040", "stderr": "Loading composer repositories with package information\nInstalling dependencies from lock file\nNothing to install or update\nPackage doctrine/doctrine-cache-bundle is abandoned, you should avoid using it. No replacement was suggested.\nPackage doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.\nPackage guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.\nPackage guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.\nPackage liip/theme-bundle is abandoned, you should avoid using it. Use sylius/theme-bundle instead.\nPackage sensio/distribution-bundle is abandoned, you should avoid using it. No replacement was suggested.\nPackage sensiolabs/security-checker is abandoned, you should avoid using it. Use https://github.com/fabpot/local-php-security-checker instead.\nPackage twig/extensions is abandoned, you should avoid using it. No replacement was suggested.\nGenerating optimized autoload files\nDeprecation Notice: Class SimpleHtmlDom\\simple_html_dom_node located in ./vendor/mgargano/simplehtmldom/src/simple_html_dom.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class SimpleHtmlDom\\simple_html_dom located in ./vendor/mgargano/simplehtmldom/src/simple_html_dom.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Sensio\\Bundle\\FrameworkExtraBundle\\Tests\\Request\\ParamConverter\\ArgumentNameConverterTest located in ./vendor/sensio/framework-extra-bundle/Tests/Request/ArgumentNameConverterTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Sensio\\Bundle\\FrameworkExtraBundle\\Tests\\DependencyInjection\\AddExpressionLanguageProvidersPassTest located in ./vendor/sensio/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Sensio\\Bundle\\FrameworkExtraBundle\\Tests\\DependencyInjection\\AddParamConverterPassTest located in ./vendor/sensio/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddParamConverterPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Nelmio\\ApiDocBundle\\Tests\\Extractor\\FosRestHandlerTest located in ./vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Tests/Extractor/Handler/FosRestHandlerTest.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Nelmio\\ApiDocBundle\\Tests\\Extractor\\SensioFrameworkExtraHandlerTest located in ./vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Tests/Extractor/Handler/SensioFrameworkExtraHandlerTest.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Nelmio\\ApiDocBundle\\Tests\\Functional\\AppKernel located in ./vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Tests/Fixtures/app/AppKernel.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Liip\\ThemeBundle\\Tests\\EventListener\\UseCaseTest located in ./vendor/liip/theme-bundle/Tests/UseCaseTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Liip\\ThemeBundle\\Tests\\DependencyInjection\\AsseticTwigFormulaPassTest located in ./vendor/liip/theme-bundle/Tests/DependencyInjection/Compiler/AsseticTwigFormulaPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Liip\\ThemeBundle\\Tests\\DependencyInjection\\ThemeCompilerPassTest located in ./vendor/liip/theme-bundle/Tests/DependencyInjection/Compiler/ThemeCompilerPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\nDeprecation Notice: Class Doctrine\\Bundle\\MigrationsBundle\\Tests\\DependencyInjection\\DoctrineCommandTest located in ./vendor/doctrine/doctrine-migrations-bundle/Tests/Command/DoctrineCommandTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201\n49 packages you are using are looking for funding.\nUse the `composer fund` command to find out more!\n> Incenteev\\ParameterHandler\\ScriptHandler::buildParameters\n> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap\n> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache\nScript Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache handling the post-cmd event terminated with an exception\n\n \n [RuntimeException] \n An error occurred when executing the \"'cache:clear --no-warmup'\" command: \n \n \n \n \n In AbstractMySQLDriver.php line 97: \n \n An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for u \n ser 'root'@'172.18.0.2' (using password: YES) \n \n \n In PDOConnection.php line 31: \n \n SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa \n ssword: YES) \n \n \n In PDOConnection.php line 27: \n \n SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa \n ssword: YES) \n \n\ninstall [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...", "stderr_lines": ["Loading composer repositories with package information", "Installing dependencies from lock file", "Nothing to install or update", "Package doctrine/doctrine-cache-bundle is abandoned, you should avoid using it. No replacement was suggested.", "Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.", "Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.", "Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.", "Package liip/theme-bundle is abandoned, you should avoid using it. Use sylius/theme-bundle instead.", "Package sensio/distribution-bundle is abandoned, you should avoid using it. No replacement was suggested.", "Package sensiolabs/security-checker is abandoned, you should avoid using it. Use https://github.com/fabpot/local-php-security-checker instead.", "Package twig/extensions is abandoned, you should avoid using it. No replacement was suggested.", "Generating optimized autoload files", "Deprecation Notice: Class SimpleHtmlDom\\simple_html_dom_node located in ./vendor/mgargano/simplehtmldom/src/simple_html_dom.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class SimpleHtmlDom\\simple_html_dom located in ./vendor/mgargano/simplehtmldom/src/simple_html_dom.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Sensio\\Bundle\\FrameworkExtraBundle\\Tests\\Request\\ParamConverter\\ArgumentNameConverterTest located in ./vendor/sensio/framework-extra-bundle/Tests/Request/ArgumentNameConverterTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Sensio\\Bundle\\FrameworkExtraBundle\\Tests\\DependencyInjection\\AddExpressionLanguageProvidersPassTest located in ./vendor/sensio/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Sensio\\Bundle\\FrameworkExtraBundle\\Tests\\DependencyInjection\\AddParamConverterPassTest located in ./vendor/sensio/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddParamConverterPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Nelmio\\ApiDocBundle\\Tests\\Extractor\\FosRestHandlerTest located in ./vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Tests/Extractor/Handler/FosRestHandlerTest.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Nelmio\\ApiDocBundle\\Tests\\Extractor\\SensioFrameworkExtraHandlerTest located in ./vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Tests/Extractor/Handler/SensioFrameworkExtraHandlerTest.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Nelmio\\ApiDocBundle\\Tests\\Functional\\AppKernel located in ./vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Tests/Fixtures/app/AppKernel.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Liip\\ThemeBundle\\Tests\\EventListener\\UseCaseTest located in ./vendor/liip/theme-bundle/Tests/UseCaseTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Liip\\ThemeBundle\\Tests\\DependencyInjection\\AsseticTwigFormulaPassTest located in ./vendor/liip/theme-bundle/Tests/DependencyInjection/Compiler/AsseticTwigFormulaPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Liip\\ThemeBundle\\Tests\\DependencyInjection\\ThemeCompilerPassTest located in ./vendor/liip/theme-bundle/Tests/DependencyInjection/Compiler/ThemeCompilerPassTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "Deprecation Notice: Class Doctrine\\Bundle\\MigrationsBundle\\Tests\\DependencyInjection\\DoctrineCommandTest located in ./vendor/doctrine/doctrine-migrations-bundle/Tests/Command/DoctrineCommandTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201", "49 packages you are using are looking for funding.", "Use the `composer fund` command to find out more!", "> Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Script Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache handling the post-cmd event terminated with an exception", "", " ", " [RuntimeException] ", " An error occurred when executing the \"'cache:clear --no-warmup'\" command: ", " ", " ", " ", " ", " In AbstractMySQLDriver.php line 97: ", " ", " An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for u ", " ser 'root'@'172.18.0.2' (using password: YES) ", " ", " ", " In PDOConnection.php line 31: ", " ", " SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa ", " ssword: YES) ", " ", " ", " In PDOConnection.php line 27: ", " ", " SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa ", " ssword: YES) ", " ", "", "install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]..."], "stdout": "composer/package-versions-deprecated: Generating version class...\ncomposer/package-versions-deprecated: ...done generating version class\nUpdating the \"app/config/parameters.yml\" file\n\nIn AbstractMySQLDriver.php line 97:\n \n An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for u \n ser 'root'@'172.18.0.2' (using password: YES) \n \n\nIn PDOConnection.php line 31:\n \n SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa \n ssword: YES) \n \n\nIn PDOConnection.php line 27:\n \n SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa \n ssword: YES) \n ", "stdout_lines": ["composer/package-versions-deprecated: Generating version class...", "composer/package-versions-deprecated: ...done generating version class", "Updating the \"app/config/parameters.yml\" file", "", "In AbstractMySQLDriver.php line 97:", " ", " An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for u ", " ser 'root'@'172.18.0.2' (using password: YES) ", " ", "", "In PDOConnection.php line 31:", " ", " SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa ", " ssword: YES) ", " ", "", "In PDOConnection.php line 27:", " ", " SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.18.0.2' (using pa ", " ssword: YES) ", " "]} PLAY RECAP bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var localhost : ok=5 changed=2 unreachable=0 failed=1 skipped=6 rescued=0 ignored=0
wallabag_1     | Provisioner finished.

mysql.user table, to evidence that it shouldn't be a blocked IP issue:

+-------------+-----------+
| User        | Host      |
+-------------+-----------+
| root        | %         |
| wallabag    | %         |
| mariadb.sys | localhost |
| root        | localhost |
+-------------+-----------+
@jtagcat
Copy link

jtagcat commented Aug 25, 2021

See #174 (comment)

@GlassedSilver
Copy link

Don't put your password in quotation marks. That's what killed it for me.

@j0k3r
Copy link
Member

j0k3r commented Nov 30, 2022

This issue is fairly old and there hasn't been much activity on it. Closing, but please re-open if it still occurs.

@j0k3r j0k3r closed this as completed Nov 30, 2022
@Vertux
Copy link

Vertux commented Jul 15, 2024

Unfortunately this problem still persists. It happens with the docker-compose example code.

Log of the wallabag image:

2024-07-15T20:54:59.796392122Z ERROR 1045 (28000): Access denied for user 'root'@'172.25.0.4' (using password: YES)

2024-07-15T20:55:03.387526672Z Starting wallabag ...

Log of the MySQL image:

2024-07-15T20:54:55.546725676Z 2024-07-15 20:54:55 7 [Warning] Aborted connection 7 to db: 'unconnected' user: 'unauthenticated' host: '172.25.0.4' (This connection closed normally without authentication)

2024-07-15T20:54:55.608992159Z 2024-07-15 20:54:55 8 [Warning] Access denied for user 'root'@'172.25.0.4' (using password: YES)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants