Can anyone give me a hint where this error could come from?
When a user tries to access a specific node in the login-area of my Drupal 8 website, he randomly gets a white screen with the message "The website encountered an unexpected error. Please try again later."
I look at the apache error logs on the server and see the following error message:
Uncaught PHP Exception Exception: "Query tagged for node access but there is no node table, specify the base_table using meta data." at /mywebsite.com/html_d8tst/core/modules/node/node.module line 1107, referer: http://mywebsite.com/user/251
node.module line 1107 says:
// Bail out if the base table is missing.
if (!$base_table) {
throw new Exception(t('Query tagged for node access but there is no node table, specify the base_table using meta data.'));
}
I don't understand what exactly goes wrong when the error occurs. And unfortunately, I don't even see any pattern in which use cases the error occurs.
It's only on this specific node. Sometimes it works, sometimes not. The node is of a specific content type which only logged-in users have access to. It contains several views, some of them are user-specific.
This https://www.drupal.org/project/drupal/issues/2664748 seemed to be a similar problem, but the post was about Drupal 8.0.x-dev and was fixed. I'm working with Drupal 8.6.13
I would be glad of any hints!
Sometimes it works, sometimes not.
- from my personal experience,whenever this happens I most likeley have done something wrong with caching. While I've never had that exact error message, I'd check if everything rendered on that node was added in a cache-safe way, e.g. by preprocessing or Twig tweak module.