After calling drupal_flush_all_caches, menu items with access callback TRUE are giving access denied error I was building a custom module that affected the front page and I found myself having to go clear the caches for it to take effect. So as part of the code, I put in drupal_flush_all_caches().

After I ran the page, my website had all sorts of issues. It seems like any menu item with 'access callback' =&gt; TRUE, is getting access denied errors for any user. These items were working fine before the cache clearing.

Current versions (yes I know I need to upgrade)

Drupal: 6.38
PHP version: 5.6.38
Server: Red Hat Enterprise Linux Server 7.5 x86_64


PHP ini values:

session.cookie_httponly Off
session.use_only_cookies    On
session.cookie_secure   Off
session.hash_function   0
session.cookie_domain   .example.com


Things I have done:


Checked users table for uid of 0 - exists with status of 1, has role of anonymous user, has permission of access content
Repaired database tables
Clear browser cache
Clear drupal cache (/devel/cache/clear)
Rebuild menu (/devel/menu/reset)
Clear db sessions table


Please let me know if you need additional information. Thank you.
The answer lies in some custom code I wrote to understand why some unrelated things were issuing an error. I discovered it was this when I was copying the code to my test site and then putting in this new code which resulted in the same issue on the test site. So that is how I was able to narrow it down. Going forward, I am going to have 3 sites, one for new development, one that mirrors the live site, and the actual live site. The issue comes from being in the middle of upgrading modules on the test site and so I couldn't really use it reliably to test new code, so I would code it on the live site (a big NO-NO and I really shouldn't have done this). The only reason I didn't my custom code was an issue was because I hadn't cleared the cache in a while, so the menu items were still available. 

Maybe this will help someone in there processes to not be dumb like I was.