Problem/Motivation

When I run cron locally I get this error

The website encountered an unexpected error. Please try again later.AssertionError: Cannot load the "file" entity with NULL ID. in assert() (line 244 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).assert(, 'Cannot load the "file" entity with NULL ID.') (Line: 244)Drupal\Core\Entity\EntityStorageBase->load(NULL) (Line: 108)Drupal\search_api_attachments\Plugin\QueueWorker\ExtractorQueue->processItem(Object) (Line: 182)Drupal\Core\Cron->processQueues() (Line: 147)Drupal\Core\Cron->run() (Line: 75)Drupal\Core\ProxyClass\Cron->run() (Line: 272)Drupal\admin_toolbar_tools\Controller\ToolbarController->runCron()call_user_func_array(Array, Array) (Line: 123)Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 573)Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 158)Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 706)Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

Put a check in the ExtractorQueue to catch these.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

smustgrave created an issue. See original summary.

smustgrave’s picture

Status: Active » Needs review

Added a simple check.

izus’s picture

Status: Needs review » Needs work

hi,
thank you
wouldn't !isset($data->fid) bu suffisant instead of !isset($data->fid) && $data->fid === NULL ?

smustgrave’s picture

Status: Needs work » Needs review

You are correct. This is what happens when the coffee runs low. Thanks for that!

  • izus committed 8e9161b on 8.x-1.x authored by smustgrave
    Issue #3217252 by smustgrave, izus: Cannot load the "file" entity with...

  • 7149b7d committed on 9.0.x
    Issue #3217252 by smustgrave, izus: Cannot load the "file" entity with...
izus’s picture

Status: Needs review » Fixed

Thanks
this si now merged in 8 and 9 branches

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.