Masses of server errors on two forums

Alvin63

Well-known member
No idea what's going on here. I just had pages of server errors on both forums

Some are
  • ErrorException: Template error: [E_USER_WARNING] Method canViewResources is not callable on the given object (XF\Entity\User)
Others are

  • XF\Db\Exception: User xxxxxxxxxxx already has more than 'max_user_connections' active connections
  • src/XF/Db/Mysqli/Adapter.php:172
155 pages of errors on one forum, and 22 pages of errors on the other forum. Neither would exceed the number of users.

I use Hostinger and their article says this

"
If you get a “User already has more than 'max_user_connections' active connections“ error message or similar, it means that your script is creating more user connections to the database than your hosting plan allows.

There are two main reasons behind this error:
 
I am getting those periodically, too. Seems to relate to my add-ons. There was a burst of them on Thursday and it seemed to relate to Moderator Panel and Who Replied in this case. At least those were what were erroring. Thought it might relate to 2.3.6 but I did the update on Feb. 13 and the first instance of these errors was Feb. 8 so kind of rules that out.

Install any new addons lately or change usergroup permissions?
No updates other than 2.3.5 and 2.3.6 on my site so far this year.
 
Server Error Log from one of them:

Code:
Server error log

    XF\Db\Exception: User wonderca_adm already has more than 'max_user_connections' active connections src/XF/Db/Mysqli/Adapter.php:172

    Generated by: Unknown account Feb 20, 2025 at 11:47 AM

Stack trace

#0 src/XF/Db/Mysqli/Adapter.php(31): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 src/XF/Db/AbstractAdapter.php(62): XF\Db\Mysqli\Adapter->getConnection()
#2 src/XF/Db/Mysqli/Adapter.php(116): XF\Db\AbstractAdapter->connect()
#3 src/XF/Db/AbstractAdapter.php(518): XF\Db\Mysqli\Adapter->escapeString('addOnsComposer')
#4 src/XF/Db/AbstractAdapter.php(496): XF\Db\AbstractAdapter->quote('addOnsComposer')
#5 src/XF/DataRegistry.php(172): XF\Db\AbstractAdapter->quote(Array)
#6 src/XF/DataRegistry.php(102): XF\DataRegistry->readFromDb(Array, Array)
#7 src/XF/DataRegistry.php(271): XF\DataRegistry->get(Array)
#8 src/XF/App.php(2178): XF\DataRegistry->offsetGet('addOnsComposer')
#9 src/XF/Container.php(33): XF\App->XF\{closure}(Object(XF\Container))
#10 src/XF/App.php(2799): XF\Container->offsetGet('addon.composer')
#11 src/XF/App.php(2276): XF\App->setupAddOnComposerAutoload()
#12 src/XF/Pub/App.php(116): XF\App->setup(Array)
#13 src/XF.php(779): XF\Pub\App->setup(Array)
#14 src/XF.php(802): XF::setupApp('XF\\Pub\\App')
#15 index.php(23): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state

