Access denied by Anonymous users
Keith2005 - April 7, 2007 - 21:00
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
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
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.
---
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
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?
---
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
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..
---
go into the usertable and see if the anon user is there ?
You mean in the admin menu
Do you mean located in drupal or mysql ?
---
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
when I sorted by uid 1 is the first which is me. Isn't anon supposed to be 0?
---
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
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
---
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
I added user 0 to MySQL but i'm still getting the same errors.
did you double check it
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
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
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!!!
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
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 !!
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
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 !
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
thanks, everyone.
FANTASTIC
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
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!!!
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
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
amazing... thank you very much for this!
Life-saver !!!
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
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!
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
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
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?
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
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
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.
=-=
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
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
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
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
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?