XF 1.5 "An exception occurred: Mysqli prepare error" when installing style

sforum

Active member
I just tried to install the Charm style, and got the following error:

Code:
An exception occurred: Mysqli prepare error: MySQL server has gone away in /var/www/vhosts/mydomain.com/httpdocs/dev/library/Zend/Db/Statement/Mysqli.php on line 77

Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
Zend_Db_Adapter_Abstract->query() in XenForo/Model.php at line 219
XenForo_Model->fetchAllKeyed() in XenForo/Model/RoutePrefix.php at line 41
XenForo_Model_RoutePrefix->getPrefixesByRouteType() in XenForo/Model/RoutePrefix.php at line 54
XenForo_Model_RoutePrefix->getPrefixesForRouteCache() in XenForo/Link.php at line 487
XenForo_Link::_loadHandlerInfoForGroup() in XenForo/Link.php at line 404
XenForo_Link::_getPrefixHandler() in XenForo/Link.php at line 370
XenForo_Link::_buildLink() in XenForo/Link.php at line 97
XenForo_Link::buildPublicLink() in XenForo/Dependencies/Admin.php at line 197
XenForo_Dependencies_Admin->getEffectiveContainerParams() in XenForo/FrontController.php at line 635
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /var/www/vhosts/mydomain.com/httpdocs/dev/admin.php at line 13

I assumed it was a problem with the style, so posted in the relevant thread, but the style author has said it is unrelated and asked me to post a new thread here.

Just before I attempted this, I upgraded my forum from 1.4.5 to 1.5.1 with no problems. I then updated the styles Soft Responsive, Soft Responsive Coffee Edition, and Latte - all with no problems.

Attempting to install Charm from scratch, though (as a new style, no parent) gives the above error.

Can anyone help?

Thanks. :)
 
This is more related to the wait_timeout setting you have configured in MySQL. I would recommend setting it no lower than something around 120.
 
This is more related to the wait_timeout setting you have configured in MySQL. I would recommend setting it no lower than something around 120.
My host has replied:

I have configured the wait_timeout value to 120 for you on the server.

Unfortunately, I still get the same error when trying to install the Charm style:

Code:
An exception occurred: Mysqli prepare error: MySQL server has gone away in /var/www/vhosts/mydomain.com/httpdocs/dev/library/Zend/Db/Statement/Mysqli.php on line 77
    1.    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    2.    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    3.    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    4.    Zend_Db_Adapter_Abstract->query() in XenForo/Model.php at line 219
    5.    XenForo_Model->fetchAllKeyed() in XenForo/Model/RoutePrefix.php at line 41
    6.    XenForo_Model_RoutePrefix->getPrefixesByRouteType() in XenForo/Model/RoutePrefix.php at line 54
    7.    XenForo_Model_RoutePrefix->getPrefixesForRouteCache() in XenForo/Link.php at line 487
    8.    XenForo_Link::_loadHandlerInfoForGroup() in XenForo/Link.php at line 404
    9.    XenForo_Link::_getPrefixHandler() in XenForo/Link.php at line 370
    10.    XenForo_Link::_buildLink() in XenForo/Link.php at line 97
    11.    XenForo_Link::buildPublicLink() in XenForo/Dependencies/Admin.php at line 197
    12.    XenForo_Dependencies_Admin->getEffectiveContainerParams() in XenForo/FrontController.php at line 635
    13.    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
    14.    XenForo_FrontController->run() in /var/www/vhosts/mydomain.com/httpdocs/dev/admin.php at line 13

I have been running XenForo since 2011, and have installed many styles, add-ons, and upgrades and have never encountered this error before.

Is there any reasons why Charm is causing this timeout, when I've had no problems in the past? Should I get my host to increase the wait_timeout setting again, and if so what would be an appropriate value?

Tagging @CyberAP here just in case his input is relevant. :)

Thanks.
 
How long does it take until this error happens? Is it over 120 seconds?
D'oh - I never thought about that! No, nowhere near. I just attempted installation again and timed it: 7.2 seconds between hitting the Import button and the above error presenting itself.

As I say, I just updated a couple of other styles, as well as XF itself, all with no problem.
 
Do you know what version of MySQL is in? (Does it happen to be MariaDB?)

It sounds like the MySQL connection was unexpectedly closed (or lost) before this query. This is a query that runs after the import finishes (so it should have finished as expected). There can be various reasons for this: https://dev.mysql.com/doc/refman/5.1/en/gone-away.html It seems unlikely to be wait_timeout, so it may be dying for another reason.

Can you confirm if there are any other errors logged in the server error log?
 
Do you know what version of MySQL is in? (Does it happen to be MariaDB?)

It sounds like the MySQL connection was unexpectedly closed (or lost) before this query. This is a query that runs after the import finishes (so it should have finished as expected). There can be various reasons for this: https://dev.mysql.com/doc/refman/5.1/en/gone-away.html It seems unlikely to be wait_timeout, so it may be dying for another reason.

Can you confirm if there are any other errors logged in the server error log?
My host is @NimbusHosting, who I'm given to understand host a lot of XenForo installations and are quite well regarded.

I'm not sure where to look in my Plesk control panel, but phpMyAdmin says:

Code:
    •    Server: Localhost via UNIX socket
    •    Server type: MySQL
    •    Server version: 5.5.46 - MySQL Community Server (GPL) by Remi
    •    Protocol version: 10
    •    Server charset: UTF-8 Unicode (utf8)

I have just looked under Server Error Log in my XF ACP and it says "No errors have been logged.".
 
I suppose this might be hiding the real error. If you submit a ticket with ACP and FTP access details, we can take it from there. (Please reference this thread and ask for it to be assigned to me.)
 
I suppose this might be hiding the real error. If you submit a ticket with ACP and FTP access details, we can take it from there. (Please reference this thread and ask for it to be assigned to me.)
My host replied saying:

Nimbus Hosting said:
I have increased the max_allowed_packets value in the MySQL configuration on the server to 8M for you. Could you see if it works now?

I just attempted to install Charm again and it worked this time, so I'm not sure what the above means but it seems to have worked!

Thanks for offering to help personally, though, @Mike :)
 
Back
Top Bottom