Skip to main content
Updated to show D9 backtrace. (The same problem is still happening with D9.)
Source Link

I have a few webforms on my D8D9 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (line 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

  Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException->__construct() (Line: 118)
Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 9495)
    Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 113112)
    Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 111142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127145)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 6881)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 5758)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 4748)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 4748)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 5251)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708718)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.

I have a few webforms on my D8 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (line 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

    Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 94)
    Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 113)
    Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.

I have a few webforms on my D9 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (line 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException->__construct() (Line: 118)
Drupal\Core\Routing\AccessAwareRouter->checkAccess() (Line: 95)
Drupal\Core\Routing\AccessAwareRouter->matchRequest() (Line: 112)
Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 145)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch() (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup() (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.

edited body
Source Link

I have a few webforms on my D8 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in *Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (*lineline 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

    Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 94)
    Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 113)
    Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.

I have a few webforms on my D8 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in *Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (*line 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

    Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 94)
    Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 113)
    Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.

I have a few webforms on my D8 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (line 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

    Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 94)
    Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 113)
    Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.

Source Link

webform contact form gives access denied for anonymous users

I have a few webforms on my D8 site. They all work for anonymous site visitors except for the contact form, which gives an "access denied" error.

The permissions under the form's Settings->Access tab are the same as for other forms that do work.

The form's access permissions are set to allow anonymous / authenticated / admin users to create and view/ update own submissions: Create submissions: Roles: anonymous user, authenticated user, administrator

View/ Update Own Submissions: anonymous, authenticated, administrator

I did search for the solution but what I found didn't help. I tried the debugging code from https://drupal.stackexchange.com/a/315766 and get the following messages:

The website encountered an unexpected error. Please try again later.

Exception: ACCESS DENIED: in *Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException->__construct() (*line 28 of /path/to/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php).

    Drupal\Core\Routing\AccessAwareRouter->checkAccess(Object) (Line: 94)
    Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 113)
    Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what this all means. Where do I go from here? Thank you.