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

"more than 'max_user_connections' active connections error" after update from 1.47 to 1.70 #2906

Closed
riccardofasulo opened this issue Apr 8, 2023 · 3 comments

Comments

@riccardofasulo
Copy link

riccardofasulo commented Apr 8, 2023

Hi,
Hoping you could help me resolve this issue:
issue:
after the update from 1.47 to 1.70, I got this error on the main page.
"Whoops, looks like something went wrong — check logs in /storage/logs"
(I haven't done the updates because I already got this error with 1.47 to 1.60 and just fixed it with a "restore and postpone")

checking the logs:
[2023-04-08 09:43:48] production.ERROR: SQLSTATE[HY000] [1203] User USERDB already has more than 'max_user_connections' active connections {"exception":"[object] (Doctrine\DBAL\Driver\PDO\Exception(code: 1203): SQLSTATE[HY000] [1203] User USERDB already has more than 'max_user_connections' active connections at

Details

[2023-04-08 09:43:48] production.ERROR: SQLSTATE[HY000] [1203] User _USERDB_ already has more than 'max_user_connections' active connections {"exception":"[object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1203): SQLSTATE[HY000] [1203] User _USERDB_ already has more than 'max_user_connections' active connections at /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 1203): SQLSTATE[HY000] [1203] User _USERDB_ already has more than 'max_user_connections' active connections at /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:38) [stacktrace] # 0 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(42): Doctrine\\DBAL\\Driver\\PDO\\Exception::new(Object(PDOException)) # 1 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(64): Doctrine\\DBAL\\Driver\\PDOConnection->__construct('mysql:host=loca...', '_USER_', '_PASSWORD_', Array) # 2 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(43): Illuminate\\Database\\Connectors\\Connector->createPdoConnection('mysql:host=loca...', '_USER_', '_PASSWORD_', Array) # 3 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\\Database\\Connectors\\Connector->createConnection('mysql:host=loca...', Array, Array) # 4 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\\Database\\Connectors\\MySqlConnector->connect(Array) # 5 [internal function]: Illuminate\\Database\\Connectors\\ConnectionFactory->Illuminate\\Database\\Connectors\\{closure}() # 6 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func(Object(Closure)) # 7 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(940): Illuminate\\Database\\Connection->getPdo() # 8 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(399): Illuminate\\Database\\Connection->getReadPdo() # 9 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(325): Illuminate\\Database\\Connection->getPdoForSelect(true) # 10 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('select * from `...', Array) # 11 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\\Database\\Connection->runQueryCallback('select * from `...', Array, Object(Closure)) # 12 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\\Database\\Connection->run('select * from `...', Array, Object(Closure)) # 13 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1719): Illuminate\\Database\\Connection->select('select * from `...', Array, true) # 14 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1704): Illuminate\\Database\\Query\\Builder->runSelect() # 15 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(483): Illuminate\\Database\\Query\\Builder->get(Array) # 16 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(467): Illuminate\\Database\\Eloquent\\Builder->getModels(Array) # 17 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(360): Illuminate\\Database\\Eloquent\\Builder->get(Array) # 18 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/app/Module.php(27): Illuminate\\Database\\Eloquent\\Model::all() # 19 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/app/Module.php(142): App\\Module::getCached() # 20 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/app/Module.php(38): App\\Module::getByAlias('crm') # 21 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Module.php(238): App\\Module::isActive('crm') # 22 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Support/helpers.php(1148): Nwidart\\Modules\\Module->Nwidart\\Modules\\{closure}() # 23 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Support/Arr.php(300): value(Object(Closure)) # 24 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Support/helpers.php(157): Illuminate\\Support\\Arr::get(Array, 'module.json', Object(Closure)) # 25 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Module.php(242): array_get(Array, 'module.json', Object(Closure)) # 26 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Module.php(255): Nwidart\\Modules\\Module->json() # 27 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Module.php(121): Nwidart\\Modules\\Module->get('alias') # 28 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(160): Nwidart\\Modules\\Module->getAlias() # 29 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(249): Nwidart\\Modules\\Repository->scan() # 30 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(227): Nwidart\\Modules\\Repository->toCollection() # 31 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/laravel/framework/src/Illuminate/Cache/Repository.php(327): Nwidart\\Modules\\Repository->Nwidart\\Modules\\{closure}() # 32 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(304): Illuminate\\Cache\\Repository->remember('laravel-modules', 60, Object(Closure)) # 33 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(239): Illuminate\\Cache\\CacheManager->__call('remember', Array) # 34 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(181): Nwidart\\Modules\\Repository->getCached() # 35 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(263): Nwidart\\Modules\\Repository->all() # 36 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(291): Nwidart\\Modules\\Repository->getByStatus(1) # 37 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(333): Nwidart\\Modules\\Repository->enabled() # 38 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/nwidart/laravel-modules/src/Repository.php(365): Nwidart\\Modules\\Repository->getOrdered() # 39 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/nwidart/laravel-modules/src/Providers/BootstrapServiceProvider.php(22): Nwidart\\Modules\\Repository->register() # 40 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(586): Nwidart\\Modules\\Providers\\BootstrapServiceProvider->register() # 41 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/nwidart/laravel-modules/src/ModulesServiceProvider.php(38): Illuminate\\Foundation\\Application->register(Object(Nwidart\\Modules\\Providers\\BootstrapServiceProvider)) # 42 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/nwidart/laravel-modules/src/LaravelModulesServiceProvider.php(15): Nwidart\\Modules\\ModulesServiceProvider->registerModules() # 43 [internal function]: Nwidart\\Modules\\LaravelModulesServiceProvider->boot() # 44 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) # 45 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() # 46 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure)) # 47 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/overrides/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL) # 48 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(792): Illuminate\\Container\\Container->call(Array) # 49 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\\Foundation\\Application->bootProvider(Object(Nwidart\\Modules\\LaravelModulesServiceProvider)) # 50 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(Nwidart\\Modules\\LaravelModulesServiceProvider), 22) # 51 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(776): array_walk(Array, Object(Closure)) # 52 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() # 53 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application)) # 54 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(162): Illuminate\\Foundation\\Application->bootstrapWith(Array) # 55 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(146): Illuminate\\Foundation\\Http\\Kernel->bootstrap() # 56 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) # 57 /home3/CPANEL_USER_HOME/SUBDOMAIN.DOMAIN/public/index.php(83): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) # 58 {main} "}

check variable on MySQL

  • SHOW VARIABLES LIKE "max_connections" ==> max_connections = 200
  • SHOW STATUS WHERE variable_name = 'Max_used_connections'; ==> Max_used_connections = 129
  • show status where variable_name = 'Threads_connected'; ==> Threads_connected = 43

some info

  • 3 mailbox
  • 6 users
  • 2 admins
  • php 7.4
  • freescout at v 1.70

active modules:

  • crm -> to latest version
  • customization -> to latest version
  • customsignatures -> to latest version
  • darkmode -> to latest version
  • embedimages -> to latest version
  • extendedattachments -> to latest version
  • imapmove -> still on v 1.0 - got an error on update
  • ljpcalendarmodule -> to latest version
  • mobilenotifications -> to latest version
  • noreply -> to latest version
  • officehours -> to latest version
  • reports -> to latest version
  • ticketnumer -> to latest version

I have done manual update following the step 5 of the guide
https://github.com/freescout-helpdesk/freescout/wiki/Updating-FreeScout#method-5-update-manually
Method 1. Update from web interface (recommended) -> got an error
Method 2. Update using console script -> I'm on shared hosting - no access
Method 3. Update using GIT -> I'm on shared hosting - no access
Method 4. Update via tools.php -> got an error
Method 5. Update manually

already tried
from cpanel switch PHP 7.4 to 8.0
from \tools.php :

  • clear cache with default php path
  • clear cache with 8.0 php path
  • clear cache with 7.4 php path

but after some minutes the error reoccurs.

----------
let me know if there is something else I can do,
I haven't other ideas :(

@NeoMod
Copy link

NeoMod commented Apr 8, 2023

Got the same problem, twice.

The only difference for me was in the number of active modules, which was way less.

Wold love to read more and find a possible solution to what seems like a problem on the side of SQL handling...

@freescout-helpdesk
Copy link
Contributor

Check if you have some extra background processes running using htop or ps aux and kill them if needed: https://github.com/freescout-helpdesk/freescout/wiki/Background-Jobs

@riccardofasulo
Copy link
Author

Hi, I can't follow that tips directly, but I noticed a misconfiguration in (a mix of PHP 8.0 and 7.4):

  • the .httaccess file (the PHP version listed in tag )
  • the one configured on cpanel (with MultiPHP Manager)
  • the one used for the cronjob

The misconfiguration created the extra background processes, reaching the max_user_connection cap.

Now it's working like a charm (and faster than ever before)!

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

3 participants