Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
menu system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2007 at 16:26 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent
Comments
Comment #1
ChrisKennedy commentedWhat modules do you have enabled, and in particular are you using any access control modules?
Comment #2
yelvington commentedI don't think I'm running that admits to monkeying with the node access system, but Audio or Video might. I'm running PHP 5.2.0. Here's the noncore module list:
AdSense
Audio
Image
Upload Preview
Admin block
MySite
Video
Views
The thing that's puzzling me is that I don't need to change anything in the admin/user/access settings to fix the problem -- just open the page and save the settings.
I did not look at the node access table when it was down. Now that it's up; I have
nid gid realm grant_view grant_update grant_delete
0 0 all 1 0 0
Comment #3
ChrisKennedy commentedHere's what viewing and saving admin/user/access does (from http://api.drupal.org/api/5/function/user_admin_perm_submit):
This makes me think that perhaps the permission table is getting messed up for anonymous users somehow. I'm not sure though, it might also be the menu_rebuild() that fixes it.
Comment #4
yelvington commentedWell, thanks to Merlin's excellent Update Status module I discovered things were not as I believed: I was running 5.0 (patched), not 5.1, and there may have been PHP version conflicts I had not worked around. As a result, I'm going to mark this as "closed" and reopen it if I discover problems on the upgraded system.
Sigh. I have too many plates spinning.
Comment #5
yelvington commentedOK, I'm reopening it, as the problem reappeared today. I carefully examined both the permission and node_access tables before and after "fixing" the problem by logging in as admin, opening the permissions page, and saving it. Nothing changed in those tables, so that may point to menu_rebuild(). The documentation for menu_rebuild() says "Define the navigation menus, and route page requests to code based on URLs." It may be that the second part is where the problem lies.
If I can catch it broken again, perhaps I can find something amiss in the menu table.
Comment #6
yelvington commentedChanging the title to be more accurate; changing the component setting to reflect current suspicions.
Comment #7
yelvington commentedOK, the problem resurfaced today, coincidental to what appeared to have been a spambot attack. I'm still researching that.
Regarding the menu system entanglement: I dumped SQL from the menu table, loaded/saved the Access Control page (thus "fixing" the problem,") and dumped the menu table again. Diff shows only one line changed, and that was the datestamp. So that's not where the problem is.
Comment #8
vacilando commentedSubscribing.. I have a very similar problem. See also my post http://drupal.org/comment/reply/188956/619801
Comment #9
icstars commentedi have worked around this problem with a hack. i am under a deadline, so not sure why/how this worked. a guess: at one point we had og turned on with permissions setup so that only group members could see content for their group. when we turned that module off, we cannot see content that should be available to anonymous users. i noticed that a clean d5.3 install had the following row in node_access table that was missing in our post-og database, so i ran an insert statement to put the following back in:
insert into node_acccess(nid, gid, realm, grant_view, grant_update, grant_delete) values('0', '0', 'all', '1', '0', '0');
after that, all the content i had wanted anonymous users to see showed up.
comments welcome on why this worked or warn others on why this was a bonehead move...
Comment #10
yelvington commentedvalues('0', '0', 'all', '1', '0', '0') is the proper state for the node access table unless some other module is intercepting access control. Current OG is supposed to restore these values, as I understand it.
My original issue is different: Those values exist, yet access is denied. I'm leaving this issue open but I suspect my problem may be external to Drupal. I've had several cases of corrupted tables (cache tables) and that makes me wonder if I'm having hardware problems that surface under load. My home server is ancient.
Comment #11
junyor commentedSubscribing.
Comment #12
k4ml commentedAlso got this weird problem yesterday. Digging through user_access() function, I finally found out that "access content" permission is not there in permission table for rid = 1. This after all the "go to admin/user/access", "check/uncheck" the access content permission for anonymous user but it still spit out 403 when trying to access the site as anonymous user. So I manually update the permission table, copying the value from previously backed up db (lucky we have that) but it still won't go. I need to go back to admin/user/access, check/uncheck again the anonymous permission and now it's work !
Very hard to duplicate since I don't even know what cause that. It suddenly happened with a blink of an eye, so to speak.
Comment #13
rocket777 commentedI am having these issues as well.
The site I was working on split into 2, the site with the problem did not need civicrm anymore, so I disabled it and removed the code and databases. I don't know whether this caused it.
We do have OG enabled.
I did not have the following row on node_access values('0', '0', 'all', '1', '0', '0'); so I inserted it as suggested but it did not make a difference.
I opened and saved the admin/user/access page as suggested and it works fine now for anonymous users.
Comment #14
bismigalis commentedTo icstars
Thanks!!! You saved my life.
PS: I have the same problem on Drupal 6.6
Comment #15
hba commentedI'm having the exact same problem: #371993: URL aliases are not available to anonymous users. I'll try icstars' trick and see if it helps.
Comment #16
hba commentedI already had those values in my node_access table. I don't use any node access settings, and the newest node referenced in node_access is quite old.
By the way, this happens for URL aliased nodes with path.module. I've even tried to deinstall that path module, but the aliases are still there. (And they still break after a few hours). The URLs work again when I go to Performance -> clear cache.
I'm on Drupal 6.9, by the way.
Comment #17
drummThis is being reported for 6.x, it should be fixed there and then backported.
Comment #18
hba commentedI've set up an hourly cron job that checks for this error on my site, so that I can reset the cache to make the site work again. These are the times it stopped working the last month:
Sun, 15 Feb 2009 18:13:01 +0100 (CET)
Sun, 15 Feb 2009 19:13:01 +0100 (CET)
Sun, 15 Feb 2009 20:13:02 +0100 (CET)
Wed, 18 Feb 2009 16:13:02 +0100 (CET)
Wed, 18 Feb 2009 17:13:01 +0100 (CET)
Tue, 24 Feb 2009 18:13:01 +0100 (CET)
Tue, 24 Feb 2009 20:13:01 +0100 (CET)
Wed, 25 Feb 2009 16:13:01 +0100 (CET)
Thu, 26 Feb 2009 14:13:01 +0100 (CET)
I haven't really managed to pinpoint what makes the URL aliases stop working for anonymous users. The site does have a higher load around 16-19 every day, but not anything critical. The site is still very responsive.
Comment #19
blakehall commentedThis has recently happened on one of my sites as well...
We've found a fix by patching the node module, specifically node_access_write_grants().
The inline documentation for the $node parameter says:
So why not check, before deleting the record, that the node id is > 0.
Is this a sane fix? I'll be more than happy to provide a patch, unless someone else has another solution...
Comment #20
blakehall commentedThat code should be
Rather than >=
Comment #21
salvisTry to find out what module is calling node_access_write_grants(). It probably shouldn't...
I doubt that your "fix" is correct. It's more likely the caller's fault to pass a 0 $node->nid (possibly a NULL $node).
node_access_write_grants() should never be called by contrib modules, because in any but the trivial cases it may result in inconsistent data in the {node_access} table.
Comment #22
blakehall commentedIn our particular case there are no calls from node_access_write_grants() from anywhere outside of node.module.
While I agree that contrib modules shouldn't be using node_access_write_grants() directly, having this extra layer of security doesn't seem like a bad idea.
Comment #23
salvisCore messing up the {node_access} table? That would be very nasty.
There's only one call to node_access_write_grants() in core, which is in node_access_acquire_grants(). Do you have modules that call node_access_acquire_grants() with a bad $node? Or modules calling node_save() with a bad $node?
It would be good to clear this up...
Comment #24
octothorn commentedI tried everything on this page and nothing worked, but I stumbled upon my own solution for what appears to be a different cause for this problem.
The only thing that worked was for me to open up the permissions (admin/user/permissions), then I changed one of the settings for the anonymous user (to be sure the settings are applied), then save those changes.
After that everything magically worked.
I suspect one of the update scripts for my modules (applied yesterday) screwed up a setting somewhere for permissions, and performing this procedure fixed it.
My thanks, appreciation and respect for the entire drupal community.
Keep sharing the love.
Comment #25
theway commenteddid this via phpmyadmin and worked thank you much
insert into node_acccess(nid, gid, realm, grant_view, grant_update, grant_delete) values('0', '0', 'all', '1', '0', '0');
Comment #26
salvisThis is pretty much the same as disabling node access completely, i.e. you're making everything visible to everyone. If that's your goal, then why not just uninstall all node access modules?
Comment #27
dpatte commentedI've tried everything in above, and also great hints at http://devbee.com/you_are_not_authorized_to_access
Anon users still cant access any pages (except, strangely, a calendar ?? ).
I now have turned off all add-on modules, and still no luck.
Any fresh ideas. I've been searching for hours.
Comment #28
salvisInstall Devel Node Access (part of Devel module, enable its Debug Mode and its second block, look at one node, take a screenshot of the DNA information and post it here.
Comment #29
dpatte commentedI've resolved my no access issue, which was my own fault - not a fault of this upgrade.
Comment #30
petercasier commentedHelped me, and saved my day.
Just a correction on the typo ("access") so novices like me don't get confused:
insert into node_access(nid, gid, realm, grant_view, grant_update, grant_delete) values('0', '0', 'all', '1', '0', '0');
Question is ofcourse what caused this problem...
Comment #31
salvisThe problem is most probably your lack of understanding of how the node access system works.
Follow #28 and study the result, and you will begin to understand...
Inserting a 0/0/all/100 grant is like tearing a hole into a wall because you don't know how to open the door — it's probably not what you want...
Comment #32
plj commentedIssue http://drupal.org/node/282555#comment-2154724 (which at least by the judgement of my quick check looks like a duplicate of this bug) has a comment No. 9, which mentions a way to replicate the issue. May be the answer lies somewhere there?
Comment #33
salvisInteresting — yes, that could explain some of what's reported here, if your set-up really requires a 0/0/all/100 grant. This depends on what node access module(s) you have installed and how you're using it/them.
I believe, the 0/0/all/100 grant should only be present in the {node_access} table when no other grants are there. In that case it can be added safely, but if any other records are in {node_access}, then adding it will expose all of your nodes to everyone and make it impossible for your node access modules to restrict view access to any of your nodes.
See my reply in #282555-10: anonymous disappears from node_access table, gets access denied for all nodes.
Comment #34
gregglesI just posted a patch over in #282555: anonymous disappears from node_access table, gets access denied for all nodes that might help some of the folks here.
I'm tempted to mark these issues as duplicates of each other, but some of the problem descriptions are different enough that I don't think it's 100% clear they are duplicates.
Comment #35
dpearcefl commentedHas this issue been fixed in the latest D6?
Comment #36
dpearcefl commentedComment #37
salvisIf you encounter this issue:
#28: Install Devel Node Access (part of Devel module, enable its Debug Mode and its second block, look at one node, take a screenshot of the DNA information and post it here.