array(4) {
  ["url"] => string(81) "/threads/guaranteed-liveable-income-whats-happening-in-your-area.8247/post-455951"
  ["referrer"] => string(107) "https://www.wondercafe2.ca/threads/guaranteed-liveable-income-whats-happening-in-your-area.8247/post-455951"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
And then there's the ones like this that are what make me suspect add-ons are somehow involved. These are add-ons that I've had in place for quite a while, though, not new ones:

Code:
Server error log

    ErrorException: Template error: [E_USER_WARNING] Method canViewModeratorPanel is not callable on the given object (XF\Entity\User) src/XF/Template/Templater.php:1277

    Generated by: Unknown account Feb 20, 2025 at 11:47 AM

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/wonderca/...', 1277)
#1 src/XF/Template/Templater.php(1277): trigger_error('Method canViewM...', 512)
#2 internal_data/code_cache/templates/l1/s7/public/andrew_moderatorpanel_macros.php(269): XF\Template\Templater->method(Object(XF\Entity\User), 'canViewModerato...', Array)
#3 src/XF/Template/Templater.php(921): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#4 internal_data/code_cache/templates/l1/s7/public/PAGE_CONTAINER.php(1672): XF\Template\Templater->callMacro('andrew_moderato...', 'andrew_moderato...', Array, Array)
#5 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#6 src/XF/Pub/App.php(621): XF\Template\Templater->renderTemplate('PAGE_CONTAINER', Array)
#7 src/XF/App.php(2573): XF\Pub\App->renderPageHtml('
    





    



    <...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(414): XF\App->renderPage('
    





    



    <...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#9 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#11 src/XF.php(806): XF\App->run()
#12 index.php(23): XF::runApp('XF\\Pub\\App')
#13 {main}

Request state

array(4) {
  ["url"] => string(22) "/posts/18638/reactions"
  ["referrer"] => string(48) "https://www.wondercafe2.ca/posts/18638/reactions"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
So I disabled the add-ons that seemed to be generating the errors. Immediately got another run of the template errors (the second one I posted) that was perfectly timed to be caused by me disabling them. Will now monitor to see if having those add-ons "off" helps.
 
Install any new addons lately or change usergroup permissions?
Nope. The only thing I've done recently is start using Cloudflare Turnstile instead of H Captcha. Both forums are on XF 2.3.4 - I delayed upgrading for a while. 2.3.6 is showing as available. I don't have that many addons and those are ones I've used for a long time. Two of which are Bob's AMS and resource manager.
 
In my case, I seem to be a couple point releases behind on @AndrewSimm's Moderator Panel so going to try upgrading that since the Template errors all seem to relate to it.

EDIT: Did the upgrade and disabling the add-on still triggers the errors. Keeping it disabled for now to see if that rectifies things.
 
Last edited:
So you're having the same issue Mendalla? Have you found a solution? Some of my errors are different to yours though. The Hostinger article mentions doing something with mysql?
 
So you're having the same issue Mendalla? Have you found a solution? Some of my errors are different to yours though. The Hostinger article mentions doing something with mysql?
Well, one of the errors is about exceeding max connections to the db so there does seem to be a db issue, but I am not sure if that is cause or effect. It could an effect of the template error with the add-ons, which is the other bunch of errors. Are you on shared hosting or running your own server? I am shared. So far, it does not seem to be having any visible effects for users. I do have one user reporting a weird posting issue but I am not sure yet how I would link that to the server errors other than wading through them to see if any coincide with her problems. There's 405 pages, most from this past Thursday.
 
The one that seems to be the source of the template errors I have named above. Some look like they might relate to @Xon's Who Replied but not as sure. It is weird. Beside those I have a fairly long list of free add-ons, no paid ones. I will have to grab a list later.
 
The one that seems to be the source of the template errors I have named above. Some look like they might relate to @Xon's Who Replied but not as sure. It is weird. Beside those I have a fairly long list of free add-ons, no paid ones. I will have to grab a list later.
I don't have any by Xon.
 
Nope. I just have Bob's AMS home page, Resource Manager, a few of Andy's addons, a couple by Ozzmodz and one from Wutime. Had them all a long time. The odd one did relate to converting post to AMS though, which is strange as I haven't converted any posts to AMS. Might need to check if there's an AMS update.
 
Nope. I just have Bob's AMS home page, Resource Manager, a few of Andy's addons, a couple by Ozzmodz and one from Wutime. Had them all a long time. The odd one did relate to converting post to AMS though, which is strange as I haven't converted any posts to AMS. Might need to check if there's an AMS update.

Maybe disable listeners and see how you fair.
 
Checked all my addons are up to date, which they are. My third forum didn't get any server errors. It's virtually dead so maybe it is to do with the number of users.
 
Back
Top Bottom