• Hi

    A couple of times a day I get an error message in my error log. Its always the same:

    [10-Aug-2013 03:24:39 UTC] WordPress database error MySQL server has gone away for query SELECT option_value FROM options WHERE option_name = ‘_transient_doing_cron’ LIMIT 1 made by _get_cron_lock

    I have taken a look in my options SQL and no such table exists.

    I Googled the error and the other than referring to other threads the only real explanation I could read was http://wordpress.org/support/topic/annoying-establishing-a-database-connection-after-site-updates?replies=7 implying it was the hosting company’s issue. However I got this reply from them:

    Unfortunately since you are on a shared server, we cannot change the mysql settings of the server. We are sure that its not a server side issue thats causing the error. You may need to dig in the code thoroughly for the fix. I suggest you contacting wordpress too and let us know what they think about this.

    I am using the latest version of WordPress 3.6.1 with plugins WooCommerce, Regen Thumbnails, WooThemes Updater, Wooslider & Wooslider Product Slideshow, CKEditor, Wordfence, Cookie Law Info, Easy Contact Forms, Maintenance Mode and All in one SEO Pack.

    I have also slightly modified the TwentyTwelve theme (believe me I know that was a mistake now!).

    Please could anyone advise? I am good at instructions for adding, editing and deleting PHP and MySQL script.

    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • I haven’t seen this particular query before, but looks like it’s related to cron.

    If the SQL database is going away, that normally means it’s timing out/failing – often due to limits on memory or space. That your host doesn’t want to look at it doesn’t bode well.

    As an “eliminate potential other issues” step, have you optimized/repaired your database recently?

    I’d do a database backup, run through these two steps, and see if there’s any result.

    http://www.siteground.com/tutorials/phpmyadmin/phpmyadmin_optimize_database.htm

    Thread Starter dvharrison

    (@dvharrison)

    Wow, thanks for the very quick response and the resource guide. I shall try all that and keep you posted.

    Thanks Again.

    Thread Starter dvharrison

    (@dvharrison)

    Hi indietravel

    I did try repair and install the database yesterday. I checked it this morning and overnight that error has occurred again.

    I might be wrong, but it looks like you need that database tuned up then: maybe it needs a longer timeout limit, more memory, bigger cache, or an object cache on the front end to let it do its thing.

    That’s probably something that can only be solved by your host (or you if you have permissions to play around with your server software and can figure out what to do).

    Thread Starter dvharrison

    (@dvharrison)

    I have put it to the support team. I hope they come through for me.

    I have also looked at wp_cron.php. I know some PHP to the extent of following patterns but was particularly drawn to the timeout section:

    $doing_cron_transient = get_transient( ‘doing_cron’);

    // Use global $doing_wp_cron lock otherwise use the GET lock. If no lock, trying grabbing a new lock.
    if ( empty( $doing_wp_cron ) ) {
    if ( empty( $_GET[ ‘doing_wp_cron’ ] ) ) {
    // Called from external script/job. Try setting a lock.
    if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) )
    return;
    $doing_cron_transient = $doing_wp_cron = sprintf( ‘%.22F’, microtime( true ) );
    set_transient( ‘doing_cron’, $doing_wp_cron );
    } else {
    $doing_wp_cron = $_GET[ ‘doing_wp_cron’ ];
    }
    }

    I have been asked to check the database query is closed, but could only find a die() command. Please advise.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problem in error_log’ is closed to new replies.