Freescout – SQLSTATE[HY000] [2002] Connection refused
-
Hello,
in the last few days I’ve been seeing the following error repeatedly in my Freescout app logs:E[HY000] [2002] Connection refused at /app/code/overrides/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:38) [stacktrace] #0 /app/code/overrides/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(42): Doctrine\\DBAL\\Driver\\PDO\\Exception::new() #1 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(64): Doctrine\\DBAL\\Driver\\PDOConnection->__construct() #2 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(97): Illuminate\\Database\\Connectors\\Connector->createPdoConnection() #3 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(46): Illuminate\\Database\\Connectors\\Connector->tryAgainIfCausedByLostConnection() #4 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\\Database\\Connectors\\Connector->createConnection() #5 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\\Database\\Connectors\\MySqlConnector->connect() #6 [internal function]: Illuminate\\Database\\Connectors\\ConnectionFactory->Illuminate\\Database\\Connectors\\{closure}() #7 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func() #8 /app/code/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(248): Illuminate\\Database\\Connection->getPdo() #9 /app/code/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(234): Illuminate\\Database\\DatabaseManager->refreshPdoConnections() #10 /app/code/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(168): Illuminate\\Database\\DatabaseManager->reconnect() #11 [internal function]: Illuminate\\Database\\DatabaseManager->Illuminate\\Database\\{closure}() #12 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): call_user_func() #13 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(767): Illuminate\\Database\\Connection->reconnect() #14 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(616): Illuminate\\Database\\Connection->reconnectIfMissingConnection() #15 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(317): Illuminate\\Database\\Connection->run() #16 /app/code/overrides/laravel/framework/src/Illuminate/Database/Query/Builder.php(1718): Illuminate\\Database\\Connection->select() #17 /app/code/overrides/laravel/framework/src/Illuminate/Database/Query/Builder.php(1704): Illuminate\\Database\\Query\\Builder->runSelect() #18 /app/code/overrides/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(483): Illuminate\\Database\\Query\\Builder->get() #19 /app/code/overrides/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(467): Illuminate\\Database\\Eloquent\\Builder->getModels() #20 /app/code/overrides/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(360): Illuminate\\Database\\Eloquent\\Builder->get() #21 /app/code/app/Module.php(29): Illuminate\\Database\\Eloquent\\Model::all() #22 /app/code/app/Module.php(144): App\\Module::getCached() #23 /app/code/app/Module.php(40): App\\Module::getByAlias() #24 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(231): App\\Module::isActive() #25 /app/code/overrides/laravel/framework/src/Illuminate/Cache/Repository.php(327): Nwidart\\Modules\\Repository->Nwidart\\Modules\\{closure}() #26 /app/code/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(304): Illuminate\\Cache\\Repository->remember() #27 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(224): Illuminate\\Cache\\CacheManager->__call() #28 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(181): Nwidart\\Modules\\Repository->getCached() #29 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(263): Nwidart\\Modules\\Repository->all() #30 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(291): Nwidart\\Modules\\Repository->getByStatus() #31 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(333): Nwidart\\Modules\\Repository->enabled() #32 /app/code/overrides/nwidart/laravel-modules/src/Repository.php(365): Nwidart\\Modules\\Repository->getOrdered() #33 /app/code/vendor/nwidart/laravel-modules/src/Providers/BootstrapServiceProvider.php(22): Nwidart\\Modules\\Repository->register() #34 /app/code/overrides/laravel/framework/src/Illuminate/Foundation/Application.php(590): Nwidart\\Modules\\Providers\\BootstrapServiceProvider->register() #35 /app/code/vendor/nwidart/laravel-modules/src/ModulesServiceProvider.php(38): Illuminate\\Foundation\\Application->register() #36 /app/code/vendor/nwidart/laravel-modules/src/LaravelModulesServiceProvider.php(15): Nwidart\\Modules\\ModulesServiceProvider->registerModules() #37 [internal function]: Nwidart\\Modules\\LaravelModulesServiceProvider->boot() #38 /app/code/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(28): call_user_func_array() #39 /app/code/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #40 /app/code/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(27): Illuminate\\Container\\BoundMethod::callBoundMethod() #41 /app/code/overrides/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\Container\\BoundMethod::call() #42 /app/code/overrides/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\\Container\\Container->call() #43 /app/code/overrides/laravel/framework/src/Illuminate/Foundation/Application.php(779): Illuminate\\Foundation\\Application->bootProvider() #44 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}() #45 /app/code/overrides/laravel/framework/src/Illuminate/Foundation/Application.php(778): array_walk() #46 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() #47 /app/code/overrides/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap() #48 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(296): Illuminate\\Foundation\\Application->bootstrapWith() #49 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(119): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #50 /app/code/artisan(60): Illuminate\\Foundation\\Console\\Kernel->handle() #51 {main} "}Do you know what might be causing this issue?
Thank you very much for any information.
-
Hello @archos
this error statesConnection refusedfor thePDOConnection.phpwhich would mean, when it tries to connect to the database it can't.
Please open your web terminal of the Freescout app and press the MYSQL button on the top and press enter.
You should then be connected to the database.
Please report if there is anything going wrong when doing so. -
Hello @archos
this error statesConnection refusedfor thePDOConnection.phpwhich would mean, when it tries to connect to the database it can't.
Please open your web terminal of the Freescout app and press the MYSQL button on the top and press enter.
You should then be connected to the database.
Please report if there is anything going wrong when doing so.@james said in Freescout – SQLSTATE[HY000] [2002] Connection refused:
Hello @archos
this error states Connection refused for the PDOConnection.php which would mean, when it tries to connect to the database it can't.
Please open your web terminal of the Freescout app and press the MYSQL button on the top and press enter.
You should then be connected to the database.
Please report if there is anything going wrong when doing so.Thank you very much for the quick reply!
I tried running the MySQL command in the terminal and it seems everything is working fine:root@70233011-1d9f-4b7f-abe2-fdf99594b834:/app/code# mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6823475 Server version: 8.0.41-0ubuntu0.24.04.1 (Ubuntu) Copyright (c) 2000, 2025, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>Maybe something was just stuck after an update.
Thanks again for your help!
-
Hello @james
Thanks for the suggestion!
I checked the MySQL service — it has more than enough memory (20 GiB total, only about 40 % used).
So it doesn’t look like a memory issue.
There are no errors or warnings in the MySQL logs so far, so I think it should be fine.
I’ll keep an eye on it for a few days just to be sure.Anyway, thank you very much for your help and your time!