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

An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, mariadb
Domain
databases, devops

Research direction

Start with the provided docker-compose configuration and the installer entry point referenced in InstallCommand.php line 337. Trace the cache:clear failure through AbstractMySQLDriver.php line 112 and PDOConnection.php line 40, then verify the MariaDB connection settings and rerun the wallabag installer. Done means the database setup and cache-clearing steps complete without the connection-refused error.

Written by the indexing model from the issue text.

Description

Hello.

'm attempting to install a Wallabag Docker container on an Almalinux 8 system that already has a MariaDB 10.5 container running smoothly with other internal network services.

However, I encountered the following error during the installation process.:

FAILED! => {"changed": false, "elapsed": 300, "msg": "Timeout when waiting for mariadb:32768"} 32768 is the exposed port of my Mariadb

f I execute the command sudo docker exec -t wallabag /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction I get the error below:


wallabag installer
==================

Step 1 of 4: Checking system requirements.
------------------------------------------

 ------------------------- -------- ---------------- 
  Checked                   Status   Recommendation  
 ------------------------- -------- ---------------- 
  PDO Driver (pdo_sqlite)   OK!                      
  Database connection       OK!                      
  Database version          OK!                      
  curl_exec                 OK!                      
  curl_multi_init           OK!                      
 ------------------------- -------- ---------------- 

                                                                                                                        
 [OK] Success! Your system can run wallabag properly.                                                                   
                                                                                                                        

Step 2 of 4: Setting up database.
---------------------------------

 Creating schema...
 Clearing the cache...

In InstallCommand.php line 337:
                                                                                                                                                                                                         
  The command "cache:clear" generates some errors:                                                                                                                                                       
                                                                                                                                                                                                         
                                                                                                                                                                                                         
   // Clearing the cache for the prod environment with debug false                                                                                                                                       
                                                                                                                                                                                                         
                                                                                                                                                                                                         
  In AbstractMySQLDriver.php line 112:                                                                                                                                                                   
                                                                                                                                                                                                         
    An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused                                                                                                                           
                                                                                                                                                                                                         
                                                                                                                                                                                                         
  In Exception.php line 18:                                                                                                                                                                              
                                                                                                                                                                                                         
    SQLSTATE[HY000] [2002] Connection refused                                                                                                                                                            
                                                                                                                                                                                                         
                                                                                                                                                                                                         
  In PDOConnection.php line 40:                                                                                                                                                                          
                                                                                                                                                                                                         
    SQLSTATE[HY000] [2002] Connection refused                                                                                                                                                            
                                                                                                                                                                                                         
                                                                                                                                                                                                         
  cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> 

My docker-compose:

 wallabag:
      image: wallabag/wallabag
       container_name: wallabag
       networks:
         - t2_proxy
       security_opt:
         - no-new-privileges:true
       environment:
         - MYSQL_ROOT_PASSWORD=myDBrootpassword #I already have tested, and it works perfectly from localhost or any other IP from my network                                                                                                                                                                                                                   
         - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
         - POPULATE_DATABASE=false
         - SYMFONY__ENV__DATABASE_HOST=mariadb
         - SYMFONY__ENV__DATABASE_PORT=32768
         - SYMFONY__ENV__DATABASE_NAME=wallabag
         - SYMFONY__ENV__DATABASE_USER=wallabag
         - SYMFONY__ENV__DATABASE_PASSWORD=randompassword
         - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
         - SYMFONY__ENV__DATABASE_TABLE_PREFIX="wallabag_"
        - SYMFONY__ENV__MAILER_HOST=127.0.0.1
        - SYMFONY__ENV__MAILER_USER=~
        - SYMFONY__ENV__MAILER_PASSWORD=~
        - [email protected]
        - SYMFONY__ENV__DOMAIN_NAME=https://wallabag.mydom.ain
        - SYMFONY__ENV__SERVER_NAME="Your wallabag instance" 
    ports:
        - 9697:80
      volumes:
          #-${USERDIR}/docker/wallabag/images:/var/www/wallabag/web/assets/images
        - /opt/wallabag/images:/var/www/wallabag/web/assets/images
      healthcheck:
        test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost"]
        interval: 1m
        timeout: 3s

Any idea?

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.