Blog

Drupal 'Access Denied' on all pages

Written by Metal Toad Staff | Apr 10, 2009 12:00:00 AM
Filed under:

Ran into an interesting little snag this morning - a client's Drupal site was spitting out "Access Denied" errors for all page loads by anonymous users. It didn't appear to be a permissions problem - the nodes just wouldn't let anyone look at them.

A bit of Googling found a bunch of posts like this that say that, for some mysterious reason, Drupal can lose the contents of the node_access table and you need to repopulate them.

INSERT  INTO  node_access
  (nid ,gid ,realm ,grant_view, grant_update , grant_delete)
  VALUES ( '0',  '0',  'all',  '1',  '0',  '0')

Unfortunately, I didn't exactly have access to the client's database. A bit of poking around in the source showed me that visiting /admin/content/node-settings/rebuild would fire off an internal process to do the same thing.

Crisis averted, fix discovered. I just hope I don't need to use it again in the future.