WSOD + Call to a member function isPublished() on null when deleting node entity

Created on 23 April 2023, over 1 year ago

Problem/Motivation

When deleting an entity I am getting a WSOD with the error below:

Message	Error: Call to a member function isPublished() on null in Drupal\gatsby\GatsbyPreview->gatsbyPrepareData() (line 104 of /home/abc/build/00002/web/modules/contrib/gatsby/src/GatsbyPreview.php)
#0 /home/abc/build/00002/web/modules/contrib/gatsby/gatsby.module(289): Drupal\gatsby\GatsbyPreview->gatsbyPrepareData()
#1 [internal function]: gatsby_entity_delete()
#2 /home/abc/build/00002/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
#3 /home/abc/build/00002/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#4 /home/abc/build/00002/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#5 /home/abc/build/00002/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(251): Drupal\Core\Extension\ModuleHandler->invokeAll()
#6 /home/abc/build/00002/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(903): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#7 /home/abc/build/00002/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(496): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#8 /home/abc/build/00002/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(751): Drupal\Core\Entity\EntityStorageBase->delete()
#9 /home/abc/build/00002/web/core/lib/Drupal/Core/Entity/EntityBase.php(347): Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete()
#10 /home/abc/build/00002/web/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php(71): Drupal\Core\Entity\EntityBase->delete()
#11 [internal function]: Drupal\Core\Entity\ContentEntityDeleteForm->submitForm()
#12 /home/abc/build/00002/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
#13 /home/abc/build/00002/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#14 /home/abc/build/00002/web/core/lib/Drupal/Core/Form/FormBuilder.php(592): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#15 /home/abc/build/00002/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm()
#16 /home/abc/build/00002/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#17 /home/abc/build/00002/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult()
#18 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
#19 /home/abc/build/00002/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#20 /home/abc/build/00002/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#21 /home/abc/build/00002/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#22 /home/abc/build/00002/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#23 /home/abc/build/00002/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#24 /home/abc/build/00002/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#25 /home/abc/build/00002/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#26 /home/abc/build/00002/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#27 /home/abc/build/00002/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#28 /home/abc/build/00002/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#29 /home/abc/build/00002/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\page_cache\StackMiddleware\PageCache->handle()
#30 /home/abc/build/00002/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#31 /home/abc/build/00002/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#32 /home/abc/build/00002/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#33 /home/abc/build/00002/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#34 /home/abc/build/00002/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#35 {main}

The delete appears to succeed, although the usual "content X has been deleted" message is missing from watchdog log.

Steps to reproduce

I apologize, I don't have time to try to reproduce this on a clean install. The content being deleted is under workflow moderation in Draft state. It occurs whether or not the content was ever published.

This does not occur on a local copy of the site which has identical gatsby module configuration except the Build Webhook URL(s) is empty.

Gatsby configuration:

Gatsby Server URL: OMITTED
Preview Webhook URL(s): OMITTED
Build Webhook URL(s): OMITTED
Content Sync URL (Gatsby 4): OMITTED

Content / path mapping >
Preview Server Path Mapping: /home|/

Data selection >
Only trigger builds for published content: ON

Preview >
Entity types to send to Gatsby Preview and Build Server:
Consumer
Content moderation state
File
Media
Content
URL alias
Taxonomy term
Paragraph

Advanced settings >
Nothing set here.

Fastbuilds >
Only log entities for published content: ON
Delete Old Gatsby Fastbuilds Log Entities: ON
Fastbuilds Log Expiration: 90 days

Thanks!

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇨🇦Canada othermachines Edmonton, Alberta

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

Comments & Activities

Production build 0.71.5 2024