Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Unable to use database_socket in docker

Aperta
#417 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
docker, docker-compose, mariadb, php, shell
Ambito
databases, devops

Direzione di ricerca

Leggi root/entrypoint.sh nelle sezioni collegate a wait_for_database e confronta la relativa gestione dell’ambiente con la configurazione Docker Compose per l’immagine 2.6.9. Riproduci l’avvio utilizzando il socket MariaDB montato e controlla l’output di cache-clear. Il lavoro è completato quando il container si avvia senza attendere un host/porta non utilizzato e si connette correttamente tramite il socket.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Shell
Stelle
771
Fork
168
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wallabag/docker

Tutte le issue di wallabag/docker

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.