Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2009
    Posts
    16
    Plugin Contributions
    0

    Default Cart Error: 2006 MySQL server has gone away

    I am getting this error for my zen-cart from time to time:

    2006 MySQL server has gone away

    in:

    [select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from zen_currencies]

    How this can be stopped from happening? I am losing money whenever it happens and only server reboot helps for sometime but within time it happens again.

    My hosting support said: your VPS had hit memory limits causing services to stop responding normally.

    Could the cart cause that? Or what could be the problem for the above error?

    Anyone had this before and/or knows how to fix it?

    Thanks,
    Shavkat
    BestWebForms.com/cart/

  2. #2
    Join Date
    Apr 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Cart Error: 2006 MySQL server has gone away

    Anyone? I really help here...

  3. #3
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cart Error: 2006 MySQL server has gone away

    Assuming you're using Zen Cart v1.3.8a, try replacing your /includes/classes/db/mysql/query_factory.php with the one in the attached zip file.
    Attached Files Attached Files
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Apr 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Cart Error: 2006 MySQL server has gone away

    Thanks for your suggestion. I am using Zen Cart 1.3.7 Database Patch Level: 1.3.7 - amI still safe to do this replace?
    Also, what would be changed with this operation?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cart Error: 2006 MySQL server has gone away

    It should be fine with v1.3.7 too.

    It's really just a bandage to attempt reconnection to the database if it discovers that the connection has been dropped. It does NOT fix the root cause of the problem, which is something your site is experiencing a timeout on (typically while trying to talk to some external resource, but sometimes just related to an overloaded server).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Apr 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Cart Error: 2006 MySQL server has gone away

    Replaced, thanks! Hope it would help to keep the cart active all the time.

  7. #7
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: Cart Error: 2006 MySQL server has gone away

    * What version of Zen Cart are you using? 1.3.8a
    * Has your site been upgraded? When? From what version(s)? since an early version - I believe we did 1.3.8 from scratch
    * What addons have you installed? When? Supertracker
    * If you're encountering problems that could be related to your server or hosting company, include the name of your hosting company (not their URL). LiquidWeb
    * HAVE YOU LOOKED IN THE FAQ AREA for answers to your question? (ie: a search for your error message or what you want to edit/change, etc) yes
    * Have you searched the FORUM for your error message or for answers to the question you're asking? yes, multiple times
    * WHEN did the problem "start"? How does that compare with other events of your hosting company, changes you've made to your site files/addons, or your admin settings, etc? after a server switch - they have made many tweaks to the sql settings to try to fix this

    *********************************** customer note ************************

    Here is the problem the member notified me of:

    2006 MySQL server has gone away
    in:
    [select code, title, symbol_left, symbol_right, decimal_point,
    thousands_point, decimal_places, value from zen_currencies]

    Refresh left the screen hanging for about 40 secnds and then it loaded up!

    **************************************************************************


    How can this query hang? It only returns 2 lines?!

    We have the same problem and cannot find a remedy! This error popped up after a server switch. We moved to a bigger, better server.

    I have repaired and optimized tables...
    Tweaks have been made to the default server sql settings...
    I have compared indexes...
    I am running the query factory in this thread, too...


    Please help!

  8. #8
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cart Error: 2006 MySQL server has gone away

    The problem is not with the query it mentions. The one it mentions is the one it's attempting to run AFTER the database connection has died. The dying connection happens as a result of something *else* happening (*before* that attempted query), which takes too long to execute and the connection dies as a result of the server database configuration settings (controlled by your hosting company).
    The most common cause would be something like trying to get a shipping quote from USPS when their servers are slow or having maintenance. Your site sits and waits for USPS to respond, and when they don't, it finally times out and goes on to the next thing it would normally do to draw the current page; but, since too much time has elapsed and the database connection has died, it can't proceed, thus the error you're seeing. Sometimes the db connection is killed by your hosting company itself, sometimes even by a watchdog process running on the server which kills connections it thinks are dead, perhaps wrongfully.

    There are lots of theories on patching the code for workarounds, including enforcing particular timeouts in the calls to external servers in order to minimize the likelihood of the problem manifesting.
    It was a good idea to move to a bigger, better server. But maybe there's something wrong in their firewalls or connections to "outside" which might be limiting your site's ability to operate properly, instead forcing it to wait more than it used to? Just an idea.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Pls help! Cart Error: 2006 MySQL server has gone away
    By Lara2911 in forum General Questions
    Replies: 4
    Last Post: 29 Sep 2010, 05:13 PM
  2. 2006 MySQL server has gone away - error message
    By betheone in forum General Questions
    Replies: 5
    Last Post: 19 Dec 2009, 05:12 AM
  3. 2006 MySQL server has gone away Error
    By pinkchalkstudio in forum General Questions
    Replies: 1
    Last Post: 18 Sep 2008, 07:28 PM
  4. SQL Error 2006 MySQL server has gone away
    By asterix in forum General Questions
    Replies: 17
    Last Post: 17 Sep 2008, 01:45 PM
  5. 2006 - MySQL server has gone away - Error trying to upload database
    By sunflowertami in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 1 Aug 2008, 06:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg