Db Errors After Server Migration

imno007

Well-known member
Okay, I recently moved to a new server (Litespeed/CyberPanel) and I'm seeing errors like those below a few times throughout the day. It seems to be completely random, happening when clicking whatever, even once during log-in to the site and once or twice when navigating the admin, and it's resolved by just refreshing the page once or twice. I'm an idiot when it comes to this stuff, so some ideas on a likely culprit would be appreciated.

An exception occurred: [XF\Db\Exception] MySQL statement prepare error [2006]: MySQL server has gone away in src/XF/Db/AbstractStatement.php on line 212 XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196 XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39 XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54 XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79 XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1163 XF\Mvc\Entity\Finder->fetch() in src/XF/Mvc/Entity/Manager.php at line 212 XF\Mvc\Entity\Manager->findByIds() in src/XF/Navigation/NodeType.php at line 192 XF\Navigation\NodeType::loadPendingNodeData() in src/XF/Navigation/NodeType.php at line 113 XF\Navigation\NodeType::displayNodeExtended() in src/XF/Navigation/NodeType.php at line 152 XF\Navigation\NodeType::displayNode() in internal_data/code_cache/navigation_cache.php at line 607 XF\Pub\App->{closure}() in src/XF/Template/Templater.php at line 5768 XF\Template\Templater->renderNavigationClosure() in src/XF/Pub/App.php at line 475 XF\Pub\App->getNavigation() in src/XF/Pub/App.php at line 428 XF\Pub\App->renderPageHtml() in src/XF/App.php at line 1769 XF\App->renderPage() in src/XF/Mvc/Dispatcher.php at line 310 XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 44 XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1934 XF\App->run() in src/XF.php at line 333 XF::runApp() in index.php at line 13

and

An exception occurred: [XF\Db\Exception] Connection refused in src/XF/Db/Mysqli/Adapter.php on line 160 XF\Db\Mysqli\Adapter->makeConnection() in src/XF/Db/Mysqli/Adapter.php at line 28 XF\Db\Mysqli\Adapter->getConnection() in src/XF/Db/AbstractAdapter.php at line 51 XF\Db\AbstractAdapter->connect() in src/XF/Db/AbstractAdapter.php at line 73 XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 91 XF\Db\AbstractAdapter->fetchOne() in src/XF/Session/DbStorage.php at line 30 XF\Session\DbStorage->getSession() in src/XF/Session/Session.php at line 53 XF\Session\Session->start() in src/XF/App.php at line 672 XF\App->XF\{closure}() in src/XF/Container.php at line 28 XF\Container->offsetGet() in src/XF/Pub/App.php at line 39 XF\Pub\App->XF\Pub\{closure}() in src/XF/Container.php at line 28 XF\Container->offsetGet() in src/XF/App.php at line 2253 XF\App->session() in src/XF/Pub/App.php at line 91 XF\Pub\App->start() in src/XF/App.php at line 1930 XF\App->run() in src/XF.php at line 333 XF::runApp() in index.php at line 13
 
MySQL server has gone away in src/XF/Db/AbstractStatement.php on line 212

That error is usually caused by one of these MySQL settings being exceeded:

wait_timeout
max_allowed_packet

Your host needs to increase these settings in MySQL. There is more info here:

http://dev.mysql.com/doc/refman/5.1/en/gone-away.html

An exception occurred: [XF\Db\Exception] Connection refused in src/XF/Db/Mysqli/Adapter.php on line 160

This is happening when XF is trying to connect to your MySQL server. Have your host check the MySQL server and you can check your config file to ensure it contains the proper contents.
 
Could it be the result of them reducing the TTL for my domain to 3600 to make the migration quicker, and then forgot to increase it again? Just went back in this very long support thread and saw that, which I had forgot along the way. In any case, they're moving me to a more beefed up server, so I'll let that happen first before pursuing this any more. Thanks for the response, much appreciated. 👍
 
Although.... you reminded me of something else, another issue since migrating. I edited SessionActivity.php a long time ago to keep showing Members Online for 48 hours, but now users are constantly disappearing from Member online, even though I haven't made any changes to any XF files. They're not getting logged out, just not showing as active, and it seems to be random. One minute I'll see 80 members online, then it's reset to maybe only two or three members. It might not change for hours or it might get reset after 10 minutes or half an hour or whatever. Any clue what that would be about?
 
Can't help you there, unfortunately. I'm not sure what might be causing that, though all the sessions are stored in the database. If the database is having issues, I can only assume could do something funky with that list. But I don't know any specifics.
 
Thanks. I guess I'll see what I see after the next migration is completed tomorrow. Hopefully that problem will be magically fixed.
 
Top Bottom