- ππ°Hong Kong VortexCentrum
D10.0.1 (or might be 10.0.2 - I did a Composer update but Drupal is still reporting the previous version).
I have cleared Drupal, server and local caches often.
NO anonymous access to any pages. Access Denied.
Path: /publications/web/front. Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 112 of [redacted]/publications/web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).
Line 112 says
throw new CacheableAccessDeniedHttpException($access_result, $access_result instanceof AccessResultReasonInterface ? $access_result->getReason() : '');Looking at the logs, it seems that the exception report is logged for all my activity as admin, too,
.htaccess has been replicated from another site that works. Includes "allow from all" but in any case, that can't be the problem because the site is loading, then refusing access. So it's an internal Drupal problem.
I have not tampered with Drupal's own .htaccess because I've never needed to in the past.
Tried No. 8 and gained anonymous access but, as the warning note says, it gave anonymous users full edit/delete control over content. So I undid that.
Didn't try No. 9 - too many "routing.yml" files. The risk of chaos is too great.
Given this, it appears that the issue comes down to permissions.
Next: I still had the page open from when I tested solution #8. So I went to nodeaccess settings. Granted anonymous access to nodes of that type, went to the page and refreshed. Once more, access denied.
One odd thing has been the frequency of "rebuild permissions" warnings.
I've used NodeAccess since the early days of D7.
It turns out that the solution to this problem is to uninstall NodeAccess.
Losing the functionality I'm used to is a pain but it's better than having a website no one can enter.
And it takes one minute instead of the seven hours I've spent looking for the solution to the original problem.
Hope this helps others.
- ππΊHungary karol haltenberger
I had the same error message suddenly appear and it only took me a couple of hours to figure out that the indentation in my my route definition was off XD
- π©πͺGermany TamB
For anyone with the Nodeaccess module: rebuilding the node permissions solved this problem for me.
Go to /admin/reports/status and scroll down to Node Access Permissions. There is a link 'Rebuild permissions'. Click on it. Depending on how many permissions you have, it could take a few second to a few minutes.
- π¨π³China hongqing
I encountered the issue after add products to drupal commerce, it happens sometimes, I am not sure which action triggers the issues.
Path: /. Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 115 of /www/wwwroot/xxxx/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).
- π¨π³China hongqing
I found this issues is closed because issue #3257541 fixed. I do no think they are the same issues. #3257541 is about the log, while the issue here is user cannot access even being granted permissions.