Fixing Drupal’s anonymous user access denied problem

Fixing Drupal’s anonymous user access denied problem

I run several Drupal-based websites, and today one of them stopped allowing unregistered users access to new content, for seemingly no reason. One solution I found was to upgrade from v5.6 (which I was running) to v5.7, but that didn’t work.

It turns out there’s a really simple fix that worked for me. I just ran the following SQL command:

INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);

I renamed “node_access” to include the Drupal table prefix (you may not have one), and of course I backed everything up beforehand, but it worked.

Why? Well, it seems that user ID “0” (that is, “anonymous user”) had gone walkabout from the database table. Where it went, I don’t know, but that command restores it. As always, your mileage may vary.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.