This error popped up a little while ago and we can't figure out what is causing it to be null or what needs to change. It is caused by a view that is set up as an rest api that you give it a NID.

Most NIDs work but random ones will not and instead throws this error.

Call to a member function getCacheTags() on null in Drupal\views\Plugin\views\query\Sql->getCacheTags() (line 1630 of core/modules/views/src/Plugin/views/query/Sql.php). Drupal\views\Plugin\views\query\Sql->getCacheTags() (Line: 236) Drupal\views\Plugin\views\cache\CachePluginBase->getCacheTags() (Line: 113) Drupal\views\Plugin\views\cache\CachePluginBase->cacheSet('results') (Line: 1428) Drupal\views\ViewExecutable->execute(NULL) (Line: 1451) Drupal\views\ViewExecutable->render() (Line: 425) Drupal\rest\Plugin\views\display\RestExport->execute() (Line: 1627) Drupal\views\ViewExecutable->executeDisplay('rest_export_1', Array) (Line: 77) Drupal\views\Element\View::preRenderViewElement(Array) call_user_func(Array, Array) (Line: 378) Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195) Drupal\Core\Render\Renderer->render(Array, 1) (Line: 139) Drupal\Core\Render\Renderer->Drupal\Core\Render{closure}() (Line: 582) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 140) Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 408) Drupal\rest\Plugin\views\display\RestExport::buildResponse('story_referenced', 'rest_export_1', Array) (Line: 52) Drupal\views\Routing\ViewPageController->handle('story_referenced', 'rest_export_1', Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 582) 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}() call_user_func_array(Object, Array) (Line: 153) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) 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: 99) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 38) Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 48) Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

closed as unclear what you're asking by mradcliffe, DRUPWAY, sanzante, kiamlaluno Apr 23 '18 at 15:50

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Do you mean that NIDs that do not exist throw this error? – theuni Mar 29 '18 at 12:02
  • Apparently I have a bad node. I found the node causing a problem, looking at the story it showed no body. But I went to edit and saved it again, then the story was working and the view rest just crashing. – Tyler Mar 30 '18 at 18:34

Browse other questions tagged or ask your own question.