• We have seen our main Shop page (WooCommerce) return 404 errors. When we go into WooCommerce settings and reset the Shop main page, that fixes it. I have contacted my host and WooCommerce and we have narrowed it down to the Free Downloads WooCommerce by Square One Media plugin. Below is the error message:

    “NOTICE: PHP message: WordPress database error Deadlock found when trying to get lock; try restarting transaction for query DELETE FROM ttl_db_new_options WHERE option_name = ‘somdn_woo_plugin_db_version’ made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require(‘/www/wp-config.php’), require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), WP_Hook->do_action, WP_Hook->apply_filters, SOM_Free_Downloads->on_plugins_loaded, SOM_Free_Downloads->update_plugin, SOMDN_DB_Updater->__construct, SOMDN_DB_Updater->update_complete, delete_option”

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Richard Webster

    (@rwebster85)

    Hi mate. Make sure my plugin is disabled and then continue using your site. Then check the PHP error logs and see if you get any other errors like this.

    Hi Richard,

    I’m getting the same error. My php_errolog is filling up with…

    WordPress database error Deadlock found when trying to get lock; try restarting transaction for query DELETE FROM g1g1_options WHERE option_name = ‘somdn_woo_plugin_db_version’ made by require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), WP_Hook->do_action, WP_Hook->apply_filters, SOM_Free_Downloads->on_plugins_loaded, SOM_Free_Downloads->update_plugin, SOMDN_DB_Updater->__construct, SOMDN_DB_Updater->update_complete, delete_option, QM_DB->query

    Is the plugin trying to update when it doesn’t need to?

    Sorry, just posting again so I can tick the ‘notify me’ thing so I get an email when you respond.

    Plugin Author Richard Webster

    (@rwebster85)

    Hi mate does this error show without my plugin? When this post was first made I googled “WordPress database error Deadlock” and it seems like something else is going on.

    Thanks for the quick reply. The error seems to disappear when the Free Downloads WooCommerce plugin is disabled.

    Plugin Author Richard Webster

    (@rwebster85)

    And in your logs does it only appear for this plugin?

    Yes, only for this plugin.

    Plugin Author Richard Webster

    (@rwebster85)

    Uninstall the plugin and if you’e able make sure the plugin folder has been deleted. See how you get on for a few days after that.

    Plugin Author Richard Webster

    (@rwebster85)

    Are you running any caching plugins?

    I am running caching plugins, yes.

    The logs show no other deadlocks on the options table for any other plugin as far back as I can see.

    I’ve fully removed the plugin and reinstalled it. I’ll see how it goes from now on a fresh install.

    I haven’t had time to look at the code fully, but I think something is a bit funky in class-somdn-db-updater.php that makes the plugin want to update when it doesn’t need to. Maybe users who installed the latest version fresh aren’t affected because the logic that checks version numbers works for them.

    The error is still appearing in the logs ??

    In this function below should it always be calling $this->update_complete() even if no updates were done?

    public function __construct( $version = ”, $setting_name = ”, $fresh_install_setting = ” ) {
    //echo ‘$fresh_install_setting = ‘ . $fresh_install_setting;
    if ( empty( $version ) || empty( $setting_name ) ) {
    return;// bail
    }
    $this->new_version = $this->clean_string( $version );

    $this->setting_name = $this->clean_string( $setting_name );

    $this->old_version = ! empty( get_option( $this->setting_name ) ) ?
    $this->clean_string( get_option( $this->setting_name ) )
    : ‘0.0.1’ ;

    //$this->old_version = ‘0.0.1’;

    if ( ! empty( $fresh_install_setting ) ) {
    $this->fresh_install_setting = $this->clean_string( $fresh_install_setting );
    }

    //$this->fresh_install_setting = ‘somdn_some_setting_name’;

    //echo ‘<p>$this->new_version = ‘ . $this->new_version . ‘</p>’;
    //echo ‘<p>$this->old_version = ‘ . $this->old_version . ‘</p>’;
    //echo ‘<p>$this->fresh_install_setting = ‘ . $this->fresh_install_setting . ‘</p>’;

    if ( $this->do_updates() ) {
    //echo ‘<p>do_updates</p>’;
    $this->init();
    $this->run();
    }

    $this->update_complete();
    //exit;
    }

    Plugin Author Richard Webster

    (@rwebster85)

    I thought caching might be involved. From what I’ve read this problem has come up in a few different plugins and is related in some way to transients, which WP uses, and them being cached.

    I’m working on a complete rewrite of this plugin and it will use a new updating system which shouldn’t have this problem. For now though, do you have the facility to manually edit the PHP files for my plugin? If so you can remove the need for this updating system (I’ll explain how).

    Yup I can edit php files.

    Plugin Author Richard Webster

    (@rwebster85)

    Awesome, so find line 225 in som-woocommerce-download-now.php, which reads $this->update_plugin();

    Add a double forward slash before this, so it reads //$this->update_plugin();

    Save and you should be golden.

    Cool, I commented out…

    public function on_plugins_loaded() {
    do_action( ‘somdn_loaded’ );
    //$this->update_plugin();
    }

    Thanks for responding. Useful plugin ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Incompatibility with WooCommerce’ is closed to new replies.