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.
Issue fork search_api_attachments-3217252
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
Comment #3
smustgrave commentedAdded a simple check.
Comment #4
izus commentedhi,
thank you
wouldn't
!isset($data->fid)bu suffisant instead of!isset($data->fid) && $data->fid === NULL?Comment #5
smustgrave commentedYou are correct. This is what happens when the coffee runs low. Thanks for that!
Comment #8
izus commentedThanks
this si now merged in 8 and 9 branches