0

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!

3
  • 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.
    – Hudri
    Commented Aug 1, 2019 at 15:36
  • Thanks for the tip. I checked possible caching issues. But there are only standard Drupal caches active on this node. I'm not using any extra twig templates or preprocessing functions.
    – anna-b
    Commented Aug 6, 2019 at 9:08
  • I assume, it has something to do with different methods of access permissions. The page shows several blocks. Some of them are views as blocks, some are simple blocks. I tried to make consisten configurations by setting all role permissions in the block configurations and disabled the permissions settings in all views, which are shown as blocks on the page. But the error is still occurring from time to time.
    – anna-b
    Commented Aug 6, 2019 at 9:15

1 Answer 1

0

For anyone else running into this, I was able to get it to go away by checking all my blocks' permissions, especially the ones related to user information, and for me, the culprit was the User Activity Log block. Once I added the Visibility setting that only authenticated users had access to the block, the error went away.

Looks like the Drupal devs aren't having this module fail gracefully for unauthenticated users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.