Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

  • #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.

  • #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


    • #4
      Originally posted by Wayne Luke View Post
      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

      • NumNum
        NumNum commented
        Editing a comment
        I'll look for that. Thank You.

    • #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 NumNum; Mon 25 Feb '19, 11: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


      • #6
        https://forum.vbulletin.com/forum/vb...80#post4427280

        Comment


        • #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, 10:48am.

          Comment


          • #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

            TalkNewsUK - My vBulletin 5.6.3 Demo
            AdminAmmo - My Cloud Demo

            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.

          • #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...
            X