General error: 2006 MySQL server has gone away

Discussion in 'General discussions' started by Rod Rayner, Mar 22, 2019.

  1. Rod Rayner

    Rod Rayner Member

    Joined:
    May 13, 2018
    Messages:
    35
    Likes Received:
    4
    S.E:
    2019-05-13 22:58:33
    L.T:
    Extended
    L.C:
    1
    Trying to run a campaign and its getting stuck at 31%.

    I have checked the application logs and its full of messages saying General error: 2006 MySQL server has gone away.

    I have recently upgraded from 1.5.1 to the latest version, other than that there are no changes other than added new subs to lists.

    I have restarted the server and tried several times to restart the campaign. The server is a dedicated server running at AWS using SMTP2Go as a delivery server. Never had any issues before but i have upgraded.

    Any idea's ?
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,980
    Likes Received:
    2,338
  3. Rod Rayner

    Rod Rayner Member

    Joined:
    May 13, 2018
    Messages:
    35
    Likes Received:
    4
    S.E:
    2019-05-13 22:58:33
    L.T:
    Extended
    L.C:
    1
    just added the two innodb lines ( were they supposed to be there already ? ) and changed max connections to 500... re-started SQL and still getting the following error

    2019/03/22 18:03:25 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away. The SQL statement executed was: UPDATE `mw_campaign` SET `status`=:status, `last_updated`=NOW() WHERE campaign_id = :cid.
    2019/03/22 18:03:25 [error] [application] CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
    2019/03/22 18:03:25 [error] [application] CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

    Any more idea's
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,980
    Likes Received:
    2,338
    What's your sending settings from backend > settings > cron ? (show a screenshot)
    Also, how about your server resources, ram/cpu/storage?
     
  5. Rod Rayner

    Rod Rayner Member

    Joined:
    May 13, 2018
    Messages:
    35
    Likes Received:
    4
    S.E:
    2019-05-13 22:58:33
    L.T:
    Extended
    L.C:
    1
    here you go..

    upload_2019-3-22_18-28-58.png

    The server is a dedicated AWS EC2 T2.Medium, 4Gb RAM & 2 cores. Have only sent 1 campaign out today which is the one that is having the issue and max CPU usage has never gone over 25%. The server normally runs fine and the only thing i have done recently is upgraded to latest version of Mail Wizz. Our PHP version is 7.0.33-0ubuntu0.16.04.2
     
  6. Rod Rayner

    Rod Rayner Member

    Joined:
    May 13, 2018
    Messages:
    35
    Likes Received:
    4
    S.E:
    2019-05-13 22:58:33
    L.T:
    Extended
    L.C:
    1
    CPU utilization for today... unlikely to be server spec

    upload_2019-3-22_18-35-41.png
     
  7. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,980
    Likes Received:
    2,338
    The sending settings are pretty low, they should not be a problem.
    Did you enable pcntl sending in backend > settings > cron ?
     
  8. Rod Rayner

    Rod Rayner Member

    Joined:
    May 13, 2018
    Messages:
    35
    Likes Received:
    4
    S.E:
    2019-05-13 22:58:33
    L.T:
    Extended
    L.C:
    1
    It wasn't enabled so i have just set it to Yes, resumed the campaign and still stuck.
     
  9. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,980
    Likes Received:
    2,338
    Hmm, put it back on disabled, i asked because generally that will eat some resources.

    Okay, in same page( backend > settings > cron ) what's the setting for "Delete delivery logs" ?
    If it's set to No, can you set it to Yes? Then when the cron job runs at midnight, it will clean your database a lot, which should avoid this issue.

    If you don't want to wait till midnight, you can manually run the cron job yourself from ssh.
    If in backend > misc > cron jobs list, your cron job for daily looks like:
    Code:
    0 0 * * * /usr/bin/php -q /var/www/vhosts/newsletter.onetwist.com/httpdocs/apps/console/console.php daily >/dev/null 2>&1
    
    Then from ssh, run:
    Code:
    /usr/bin/php -q /var/www/vhosts/newsletter.onetwist.com/httpdocs/apps/console/console.php daily --verbose=1
    
    If none of those work, open a ticket with backend url and login and ssh access to the server and i'll take a look.
     
  10. Rod Rayner

    Rod Rayner Member

    Joined:
    May 13, 2018
    Messages:
    35
    Likes Received:
    4
    S.E:
    2019-05-13 22:58:33
    L.T:
    Extended
    L.C:
    1
    Ok so i have disabled the PCNTL again and checked the delete delivery log setting. This was set to no so i have changed to yes and ran the cron job manually. I resumed the campaign and still stuck, i checked the application log and still getting the error message saying SQL Server has gone away.

    I create a ticket so you can check the backend config.

    Thanks
     
  11. rockstarproject7

    rockstarproject7 New Member

    Joined:
    Jan 29, 2019
    Messages:
    15
    Likes Received:
    0
    S.E:
    2019-07-31 08:41:46
    L.T:
    Regular
    L.C:
    1
    where is the PCNTL ?
     
  12. laurentiu

    laurentiu Member Staff Member

    Joined:
    Mar 13, 2018
    Messages:
    221
    Likes Received:
    24
  13. rockstarproject7

    rockstarproject7 New Member

    Joined:
    Jan 29, 2019
    Messages:
    15
    Likes Received:
    0
    S.E:
    2019-07-31 08:41:46
    L.T:
    Regular
    L.C:
    1
    yeah i already found the setting :) the only issue now the big database..how can we optimize this one?
     
  14. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,980
    Likes Received:
    2,338

Share This Page