1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Troubleshooting and Problems' started by sforum, Oct 5, 2015.

  1. sforum

    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. :)
     
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
    sforum likes this.
  3. sforum

    sforum Active Member

    Thanks; I've logged a ticket with my host to see if I can get this setting changed.
     
  4. sforum

    sforum Active Member

    My host has replied:

    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.
     
  5. Mike

    Mike XenForo Developer Staff Member

    How long does it take until this error happens? Is it over 120 seconds?
     
  6. sforum

    sforum Active Member

    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.
     
  7. Mike

    Mike XenForo Developer Staff Member

    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?
     
  8. sforum

    sforum Active Member

    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.".
     
  9. Mike

    Mike XenForo Developer Staff Member

    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.)
     
    sforum likes this.
  10. sforum

    sforum Active Member

    My host replied saying:

    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 :)
     
    Mike likes this.

Share This Page