New Install - 500 err. on adding plugins / using basic http auth

Your software
My Mautic version is: 4.4.1
My PHP version is: 8.0
My Database type and version is: Mysql 8

Your problem
My problem is:

When trying to connect Zapier as a Mautic plugin via HTTP basic auth I get a 500 error.
When trying to connect Autonami (WP plugin) to Mautic via API I get a 500 error.
Wondering if these might be related or if I am doing something wrong

These errors are showing in the log:

1 Autonami WP plugin API connection to Mautic gets the following log:

CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: “FOS\OAuthServerBundle\Controller\AuthorizeController::__construct(): Argument #5 ($tokenStorage) must be of type Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface, Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine given, called in /var/www/html/docroot/app/bundles/ApiBundle/Controller/oAuth2/AuthorizeController.php on line 82” at /var/www/html/vendor/friendsofsymfony/oauth-server-bundle/Controller/AuthorizeController.php line 106 {“exception”:“[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): FOS\OAuthServerBundle\Controller\AuthorizeController::__construct(): Argument #5 ($tokenStorage) must be of type Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface, Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine given, called in /var/www/html/docroot/app/bundles/ApiBundle/Controller/oAuth2/AuthorizeController.php on line 82 at /var/www/html/vendor/friendsofsymfony/oauth-server-bundle/Controller/AuthorizeController.php:106)”} {“hostname”:“localhost”,“pid”:75141}

Zapier Basic HTTP auth gets the following log:

CRITICAL: Uncaught PHP Exception InvalidArgumentException: “The directory “/var/www/html/docroot/var/cache/prod/jms_serializer” is not writable.” at /var/www/html/vendor/jms/metadata/src/Cache/FileCache.php line 49 {“exception”:“[object] (InvalidArgumentException(code: 0): The directory "/var/www/html/docroot/var/cache/prod/jms_serializer" is not writable. at /var/www/html/vendor/jms/metadata/src/Cache/FileCache.php:49)”} {“hostname”:“localhost”,“pid”:92314}

Steps I have tried to fix the problem:
Clearing mautic cache, refresh database schema, restarting, recreating accounts for basic auth, recreating API endpoints for API.

Updating mautic from 3.x → 4.4, completley fresh build.


I am thinking of investigating my permissions more, but I’m new to mautic and I was hoping to meet the community and see if anyone could steer me in the right direction.

thanks!

500 can mean anything. You would need to look at the httpd error log on the server to get more detail on the error. Also check the console on browser to see if it producing any errors while page is loading.

And in your Mautic log, it state one directory is not writable so fix that first to see if it fixes other error. That would be permission related on your web folders.

I got similar error, reported in: OAuth2 authorization problem - Argument 5 passed to AuthorizeController::__construct() must implement interface... · Issue #11426 · mautic/mautic · GitHub

I think reason is in:

[2022-08-31 19:16:54] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Argument 5 passed to FOS\OAuthServerBundle\Controller\AuthorizeController::__construct() must implement interface
Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface, instance of Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine given, called in /home/zycie/mautic_z/docroot/app/bundles/ApiBundle/Controlle
r/oAuth2/AuthorizeController.php on line 82" at /home/zycie/mautic_z/vendor/friendsofsymfony/oauth-server-bundle/Controller/AuthorizeController.php line 106 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowabl
eError(code: 0): Argument 5 passed to FOS\\OAuthServerBundle\\Controller\\AuthorizeController::__construct() must implement interface Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface, instanc
e of Symfony\\Bundle\\FrameworkBundle\\Templating\\DelegatingEngine given, called in /home/zycie/mautic_z/docroot/app/bundles/ApiBundle/Controller/oAuth2/AuthorizeController.php on line 82 at /home/zycie/mautic_z/vendor/friendsofsym
fony/oauth-server-bundle/Controller/AuthorizeController.php:106)"} {"hostname":"server.xyz.com","pid":7061}

Did you get anything in the webserver error log for this?

Still tearing my hair out over it.

I did see in my apache log that doctrine wasnt getting the mysql server version as it wasn’t explicitly set. So i set it, but it didn’t resolve this issue.

Just wondering if you saw anything similar?

Can confirm the same issue here.

Installed via composer, PHP 8.0, NGINX, MySQL 8.

It’s a clean install, and everything else seems to work except API and basic http auth requests fail with the above being reported in the error logs.

Would appreciate a solution too, please.

No

No. Everything else works good.

Just error in mautic as I wrote above.

Pretty annoying because can’t link to the source of email. Now for me it doesn’t have sense using mautic. I hope someone deliver solution.

I am wondering it if because one or more php module is not installed or missing.