MySQL Error : MySQL server has gone away Error Number : 2006

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Craig
    Senior Member
    • Jan 2008
    • 998
    • 6.X

    MySQL Error : MySQL server has gone away Error Number : 2006

    I've seen this a few times in the last 2 months. I've restarted the db, but has since returned.

    Thoughts?


    Invalid SQL:
    /** saveDbCache */ SELECT * FROM vb3cacheevent WHERE cacheid IN ('node_494069_lvl1data');

    MySQL Error : MySQL server has gone away
    Error Number : 2006
    Request Date : Monday, February 18th 2019 @ 04:30:48 AM
    Error Date : Monday, February 18th 2019 @ 04:35:49 AM
    Script : https://www.adkhighpeaks.com/forums/...etch?id=494069
    Referrer :
    IP Address : 141.8.143.168
    Username : Guest
    Classname : vB_Database_MySQLi
    MySQL Version :


    Stack Trace:
    #0 vB_Database->getErrorData() called in [path]/vb/database.php on line 1188
    #1 vB_Database->halt() called in [path]/vb/database/mysqli.php on line 201
    #2 vB_Database_MySQLi->execute_query() called in [path]/vb/database.php on line 557
    #3 vB_Database->query_read() called in [path]/vb/db/mysql/querydefs.php on line 7179
    #4 vB_dB_MYSQL_QueryDefs->saveDbCache() called in [path]/vb/db/query/method.php on line 175
    #5 vB_dB_Query_Method->execSQL() called in [path]/vb/db/assertor.php on line 304
    #6 vB_dB_Assertor->assertQuery() called in [path]/vb/cache/db.php on line 390
    #7 vB_Cache_Db->shutdown() called in [path]/vb/vb.php on line 481
    #8 vB::shutdown() called in on line
    adktramping ~ my happy place.

    "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

    Vote for your favorite feature requests and the bugs you want to see fixed.
  • In Omnibus
    Senior Member
    • Apr 2010
    • 2310

    #2
    I think your server ran out of memory.

    Comment


    • In Omnibus
      In Omnibus commented
      Editing a comment
      I should add the image opened perfectly well for me and took less than one second to do so.
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74129

    #3
    If you had run out of memory, you would get different errors. This error specifically means that MySQL closed the connection before it returned a result. It could be because the query took too long to complete based on the wait_timeout specified in its configuration files. We recommend at least an 120 second wait_timeout. The default is 28800 seconds or 8 hours. It could also be that the query is too large to return to PHP.

    To resolve the issue immediately, I recommend running these queries:
    Code:
    truncate table cache;
    truncate table cacheevents;
    Depending on your server setup, you may have to run these periodically. You don't need to restart the server.



    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • Craig
      Senior Member
      • Jan 2008
      • 998
      • 6.X

      #4
      Originally posted by Wayne Luke
      Depending on your server setup, you may have to run these periodically. You don't need to restart the server.
      Could/would this be a cron job?

      adktramping ~ my happy place.

      "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

      Vote for your favorite feature requests and the bugs you want to see fixed.

      Comment


      • In Omnibus
        In Omnibus commented
        Editing a comment
        Joe released something for this as a cron job on vBulletin.org

      • Craig
        Craig commented
        Editing a comment
        I'll look for that. Thank You.
    • Craig
      Senior Member
      • Jan 2008
      • 998
      • 6.X

      #5
      The interesting thing is the wait_timeout variable was set to 300 seconds, and not the recommended 28800. I have requested the threshold be changed.
      Last edited by Craig; Mon 25 Feb '19, 10:22am.
      adktramping ~ my happy place.

      "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

      Vote for your favorite feature requests and the bugs you want to see fixed.

      Comment

      • Maltair
        Senior Member
        • Feb 2009
        • 575
        • 5.7.5

        #6
        I wasn't getting any database errors then we turned PHP-FM off and the errors started pouring in. However, we had to turn PHP-FM off to address a different issue and I never had it on at my prior server. I realize you always say this is a server problem, but I am on a new server at Liquid Web with now 8Gb (versus 2Gb before)

        Comment

        • elektro-kot
          Member
          • May 2019
          • 94
          • 5.7.X

          #7
          Hello. I have a question about the same MySQL error - 2006. In my case, this happens once a day, during a backup. I have a daily backup, it is performed automatically without shutting down the site and stopping MySQL, this is the built-in utility ISPmanager 5. I followed the recommendations from Wayne's post, but this does not solve the problem. Is there anything else I could check?


          PHP Code:
          Database error in vBulletin 5.6.2:

                     
          Invalid SQL:
          SELECT FROM cache
          WHERE 
          `cacheidIN ('vbPre_conversation929.929.455680.39355');

                     
          MySQL Error   MySQL server has gone away
                     Error Number  
          2006
                     Request Date  
          FridayAugust 28th 2020 04:37:09 AM
                     Error Date    
          FridayAugust 28th 2020 04:40:00 AM
                     Script        
          https://xxx/forum/%D0%BE%D...1%3F%3Fp=39537
                     
          Referrer      :
                     
          IP Address    5.9.32.222
                     Username      
          Гость
                     Classname     
          vB_Database_MySQLi
                     MySQL Version 
          :


          Stack Trace:
          #0 vB_Database->getErrorData() called in phar://[path]/vb/vb.phar/database.php on line 1207
          #1 vB_Database->halt() called in phar://[path]/vb/vb.phar/database/mysqli.php on line 249
          #2 vB_Database_MySQLi->execute_query() called in phar://[path]/vb/vb.phar/database.php on line 576
          #3 vB_Database->query_read() called in phar://[path]/vb/vb.phar/db/result.php on line 144
          #4 vB_dB_Result->rewind() called in phar://[path]/vb/vb.phar/db/result.php on line 68
          #5 vB_dB_Result->__construct() called in phar://[path]/vb/vb.phar/db/query/select.php on line 121
          #6 vB_dB_Query_Select->doSelect() called in phar://[path]/vb/vb.phar/db/query/select.php on line 98
          #7 vB_dB_Query_Select->execSQL() called in phar://[path]/vb/vb.phar/db/assertor.php on line 293
          #8 vB_dB_Assertor->assertQuery() called in phar://[path]/vb/vb.phar/cache/db.php on line 154
          #9 vB_Cache_Db->readCacheArray() called in phar://[path]/vb/vb.phar/cache.php on line 761
          #10 vB_Cache->read() called in phar://[path]/vb/vb.phar/library/page.php on line 40
          #11 vB_Library_Page->preload() called in phar://[path]/vb/vb.phar/api/page.php on line 1415
          #12 vB_Api_Page->preload() called in phar://[path]/vb/vb.phar/api/wrapper.php on line 201
          #13 vB_Api_Wrapper->__call() called in /var/www/xxx/data/www/xxx/includes/api/interface/collapsed.php on line 105
          #14 Api_Interface_Collapsed->callApi() called in /var/www/xxx/data/www/xxx/includes/vb5/frontend/controller/page.php on line 82
          #15 vB5_Frontend_Controller_Page->index() called in /var/www/xxx/data/www/xxx/index.php on line 74 
          Last edited by elektro-kot; Fri 28 Aug '20, 9:48am.

          Comment

          • Mark.B
            vBulletin Support
            • Feb 2004
            • 24287
            • 6.0.X

            #8
            This is something you would need to speak to your host about as it is a server issue.

            If it's during backup then there are probably insufficient resources to run the site and execute the backup at the same time. Depending on your host you may find there is no way round this with the resources you have.
            MARK.B
            vBulletin Support
            ------------
            My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
            My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

            Comment


            • elektro-kot
              elektro-kot commented
              Editing a comment
              I have a dedicated server: E3-1225v3 4x3.6 Ghz / 32GB DDR3 / 2x512GB SSD / 1Gbit/s

              There are no problems with resources, there is only one site on this server.

              Ok, thank you anyway., just wanted to make sure that all MySQL parameters that may affect this are checked and set correctly.

              P.S:// It seems strange that this started happening after using the phar version, but it probably doesn't matter.
          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 74129

            #9
            This error basically means that MySQL closed the connection without returning a result to the query. Every query should return a result even if that result is no database rows. The PHAR version is most likely a red herring. There are database changes with every upgrade and there is no code within the PHAR that can be used to backup a MySQL database. However, if the table is locked and vBulletin tries to access it, then you can get conflicts.

            What version of MySQL?

            What is the max_allowed_packet value for MySQL?

            What are the wait_timout and innodb_lock_wait_timeout values?

            What is the command that you're using to create the backup?

            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            Related Topics

            Collapse

            Working...