Crash creating new email in v7

Your software
My Mautic version is: 7.2.1
My PHP version is: 8.4.27
My Database type and version is: Maria dB 11.4

Your problem
My problem is: When creating a new email and then hitting “Save,” it goes to a “500 Internal Server Error” page.

This was working. The only change that I can think of is the update to PHP 8.4.27 and my host disabled session.upload_progress.enabled for all servers.

These errors are showing in the log:

[2026-10-26T01:33:59.191146+00:00] app.CRITICAL: Uncaught PHP Exception TypeError: “Mautic\FormBundle\Controller\PublicController::previewAction(): Argument #5 ($id) must be of type int, string given, called in /[my site]/mautic/docroot/vendor/symfony/http-kernel/HttpKernel.php on line 183” at /[my site]/mautic/docroot/app/bundles/FormBundle/Controller/PublicController.php line 522 {“exception”:“[object] (TypeError(code: 0): Mautic\FormBundle\Controller\PublicController::previewAction(): Argument #5 ($id) must be of type int, string given, called in /[my site]/mautic/docroot/vendor/symfony/http-kernel/HttpKernel.php on line 183 at /[my site]/mautic/docroot/app/bundles/FormBundle/Controller/PublicController.php:522)”} {“hostname”:“vps.myserver.com”,“pid”:484497}
[2026-10-26T19:02:03.534634+00:00] app.CRITICAL: Uncaught PHP Exception Error: “Class “Symfony\Component\DomCrawler\Crawler” not found” at /[my site]/mautic/docroot/app/bundles/EmailBundle/Validator/ValidEmailLinksValidator.php line 49 {“exception”:“[object] (Error(code: 0): Class “Symfony\Component\DomCrawler\Crawler” not found at /[my site]/mautic/docroot/app/bundles/EmailBundle/Validator/ValidEmailLinksValidator.php:49)”} {“hostname”:“vps.myserver.com”,“pid”:547734}

Steps I have tried to fix the problem:

Cleared cache

Hi Adam
The two log entries appear to describe separate problems.

The session.upload_progress.enabled setting is unrelated to this email-save failure. It only controls PHP upload-progress tracking.

The direct cause of the 500 error is:

Class “Symfony\Component\DomCrawler\Crawler” not found

This means that the runtime Composer dependencies are incomplete. Mautic’s email link validator requires both symfony/dom-crawler and symfony/css-selector.

First verify the installation from the Mautic directory containing composer.json:

php -r 'require "vendor/autoload.php"; $crawler = new Symfony\Component\DomCrawler\Crawler("<a href=\"https://example.com\">x</a>"); echo $crawler->filter("a[href]")->count(), PHP_EOL;'

The expected output is 1.

If the packages are missing, back up composer.json and composer.lock, then install the runtime dependencies:

cp composer.json composer.json.before-dependency-fix
cp composer.lock composer.lock.before-dependency-fix

composer remove --dev symfony/dom-crawler --no-update
composer require symfony/dom-crawler:"~7.4.0" symfony/css-selector:"~7.4.0" --update-no-dev --no-scripts
composer dump-autoload --classmap-authoritative

After that, clear the Mautic cache and restart PHP-FPM and any long-running workers. If this is running in Docker, the change must be included in the image or persistent application volume; installing packages inside a temporary container will be lost after recreation.

The previewAction() error is a separate issue. It shows that a route parameter is arriving as a string while the controller expects an integer. Please check the exact request URL that produces this error and make sure that all Mautic files come from the same 7.2.1 release and that the application cache has been rebuilt.

This is not explained by session.upload_progress.enabled. If the previewAction() error remains after a clean, consistent deployment, it should be reported separately with the full request URL and stack trace.

Thanks for all the troubleshooting info. I should have clarified in my initial post that I installed this site from the zip file and do not have composer installed. However, I can easily copy composer.phar to the Mautic directory if I need to.

I’m unclear, however, if after installing via zip you can run composer commands to install or update things, or if that will mess it up. And, it is strange that the site worked fine previously – can’t think of what would have changed.

Also, please clarify if this is correct for updating:

Composer based install:

php composer.phar update --with-dependencies
php bin/console cache:clear
php bin/console mautic:update:apply --finish
php bin/console doctrine:migration:migrate --no-interaction
php bin/console cache:clear

Zip based install:

php bin/console cache:clear
php bin/console mautic:update:find
php bin/console mautic:update:apply
php bin/console mautic:update:apply –finish
php bin/console cache:clear

Let me know your thoughts. It might be more expedient for me to just do a clean install of 7.2.1 via Composer, and then swap in the existing database. Thanks

It looks like this is related to issue #17592 (fix: make DomCrawler available to production email validation) “Production installations using --no-dev can therefore fail with a 500 when saving an email.”, which you fixed in 7.2.2?

Unfortunately, attempting a clean install of 7.2.2 is creating exceptions due to missing files – created a new topic for that.