The feed became locked before the import could begin.

Created on 14 August 2023, over 1 year ago
Updated 17 August 2023, about 1 year ago

Problem/Motivation

Hi, I am trying to troubleshoot this error "The feed became locked before the import could begin." Nothing appears in watchdog or server error logs

I have the exact same site and set-up on a different server and the import works fine.

Any tips on tracing the root cause of this error?

💬 Support request
Status

Fixed

Component

Code

Created by

🇦🇺Australia neubreed

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @neubreed
  • Status changed to Fixed about 1 year ago
  • 🇳🇱Netherlands megachriz

    This means that the feed you are trying to import data for is locked. A feed gets locked after an import starts. This is to prevent having two imports running for the same feed at the same time.

    The fact that you get this error message means that an import for it was started earlier and that import did not finish (yet).

    No import running? Try to unlock the feed

    If you are sure that there's no import running currently, you can try to unlock the feed. On the feed page, there should be a tab called "Unlock". You can also go to "/feed/[feed id]/unlock" where "[feed id]" is the ID of the feed entity. For example: /feed/1/unlock. If you get an access denied, try to rebuild caches first.

  • 🇦🇺Australia neubreed

    Thanks for getting back to me. Unfortunately, the feed doesn't even start and doesn't become locked.

    /feed/1/unlock presents an access denied page. (probably because no lock exists)

    The function that catches the LockException doesn't display the error message that was thrown. Only the generic error 'The feed became locked before the import could begin'. It would be useful to at least see the exception message

      protected function import(FeedInterface $feed) {
        try {
          $feed->lock();
        }
        catch (LockException $e) {
          $this->messenger->addWarning($this->t('The feed became locked before the import could begin.'));
          return;
        }
    
        $feed->clearStates();
        $this->createBatch($feed, static::FETCH)
          ->addOperation(static::FETCH)
          ->run();
      }
    
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024