Access denied by Anonymous users

Ok Everything on site has been working great for 2yrs and yesterday all of a sudden anonymous users can't see stories or any content until they login as a member. I was deleting a few unscrupulous users just prior to this going bananas. Help how do I fix??

You will need to reset the

briandelicata - April 7, 2007 - 21:14

You will need to reset the node access table (Dbl check that anonymous users have 'access content' permission in access control first)

In phpmyadmin:

TRUNCATE node_access;

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

Access denied by Anonymous users

Keith2005 - April 8, 2007 - 00:56

Ok logged in as root in phpMyAdmin, when to my data base where I could see the access, access log, etc in the left menu. Ran your command above hit go and got this..
Your SQL-query has been executed successfully

SQL-query : [Edit] [Create PHP Code]
TRUNCATE node_access;# MySQL returned an empty result set (i.e. zero rows).
INSERT INTO node_access( nid, gid, realm, grant_view, grant_update, grant_delete )
VALUES ( 0, 0, 'all', 1, 0, 0 ) ;# Affected rows:1

But I'm still getting thing at the home page. or any link I try untill I log in as someone???

Access denied
You are not authorized to access this page.

---

VeryMisunderstood - April 8, 2007 - 01:03

have you double checked the permissions in access control ?

version 4.5 is running short of users to support, have you considered upgrading to at least 4.7.6 ?

Access denied by Anonymous users

Keith2005 - April 8, 2007 - 01:54

access control ? are you refering to admin to administor/users/permissions/node module/access content then putting a check in the box to allow anonymous user?

---

VeryMisunderstood - April 8, 2007 - 02:02

My assumption is yes, that is what im talking about. however I don't use Drupal 4.5. In Drupal 4.7 and Drupal 5 (The two versions I've used) its called access control.

Access denied by Anonymous users

Keith2005 - April 8, 2007 - 17:19

Is there anyway I could have broken anonymous user? The Site http://www.pioneer-net.com/newhome looks like it should except you can't see any of the stories until you login or create a new member. I'm just missing something. Help I'm thinkin Reward at this point..

---

VeryMisunderstood - April 8, 2007 - 17:28

go into the usertable and see if the anon user is there ?

You mean in the admin menu

Keith2005 - April 8, 2007 - 18:16

Do you mean located in drupal or mysql ?

---

VeryMisunderstood - April 8, 2007 - 18:18

in your mysql database, inside the users table, you don't have to dump it you can view it using phpmyadmin if its on your server. Insure that you do indeed have an anon user.

when I sorted by uid 1 is

Keith2005 - April 8, 2007 - 18:34

when I sorted by uid 1 is the first which is me. Isn't anon supposed to be 0?

---

VeryMisunderstood - April 8, 2007 - 18:50

yes the first uid should be 0 which would be for anon users.

have you been keeping up with security updates ?

Na..I was dropped out of a

Keith2005 - April 8, 2007 - 19:11

Na..I was dropped out of a airplane into this linux,mysql,drupal seat without any prior and I'm trying to get a handle on it all in full tilt operation. I do all the tower antennas' & networking them to the customers also. Can I readd anon ?
Thanks

---

VeryMisunderstood - April 8, 2007 - 19:20

yes you can re add an anon user in the database manually. I am not a MySQL expert so I don't know what query to tell you to run.

it may be quicker for you to install another copy of Drupal 4.5 and inspect the way that the anon user is in a fresh install and replicate it on the production install. Considering you don't know how the anon user was erased, I would seriously consider updating your installation so that you aren't being hacked. 4.5 is outdated by 3 major releases now, let alone any secuity updates you missed along the way.

I added user 0 to MySQL but

Keith2005 - April 8, 2007 - 22:25

I added user 0 to MySQL but i'm still getting the same errors.

did you double check it

VeryMisunderstood - April 8, 2007 - 22:27

did you double check it against a fresh install of Drupal 4.5? to insure you added all the table information other then just 0 for user?

I'm out of ideas, you may want to start another thread with the title, how to insert anon user in Drupal 4.5 to try and entice those with more knowledge about it.

FYI - MySQL query for user 0

nadezhda - September 25, 2007 - 02:08

