XF 2.1 HTTP 500 Error

Shane Greer

Active member
Just wondering if someone has any ideas how to help. Basically my forums have been stable for years but yesterday I went in and changed some user permissions for forum access on a few members and now my website is crashing constantly with HTTP 500 errors... can this in any way be related?

Thanks

Shane
 

webbouk

Well-known member
Have you tried changing them back just to see if it makes a difference?

It could be just coincidental.
Has the server been updated at all?
 

Shane Greer

Active member
I cant get it due it to continually crashes... it lets me in but then crashes. Its like it is intermittent... so I get in am able to disable all add ons and themes then it crashes and I get back in again etc. Currently trying to reinstall forum software.

The rest of my hosting is fine.. its a xenforo error not site wide so I presume it has to be a problem on my end.
 

Shane Greer

Active member
Hmmm I reinstalled the software and am now getting this when I try to run the install upgrade.


XF\Db\Exception: Too many connections in src/XF/Db/Mysqli/Adapter.php at line 165
  1. XF\Db\Mysqli\Adapter->makeConnection() in src/XF/Db/Mysqli/Adapter.php at line 28
  2. XF\Db\Mysqli\Adapter->getConnection() in src/XF/Db/AbstractAdapter.php at line 60
  3. XF\Db\AbstractAdapter->connect() in src/XF/Db/AbstractAdapter.php at line 83
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 150
  5. XF\Db\AbstractAdapter->fetchOne() in src/XF/Session/DbStorage.php at line 30
  6. XF\Session\DbStorage->getSession() in src/XF/Session/Session.php at line 53
  7. XF\Session\Session->start() in src/XF/App.php at line 882
  8. XF\App->XF\{closure}() in src/XF/Container.php at line 28
  9. XF\Container->offsetGet() in src/XF/Install/App.php at line 38
  10. XF\Install\App->XF\Install\{closure}() in src/XF/Container.php at line 28
  11. XF\Container->offsetGet() in src/XF/App.php at line 2518
  12. XF\App->session() in src/XF/Install/App.php at line 176
  13. XF\Install\App->setupUpgradeSession() in src/XF/Install/Controller/Upgrade.php at line 20
  14. XF\Install\Controller\Upgrade->preDispatchController() in src/XF/Install/Controller/AbstractController.php at line 11
  15. XF\Install\Controller\AbstractController->preDispatchType() in src/XF/Mvc/Controller.php at line 123
  16. XF\Mvc\Controller->preDispatch() in src/XF/Mvc/Dispatcher.php at line 349
  17. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  18. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  19. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  20. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2190
  21. XF\App->run() in src/XF.php at line 391
  22. XF::runApp() in install/index.php at line 14
 

Shane Greer

Active member
Ok so I got into the install bit... got this...

You are already running the current version (2.1.10 Patch 2). To do a fresh install, click here.

When I click rebuild master data I get this error.


XF\Db\Exception: Too many connections in src/XF/Db/Mysqli/Adapter.php at line 165
  1. XF\Db\Mysqli\Adapter->makeConnection() in src/XF/Db/Mysqli/Adapter.php at line 28
  2. XF\Db\Mysqli\Adapter->getConnection() in src/XF/Db/AbstractAdapter.php at line 60
  3. XF\Db\AbstractAdapter->connect() in src/XF/Db/AbstractAdapter.php at line 83
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 150
  5. XF\Db\AbstractAdapter->fetchOne() in src/XF/Session/DbStorage.php at line 30
  6. XF\Session\DbStorage->getSession() in src/XF/Session/Session.php at line 53
  7. XF\Session\Session->start() in src/XF/App.php at line 882
  8. XF\App->XF\{closure}() in src/XF/Container.php at line 28
  9. XF\Container->offsetGet() in src/XF/Install/App.php at line 38
  10. XF\Install\App->XF\Install\{closure}() in src/XF/Container.php at line 28
  11. XF\Container->offsetGet() in src/XF/App.php at line 2518
  12. XF\App->session() in src/XF/Install/App.php at line 176
  13. XF\Install\App->setupUpgradeSession() in src/XF/Install/Controller/Upgrade.php at line 20
  14. XF\Install\Controller\Upgrade->preDispatchController() in src/XF/Install/Controller/AbstractController.php at line 11
  15. XF\Install\Controller\AbstractController->preDispatchType() in src/XF/Mvc/Controller.php at line 123
  16. XF\Mvc\Controller->preDispatch() in src/XF/Mvc/Dispatcher.php at line 349
  17. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  18. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  19. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  20. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2190
  21. XF\App->run() in src/XF.php at line 391
  22. XF::runApp() in install/index.php at line 14
 

Shane Greer

Active member
ok so got past that bit and back into the admin section.

Loads of errors... just checked the top one.


  • XF\Db\Exception: Too many connections
  • src/XF/Db/Mysqli/Adapter.php:165
  • Generated by: Unknown account
  • Sep 6, 2020 at 8:51 AM

Stack trace​

#0 src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection()
#2 src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect()
#3 src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('addOnsComposer')
#4 src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('addOnsComposer')
#5 src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array)
#6 src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array)
#7 src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array)
#8 src/XF/App.php(1656): XF\DataRegistry->offsetGet('addOnsComposer')
#9 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#10 src/XF/App.php(2170): XF\Container->offsetGet('addon.composer')
#11 src/XF/App.php(1755): XF\App->setupAddOnComposerAutoload()
#12 src/XF/Pub/App.php(89): XF\App->setup(Array)
#13 src/XF.php(364): XF\Pub\App->setup(Array)
#14 src/XF.php(387): XF::setupApp('XF\\Pub\\App')
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state​

array(4) {
["url"] => string(174) "/thefgmforum/index.php?shoutbox/refresh&last_id=1690&_xfRequestUri=%2Fthefgmforum%2F&_xfWithData=1&_xfToken=1599371571%2C98b856cb87b76d18e9ba5fbdc686522e&_xfResponseType=json"
["referrer"] => string(42) "https://www.thefewgoodmen.com/thefgmforum/"
["_GET"] => array(6) {
["shoutbox/refresh"] => string(0) ""
["last_id"] => string(4) "1690"
["_xfRequestUri"] => string(13) "/thefgmforum/"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(43) "1599371571,98b856cb87b76d18e9ba5fbdc686522e"
["_xfResponseType"] => string(4) "json"
}
["_POST"] => array(0) {
}
}

https://www.thefewgoodmen.com/thefgmforum/admin.php?logs/server-errors/173/delete
 

Shane Greer

Active member
Right... so I get the error 500... I continually pres refresh and once in ever 20 refreshes it lets me in... am I causing the overload on calls to the db?

Should I just walk away from it for an hour. :)
 

webbouk

Well-known member
You've got something running that isn't closing the db connection when it's finished. Instead it's looping and opening up other connections and so on.

Quick fix but not ideal is to restart the server as that would stop whatever is running and causing the max out
 

webbouk

Well-known member
I'd be more inclined to think it's something to do with this:

but yesterday I went in and changed some user permissions for forum access on a few members
and an issue with an upgrade that uses permissions which isn't closing down the connection once the changes were made ......

....but that's just a stab in the dark

Try turning off all add-ons, replicate the previous change, and see what happens.
If it works as it should, re-enable the non-permission based add-ons, and repeat.
If all's still good, re-enable permission based add-ons one at a time checking for errors - trial and error (excuse the pun)
 

duderuud

Well-known member
If you keep getting "too many connections" errors you want to increase the value "max_connections" in the MySQL config file (my.cnf).
If your host doesn't allow that..you may need to change hosts.
 
Top