Fatal error: Uncaught Error: Interface 'JsonSerializable'

Your software
My PHP version is :7.4.30
My MySQL/MariaDB version is
Updating/Installing Errors
I am (delete as applicable): Installing
Upgrading/installing via (delete as applicable) :Command Line

These errors are showing in the Mautic log :
Fatal error: Uncaught Error: Interface ‘JsonSerializable’ not found in /web/vendor/sendgrid/sendgrid/lib/helpers/mail/Mail.php:15
Stack trace:
#0 /web/vendor/composer/autoload_real.php(55): require()
#1 /web/vendor/composer/autoload_real.php(38): composerRequirefcf81358727006a9595bdc8216684a1c(‘9dda55337a76a24…’, ‘/web/vendor/com…’)
#2 /web/vendor/autoload.php(12): ComposerAutoloaderInitfcf81358727006a9595bdc8216684a1c::getLoader()
#3 /web/autoload.php(3): require(‘/web/vendor/aut…’)
#4 /web/bin/console(21): require_once(‘/web/autoload.p…’)
#5 {main}
thrown in /web/vendor/sendgrid/sendgrid/lib/helpers/mail/Mail.php on line 15
Your problem
My problem is :

This is a cron job failing. I assume for mailing I have one mail job in the que and it is not succeeding.

Also reported in GitHub

Connecting up for visibility.

Can you double check the PHP version in the system information page for Mautic, just to be sure the correct PHP version is being loaded (sometimes you can get CLI using a different version to the application).


Yes from the system info of mautic it reports PHP Version 7.4.30.

From the cli:

php -v

PHP 7.4.30 (cli) (built: Jun 10 2022 13:33:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.30, Copyright (c), by Zend Technologies

Thanks for looking into this with me!


OK and which version of Mautic are you using, as that was omitted in your original post.

I am using:

Copyright 2022 Mautic. All Rights Reserved.