UPDATE to 5.6 Bug
-
I’ve been having this problem for quite some time to where I can update plugins etc all automatically but wordpress versions I cannot. When trying to update it says “Another update is currently in progress.”.
I’ve tried looking for update locks, etc, and have essentially narrowed it down to the function create_lock() in class-wp-upgrader.php line 885
For some reason when wordpress is trying to insert the core_updater.lock line in the wp_options table, it’s saying there’s a duplicate entry.
// Try to lock. $q = $wpdb->prepare( "INSERT INTO <code>$wpdb->options</code> ( <code>option_name</code>, <code>option_value</code>, <code>autoload</code> ) VALUES (%s, %s, 'no') /* LOCK */", $lock_option, time() ); $lock_result = $wpdb->query( $q ); echo "QUERY[ $q ]<br>"; echo "QUERY ERROR[ ".$wpdb->last_error." ]<br>";This is what it returns
QUERY[ INSERT INTOwp_options(option_name,option_value,autoload) VALUES (‘core_updater.lock’, ‘1608054699’, ‘no’) /* LOCK */ ]
QUERY ERROR[ Duplicate entry ‘core_updater.lock’ for key ‘option_name’ ]The funny thing? When I manually look at the table with Navicat, that line doesn’t exist, and I can manually run the query to insert it normally. Something is bugged here and I’m not quite sure what it is
Disclaimer – I modified the code above in order to show me the error code and split up the syntaxes to ensure prepare() wasn’t messing up the query code
The topic ‘UPDATE to 5.6 Bug’ is closed to new replies.