In another "access denied" thread, you can find the MySQL query to add the anon user if it's somehow been lost. It will return an error if the 0 user already exists. drupal.org/node/20397#comment-111175

THANK YOU

davexoxide - May 18, 2007 - 12:39

I was having a heart attack till I found this.
If anyone is experiencing this problem run this query, even in 5.x it works.

My problem originated when I removed Organic Groups from my module list.
All my views and nodes became access denied. This corrected that problem.

THANK YOU!

theTHISorTHAT - personal weblog

Thanks!!!

elemental@drupal.org - June 3, 2007 - 14:39

Thanks davexoxide and all others who posted here. I was also sweating a bit when I logged out of my admin user to check the site out as anon. CRAP!!! ALL PAGES ARE "ACCESS DENIED"!!!! That's a bit scary for sure! LOL. But like davexoxide said, by emptying or trunicating the node_access table and then inserting a row with the values ('0', '0', 'all', '1', '0', '0') it worked like a charm. The site that this happened and was fixed in was running Drupal 5 so this is definitely a fix that you can use with that release.

Like dave, I also recently removed Organic Groups from the site in dev. So I'm guessing this is the start of a trend. Thanks again dave for mentioning that bit of info. It's always nice to have a good idea of where the problem started.

Thanks again!

My resolution for this issue

flavor - September 10, 2007 - 19:18

I disabled organic groups - and then when other people would edit the content it would become unreadable by anonymous visitors - I ran the suggested solution and it did not work.

So I just re-enabled organic groups - problem solved.

http://www.ridgeworksinc.com - helping you participate in the Internet!

Many thanks !!

jayboodhun - October 2, 2007 - 18:47

I was having problems accessing pages as anonymous user. I could only access pages when i had node administration turned on in my permissions.After inserting the row ('0', '0', 'all', '1', '0', '0') in the node_access table, it certainly fixed the problem.

Thanks again.
Jay

My thanks too

sraisz - October 7, 2007 - 15:02

Inserting the row ('0', '0', 'all', '1', '0', '0') in the node_access table fixed my problem. too.

But I can't figure out how it happened.

wonderful help !

miktham - April 3, 2008 - 05:24

I couldn't sort out what went wrong with my test site ? now I just sort it out with your all wonderful help. I am really pleased with drupal buddies.

T.M.Miktham

this thread has been a lifesaver

brianestadt - February 6, 2008 - 16:42

thanks, everyone.

FANTASTIC

dellis - October 25, 2007 - 04:16

THANK YOU SO MUCH!!!

I was guessing that the problem was the node_access table, this issue appeared seemingly randomly for me--but I'm pretty sure it had to do with the Workflow and or Modr8 module being disabled and uninstalled. Anyway, after looking (for this page!) all day I am relieved to find that this solution works. Thanks so very much.

Resetting the node access table

bcobin - November 26, 2007 - 23:35

Brian,

