Your software
My Mautic version is: 5.1.0
My PHP version is: 8.2 - tried 8.0 and 8.1 as well.
My Database type and version is: Mysql 5.7 and tried 8.0 as well
OS : Centos running cpanel. Tried on Alma Linux as well.
Your problem
My problem is: I have been running 4.4 version of Mautic for long time. Yesterday I tried to upgrade mautic to latest version using command line. It failed with Twig error, I then tried and executed the composer update command, but it didn’t help. I tried every possible solution mentioned on the internet but the issue persists. I am not able to run version 5.
These errors are showing in the log:
[2024-09-01T15:19:10.719222+00:00] mautic.CRITICAL: Exception thrown when handling an exception (Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template (“Mautic\CoreBundle\Twig\Extension\AssetExtension::getOverridableUrl(): Return value must be of type string, bool returned”). at /home/insightgenetic/public_html/app/bundles/CoreBundle/Resources/views/Default/head.html.twig line 10) {“exception”:“[object] (Twig\Error\RuntimeError(code: 0): An exception has been thrown during the rendering of a template ("Mautic\CoreBundle\Twig\Extension\AssetExtension::getOverridableUrl(): Return value must be of type string, bool returned"). at /home/insightgenetic/public_html/app/bundles/CoreBundle/Resources/views/Default/head.html.twig:10)\n[previous exception] [object] (TypeError(code: 0): Mautic\CoreBundle\Twig\Extension\AssetExtension::getOverridableUrl(): Return value must be of type string, bool returned at /home/insightgenetic/public_html/app/bundles/CoreBundle/Twig/Extension/AssetExtension.php:132)”} {“hostname”:" “,“pid”:1647}
[2024-09-01T15:19:10.728757+00:00] mautic.ERROR: Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template (“Mautic\CoreBundle\Twig\Extension\AssetExtension::getOverridableUrl(): Return value must be of type string, bool returned”). - in file /home/insightgenetic/public_html/app/bundles/CoreBundle/Resources/views/Default/head.html.twig - at line 10 {“hostname”:” ",“pid”:1647}
Steps I have tried to fix the problem:
Tried command line upgrade steps mentioned on the mautic page.
cleared cache couple of times, before and after upgrade.
deleted cache/prod directory and tried upgrading
ran composer update command with successfull message
Still problem persists.