Closed ChurchCRMBugReport closed 3 years ago
This is often a problem with the saturation of the SQL connection pool (#4522 #5171) which we believe is intermittently triggered by background jobs running when pages load. We're working toward splitting the background jobs out of the UI workflow (see #5231) but that hasn't been implemented yet.
In the meantime, if you check your /path/to/ChurchCRM/logs
log files, you can confirm this hypothesis by looking for entries like this:
MySQL Error: 'User **yourDBuser** already has more than 'max_user_connections' active connections' [] {"url":"/api/background/timerjobs"
I also see the same error. This is my log:
[09-Jan-2021 22:32:09 America/Los_Angeles] Slim Application Error: Type: Error Message: Call to a member function getValue() on null File: /home/nloc/newlifeoasis.org/churchcrm/ChurchCRM/model/ChurchCRM/User.php Line: 316 Trace: #0 /home/nloc/newlifeoasis.org/churchcrm/v2/templates/people/family-view.php(476): ChurchCRM\User->isShowPledges()
we have the same error too. There is no saturation of the SQL connection error.
[21-Jan-2021 00:00:45 America/Vancouver] Slim Application Error: Type: Error Message: Call to a member function getValue() on null File: /home/290143.cloudwaysapps.com/fvhrfkuejp/public_html/ChurchCRM/model/ChurchCRM/User.php Line: 316 Trace: #0 /home/290143.cloudwaysapps.com/fvhrfkuejp/public_html/v2/templates/people/family-view.php(476): ChurchCRM\User->isShowPledges()
View in rendered output by enabling the "displayErrorDetails" setting.
Same here, new install on Centos 7.9.2009, with PHP 7.4 A grep of the logs folder for max_user connections doesn't yield anything, neither a grep of any other php or mysql log shows connection issues.
If there are other logs or specific debugging steps you want me to take, let me know.
[02-Feb-2021 16:44:45 America/New_York] Slim Application Error: Type: Error Message: Call to a member function getValue() on null File: /var/www/crm.hopebaptistclearfield.org/html/churchcrm/ChurchCRM/model/ChurchCRM/User.php Line: 316 Trace: #0 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/v2/templates/people/family-view.php(476): ChurchCRM\User->isShowPledges()
1 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/php-view/src/PhpRenderer.php(203): include('/var/www/crm.ho...')
2 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/php-view/src/PhpRenderer.php(184): Slim\Views\PhpRenderer->protectedIncludeScope()
3 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/php-view/src/PhpRenderer.php(153): Slim\Views\PhpRenderer->fetchTemplate()
4 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/php-view/src/PhpRenderer.php(54): Slim\Views\PhpRenderer->fetch()
5 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/v2/routes/family.php(110): Slim\Views\PhpRenderer->render()
6 [internal function]: viewFamily()
7 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func()
8 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke()
9 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke()
10 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack()
11 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/App.php(503): Slim\Route->run()
12 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/ChurchCRM/Slim/Middleware/VersionMiddleware.php(13): Slim\App->__invoke()
13 [internal function]: ChurchCRM\Slim\Middleware\VersionMiddleware->__invoke()
14 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
15 [internal function]: Slim\DeferredCallable->__invoke()
16 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
17 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/ChurchCRM/Slim/Middleware/AuthMiddleware.php(34): Slim\App->Slim{closure}()
18 [internal function]: ChurchCRM\Slim\Middleware\AuthMiddleware->__invoke()
19 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array()
20 [internal function]: Slim\DeferredCallable->__invoke()
21 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func()
22 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim{closure}()
23 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack()
24 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/vendor/slim/slim/Slim/App.php(297): Slim\App->process()
25 /var/www/crm.hopebaptistclearfield.org/html/churchcrm/v2/index.php(48): Slim\App->run()
26 {main}
View in rendered output by enabling the "displayErrorDetails" setting.
I actually researched this a little- it was flagging on .churchcrm/ChurchCRM/model/ChurchCRM/User.php line 316, which was:
public function isShowPledges() { return $this->getSetting(UserSetting::FINANCE_SHOW_PLEDGES)->getValue() == "true"; }
I went into Admin->Edit General Settings->Enabled Features, and disabled Fiance, and retested, and the error resolved.
I actually researched this a little- it was flagging on .churchcrm/ChurchCRM/model/ChurchCRM/User.php line 316, which was:
public function isShowPledges() { return $this->getSetting(UserSetting::FINANCE_SHOW_PLEDGES)->getValue() == "true"; }
I went into Admin->Edit General Settings->Enabled Features, and disabled Fiance, and retested, and the error resolved.
Thanks, it works for me too!
I resolved the same thing on our production system too (but in reverse - was able to recreate the error if I enabled the Finance module). It shouldn't happen even with the Finance module enable though.
@crossan007 / @DawoudIO - I don't have much time to dig into this right now, but wondering if we should add a check for NULL in here somewhere? Trying to untagle the object model is a little beyond my mental capacity right now but something like this in ChurchCRM/model/ChurchCRM/User.php
:
public function isShowPledges() {
$foo = $this->getSetting(UserSetting::FINANCE_SHOW_PLEDGES)->getValue();
if ($foo is NULL) {
$foo = FALSE;
} else {
$foo = TRUE;
}
return $foo
}
(might need to adapt this, but the logic would need to be placed in other places where unexpected NULLs could cause problems)
Looks like this was a bug due to the refactor of the user settings, unsure why the data was not backfilled, I'll fix this in the next release.
When viewing a Family i get the error
Slim Application Error
It is also showing when saving a family