96

I was trying to update my wordpress core to 4.5.1 but my system was missing some permissions, and now after giving correct permission, I cannot get rid of that message and I cannot upgrade. Tried to look for a .maintainance file but there is not.

How do I update now?

Thanks for help

6
  • 1
    That message got auto removed after a few minutes, so the problem is now solved an I successfully updated my wordpress installation Apr 27 '16 at 19:11
  • It could be due to some cache (ex: WP Object Cache) that may have cleared itself after a few minutes. Apr 28 '16 at 1:20
  • Add your comment as an answer and mark as complete to close it out. Glad you got it working.
    – TomC
    May 8 '16 at 17:10
  • provided you a little tip at the end $>wp option delete my_option
    – prosti
    Nov 29 '16 at 14:47
  • 7
    Just "select SELECT * FROM wp_options WHERE option_name LIKE '%core_update%'" from your db. Just delete this row "delete core_updater.lock" from wp_options table and run it again. It helps
    – Arul
    Jul 1 '17 at 14:39
125

It is an automatic lock to prevent simultaneous core updates. It will be gone after 15 minutes. If you don't want to wait, delete the record from options table – usually wp_options.

Since Wordpress 4.5:

option_name = 'core_updater.lock'

If you have an older installation (before Wordpress 4.5):

option_name = 'core_updater'   
7
  • 15
    In my installation there is no such row in database and the message still appears. The real option name is core_updater.lock (for Wordpress 4.5.3)
    – Athlan
    Jun 26 '16 at 10:29
  • 11
    BEST IDEA: Do this with WP CLI: wp option delete core_updater.lock
    – jerclarke
    Mar 7 '17 at 20:02
  • 1
    I am not finding either 1 of these in the wp_options table, and still getting this message. Jul 25 '17 at 14:10
  • I don't have anything like this in wp database
    – user924
    Jul 21 '18 at 16:48
  • nothing can be found like this at my database, not core_updater.lock and not even core_updater
    – user924
    Oct 28 '18 at 15:58
28

If you use wp-cli run the following command:

wp option delete core_updater.lock

This command will delete the option named: core_updater.lock

4
  • doesn't help WordPress 4.9.7
    – user924
    Oct 28 '18 at 16:20
  • this option still works in WP 5+
    – NickFMC
    Mar 1 '19 at 18:11
  • Yes, It does. It will work on any latest version
    – Jewel
    Apr 5 '20 at 10:19
  • @user924 if this doesn't resolve the issue, please check the wp_options table has auto_increment enabled for the option_id field.
    – Anthony
    Oct 29 '20 at 21:42
8

Add this code to any plugin or your theme's functions.php file. Remember to remove it when you're done to prevent flicking your database for no reason.

delete_option( "core_updater.lock" );
3
  • 1
    doesn't help WordPress 4.9.7
    – user924
    Oct 28 '18 at 16:19
  • 1
    this is still available in WP 5+
    – NickFMC
    Mar 1 '19 at 18:09
  • I am not aware of anything in 4.9.7 that makes this not work, despite user924's comment.
    – John Dee
    Jun 19 '19 at 23:59
1

Per @jeremyclarke, running this at the terminal resolved this issue for me: wp option delete core_updater.lock

1
  • doesn't help WordPress 4.9.7
    – user924
    Oct 28 '18 at 16:20
0

Confirming this 'core_updater.lock'. It may not be obvious at first but look at the line 771.

File: wp-admin/includes/class-wp-upgrader.php
754:    /**
755:     * Creates a lock using WordPress options.
756:     *
757:     * @since 4.5.0
758:     * @access public
759:     * @static
760:     *
761:     * @param string $lock_name       The name of this unique lock.
762:     * @param int    $release_timeout Optional. The duration in seconds to respect an existing lock.
763:     *                                Default: 1 hour.
764:     * @return bool False if a lock couldn't be created or if the lock is no longer valid. True otherwise.
765:     */
766:    public static function create_lock( $lock_name, $release_timeout = null ) {
767:        global $wpdb;
768:        if ( ! $release_timeout ) {
769:            $release_timeout = HOUR_IN_SECONDS;
770:        }
771:        $lock_option = $lock_name . '.lock';
772: 
773:        // Try to lock.
774:        $lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_option, time() ) );
775: 

Now, if you like you may delete this option:

$>wp option delete core_updater.lock
1
  • doesn't help WordPress 4.9.7
    – user924
    Oct 28 '18 at 16:20
0

For anyone looking for the full MySQL query:

DELETE FROM wp_options WHERE option_name LIKE '%core_update%' LIMIT 1

0

In WordPress there are two update locks:

  • core_updater
  • auto_updater

So, you can fix this by deleting the update locks.

Use below code to delete the lock's:

delete_option( 'core_updater.lock' );
delete_option( 'auto_updater.lock' );

You can delete the update locks with CLI command too. Checkout how to delete them with CLI command.

Use the WordPress pluginenter link description here fix-update-in-process which show the existing locks and fix the issue with one click.

Not the answer you're looking for? Browse other questions tagged or ask your own question.