Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unable to use database_socket in docker

Open
#417 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, docker-compose, mariadb, php, shell
Domain
databases, devops

Research direction

Read root/entrypoint.sh at the linked wait_for_database sections and compare its environment handling with the Docker Compose configuration for image 2.6.9. Reproduce the startup using the mounted MariaDB socket and check the cache-clear output. Done means the container starts without waiting on an unused host/port and connects successfully through the socket.

Written by the indexing model from the issue text.

Description

I'm using an external mariadb and trying to mount its socket file into docker.
I found there is a database_socket parameter in https://doc.wallabag.org/en/admin/parameters.html#database-parameters.
But when I try to add environment: SYMFONY__ENV__DATABASE_SOCKET=/var/run/mysqld/mysqld.sock, the container just stucks in Waiting for database ... which refers to https://github.com/wallabag/docker/blob/41430135535d5ee5a7fc1fbbda90323331827eb5/root/entrypoint.sh#L32-L34 and https://github.com/wallabag/docker/blob/41430135535d5ee5a7fc1fbbda90323331827eb5/root/entrypoint.sh#L10-L17.
It seems that the container will always wait for DATABASE_HOST@DATABASE_PORT even if we provide a DATABASE_SOCKET?
I tried to delete that wait_for_database, which results in SQLSTATE[HY000] [2002] Connection refused:

wallabag  | Starting wallabag ...
wallabag  | Installing dependencies from lock file
wallabag  | Verifying lock file contents can be installed on current platform.
wallabag  | Nothing to install, update or remove
wallabag  | Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/compiler is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/consistency is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/event is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/exception is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/file is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/iterator is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/math is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/protocol is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/regex is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/ruler is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/stream is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/ustring is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/visitor is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package hoa/zformat is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package lexik/form-filter-bundle is abandoned, you should avoid using it. Use spiriitlabs/form-filter-bundle instead.
wallabag  | Package php-http/guzzle5-adapter is abandoned, you should avoid using it. Use php-http/guzzle7-adapter instead.
wallabag  | Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
wallabag  | Package scheb/2fa-qr-code is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
wallabag  | Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
wallabag  | Package symfony/inflector is abandoned, you should avoid using it. Use EnglishInflector from the String component instead.
wallabag  | Package true/punycode is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package wallabag/php-mobi is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package php-cs-fixer/diff is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Package symfony/web-server-bundle is abandoned, you should avoid using it. No replacement was suggested.
wallabag  | Generating optimized autoload files
wallabag  | Class SimpleHtmlDom\simple_html_dom_node located in ./vendor/mgargano/simplehtmldom/src/simple_html_dom.php does not comply with psr-0 autoloading standard. Skipping.
wallabag  | Class SimpleHtmlDom\simple_html_dom located in ./vendor/mgargano/simplehtmldom/src/simple_html_dom.php does not comply with psr-0 autoloading standard. Skipping.
wallabag  | 100 packages you are using are looking for funding.
wallabag  | Use the `composer fund` command to find out more!
wallabag  | > Incenteev\ParameterHandler\ScriptHandler::buildParameters
wallabag  | Updating the "app/config/parameters.yml" file
wallabag  | > bin/console cache:clear --no-warmup
wallabag  | 
wallabag  | In ExceptionConverter.php line 101:
wallabag  |                                                                                
wallabag  |   An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refu  
wallabag  |   sed                                                                          
wallabag  |                                                                                
wallabag  | 
wallabag  | In Exception.php line 28:
wallabag  |                                              
wallabag  |   SQLSTATE[HY000] [2002] Connection refused  
wallabag  |                                              
wallabag  | 
wallabag  | In Driver.php line 34:
wallabag  |                                              
wallabag  |   SQLSTATE[HY000] [2002] Connection refused  
wallabag  |                                              
wallabag  | 
wallabag  | Script bin/console cache:clear --no-warmup handling the post-cmd event returned with error code 255
wallabag  | Script @post-cmd was called via post-install-cmd
wallabag exited with code 0

Here's the socket file:

# ls -l /var/run/mysqld/mysqld.sock 
srwxrwxrwx 1 mysql mysql 0 Jun  7 15:41 /var/run/mysqld/mysqld.sock

I'm not familiar with php or pdo, how can I fix that?

I'm using docker compose with image ghcr.io/wallabag/docker:2.6.9:

services:
  wallabag:
    image: ghcr.io/wallabag/docker:latest
    environment:
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
      - SYMFONY__ENV__DATABASE_NAME=wallabag
      - SYMFONY__ENV__DATABASE_USER=wallabag
      - SYMFONY__ENV__DATABASE_PASSWORD=...
      - SYMFONY__ENV__DATABASE_SOCKET=/var/run/mysqld/mysqld.sock
      - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
      - SYMFONY__ENV__DATABASE_TABLE_PREFIX="wallabag_"
    volumes:
      - /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock:rwx
Dominant language
Shell
Stars
771
Forks
168
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wallabag/docker

All issues in wallabag/docker

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.