I am sometimes almost moved to tears by how helpful you people are. I had a nasty, nasty problem (I'm sure this has to do with Image and getting Gallery2 integrated) where newly-created pages were suddenly "access denied" to anonymous users. I NEVER would have figured this out and I would have been totally hosed.

Your solution cleared it right up - THANK YOU!

THANKS!!!

Drupalace - January 4, 2008 - 03:10

This solution saved my bacon on a new site. I don't know why that particular brand-new site was having the trouble, but you fixed it right up. (Further details at http://www.drupalace.com/questions/how_fix_access_denied_visitors )

Thanks again!

--------
A site by, of, and for the Drupal newbie: http://www.drupalace.com

Unbelieveable

masterytv - March 8, 2008 - 16:05

Brian, et all...

You guys are unbelievable. I've been frustrated for hours with this as I'm a newbie with Drupal and a designer not a programmer or databaser (?).

All I can say is that if Karma is real and you reap what you sow, then you should be getting a visit from Publishers Clearing House soon.

It took me a while to find this post so I'm going to put in some keywords to help others find this.

Keywords:
Anonymous user, not logged in, before logging in, can't see, view, appear, some posts, story, stories, page, pages, polls, content. Access content box is checked, but I get access denied, not for admin but for other users.

amazing... thank you very

phxl - March 30, 2008 - 06:24

amazing... thank you very much for this!

Life-saver !!!

hobbes_VT - April 11, 2008 - 20:59

I had the same issue after implementing the workflow-nt module - all newly generated nodes were not visible to users other than admins although they were published. Adding the (0, 0, 'all', 1, 0, 0) into my node_access table resolved the issue.

A big "THANK YOU" to the great community of drupal users/developers !!!
I could resolve the issue within minutes (after finally looking for answer instead of finding the problem on my own for a couple of hours ... I should have come here right from the beginning)

HI, I use Drupal 6.2, and i

jingjang - May 1, 2008 - 05:57

HI,

I use Drupal 6.2, and i got "Access Denied" on some page,
i've check node_access and i see ('0', '0', 'all', '1', '0', '0') in the database,

in my case i dont think the problem is node_access

module i've install:
+ fckeditor
+ nodewords
+ pathauto
+ token
+ xmlsitemap

Do you have any idea ?

Bless You!

eyecon - May 14, 2008 - 19:32

I have been pulling my freakin hair out. Anonymous users could access some content but but not all! I suspect that the nodeapproval module corrupted the db.

I also had this issue after disabling Organic Groups

KelleyBevans - September 15, 2007 - 18:34

I'm running a drupal 5.1 site www.obama08-wa.com and running the query worked like a charm - thanks guys!

Let me join in the chorus of

Street - January 8, 2008 - 00:22

Let me join in the chorus of cheers.

I ran the queries and poof, my access denied issues for anonymous users in 5.3 where gone! Why I don't do a forum search sooner when I have problems, well... is probably related to my not asking for directions.

All good things must come to an end, enjoy them before they do!

Yes this works but why is it happening?

drubage - January 25, 2008 - 18:18

This solution has helped me several times but I can never figure out what it happens. It never happens after I remove or ad any modules but it does seem to happen when I am messing around with role permissions (either in Access Control or in something like the forum access). Does anybody know WHY this happens so I can prevent it from happening in the future?

-Drew

a'yup

trevorlee_nc - January 29, 2008 - 14:55

this is frightening, just had it happen on one my my dev installs...

subscribing. . . . .

p.s. the query did fix my problem.

Removing Workflow Caused the Problem

coolmccool - February 29, 2008 - 12:48

When I installed and enabled Modr8 I disabled Workflow... and by chance a week later, I discovered that the articles I had written, approved, since were not showing up to Anonymous users...

This problem is especially bad, since neither the admin, or the author of the articles, will be aware that these articles are NOT showing up - they'll see the articles as they normally would.

My workaround was to simply [following the advice on this thread] enable Workflow again.

Drupal folks will need to ascertain which Modules this *bug* affects and why, and provide a patch. It IS a nasty one.

=-=

VeryMisunderstood - February 29, 2008 - 16:59

if no one reports the issue in one of the modules issues querries providing a detailed summary in a way that allows the developers to recreate the problem. There is little chance of it getting fixed.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

Has anyone made any progress

techguy10 - April 26, 2008 - 09:14

Has anyone made any progress on this, I am now having the same problem, which was the correct solution its kind of confusing after reading through all the posts?

hi, im follow this post

jingjang - May 1, 2008 - 06:01

hi,

im follow this post http://drupal.org/node/12757
INSERT INTO users_roles (uid, rid) VALUES (0, 1);

and finaly it work !

Access Denied Fixed by Resetting Permissions

jamiegrove - June 11, 2008 - 18:37

I had the same problem. The SQL instructions included on this post work but you can also reset permissions on the anonymous user through the admin...

* Unchecked the box for "access content" under Admin:User Management:Access Control:Node
* Clicked "Save Permissions"
* Rechecked the box for "access content" under Admin:User Management:Access Control:Node
* Clicked "Save Permissions"

I just put up a blog post about this issue... :)

http://www.fieldguidetoprogrammers.com/blog/drupal/drupal-and-access-den...

I've been hit by this too

alliax - September 19, 2008 - 03:47

I've been hit by this too for the first time ever in over 4 years of drupal use, on a relatively new site on a multi install based on drupal 6. WHY DOES IT HAPPEN ??? Who has a clue?

I don't use OG module and other mentionned in this thread, so it's not that. What can it be?

 
 

Drupal is a registered trademark of Dries Buytaert.