Twig\Error\RuntimeError after updating to 5.1.0

Your software
My Mautic version is: 5.1.0
My PHP version is: PHP 8.0.30 (cli) (built: Jun 6 2024 16:44:55) ( NTS )
My Database type and version is: Server version: 10.5.23-MariaDB-0+deb11u1 Debian 11

Your problem
My problem is: I get the following error after updating to Version 5.1.0 from 5.0.3.
When I open the Contacts it says Internal Server error 500, when i check the Log files it shows this:

[2024-06-13T10:25:07.429318+00:00] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: “An exception has been thrown during the rendering of a template (“Unable to generate a URL for the named route “mautic_tagmanager_batch_index_action” as such route does not exist.”).” at /var/www/mautic/docroot/app/bundles/LeadBundle/Resources/views/Lead/_list.html.twig line 2 {“exception”:“[object] (Twig\Error\RuntimeError(code: 0): An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "mautic_tagmanager_batch_index_action" as such route does not exist."). at /var/www/mautic/docroot/app/bundles/LeadBundle/Resources/views/Lead/_list.html.twig:2)\n[previous exception] [object] (Symfony\Component\Routing\Exception\RouteNotFoundException(code: 0): Unable to generate a URL for the named route "mautic_tagmanager_batch_index_action" as such route does not exist. at /var/www/mautic/vendor/symfony/routing/Generator/CompiledUrlGenerator.php:50)”} {“hostname”:“marketing”,“pid”:4059503}

These errors are showing in the log:
[2024-06-13T10:25:07.429318+00:00] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: “An exception has been thrown during the rendering of a template (“Unable to generate a URL for the named route “mautic_tagmanager_batch_index_action” as such route does not exist.”).” at /var/www/mautic/docroot/app/bundles/LeadBundle/Resources/views/Lead/_list.html.twig line 2 {“exception”:“[object] (Twig\Error\RuntimeError(code: 0): An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "mautic_tagmanager_batch_index_action" as such route does not exist."). at /var/www/mautic/docroot/app/bundles/LeadBundle/Resources/views/Lead/_list.html.twig:2)\n[previous exception] [object] (Symfony\Component\Routing\Exception\RouteNotFoundException(code: 0): Unable to generate a URL for the named route "mautic_tagmanager_batch_index_action" as such route does not exist. at /var/www/mautic/vendor/symfony/routing/Generator/CompiledUrlGenerator.php:50)”} {“hostname”:“marketing”,“pid”:4059503}

How can i solve this?

Hi there,

Thanks for reporting this, have you cleared the Mautic cache and does that make any difference? Thanks!

I did clear the cache, but unfortunately it did not make any difference.

Do you see this line in this file?

Hi @escopecz

I just checked the file and it was actually missing. This section from line 10 to 17 was missing:

        'mautic_tagmanager_batch_index_action' => [
            'path'       => '/tags/batch/view',
            'controller' => 'MauticPlugin\MauticTagManagerBundle\Controller\BatchTagController::indexAction',
        ],
        'mautic_tagmanager_batch_set_action' => [
            'path'       => '/tags/batch/set',
            'controller' => 'MauticPlugin\MauticTagManagerBundle\Controller\BatchTagController::execAction',
        ],

After I added those lines, cleared the Cache it all works now.

Thanks for the fast help