Unsubscribe page throws error 500

Your software
My Mautic version is: 2.16.2
My PHP version is: PHP Version 7.2.30

Your problem
My problem is: Unsubscribe page gives error 500

These errors are showing in the log:

[2020-05-18 09:52:03] mautic.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: “Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form).” at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig line 1 {“exception”:"[object] (Twig_Error_Loader(code: 0): Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form). at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig:1)"}
[2020-05-18 09:57:26] mautic.CRITICAL: Uncaught PHP Exception InvalidArgumentException: “The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:47:“dbzcbvta.fifag”;v:4;v:713;}f:8:“fzbvy”;v:482;f:7:“fgbg”;f:55:“8fd58ca9568b1626458417”;f:7:“yfbe”;v:446780;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:482;}} is not a serialized array” at /home/mymautic/public_html/mautic.mymautic.com/app/bundles/CoreBundle/Helper/ClickthroughHelper.php line 46 {“exception”:"[object] (InvalidArgumentException(code: 0): The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:47:“dbzcbvta.fifag”;v:4;v:713;}f:8:“fzbvy”;v:482;f:7:“fgbg”;f:55:“8fd58ca9568b1626458417”;f:7:“yfbe”;v:446780;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:482;}} is not a serialized array at /home/mymautic/public_html/mautic.mymautic.com/app/bundles/CoreBundle/Helper/ClickthroughHelper.php:46)"}
[2020-05-18 09:57:33] mautic.CRITICAL: Uncaught PHP Exception InvalidArgumentException: “The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:47:“dbzcbvta.fifag”;v:4;v:713;}f:8:“fzbvy”;v:482;f:7:“fgbg”;f:55:“8fd58caf12b80479303543”;f:7:“yfbe”;v:446776;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:482;}} is not a serialized array” at /home/mymautic/public_html/mautic.mymautic.com/app/bundles/CoreBundle/Helper/ClickthroughHelper.php line 46 {“exception”:"[object] (InvalidArgumentException(code: 0): The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:47:“dbzcbvta.fifag”;v:4;v:713;}f:8:“fzbvy”;v:482;f:7:“fgbg”;f:55:“8fd58caf12b80479303543”;f:7:“yfbe”;v:446776;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:482;}} is not a serialized array at /home/mymautic/public_html/mautic.mymautic.com/app/bundles/CoreBundle/Helper/ClickthroughHelper.php:46)"}
[2020-05-18 09:59:57] mautic.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: “Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form).” at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig line 1 {“exception”:"[object] (Twig_Error_Loader(code: 0): Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form). at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig:1)"}
[2020-05-18 10:18:20] mautic.CRITICAL: Uncaught PHP Exception InvalidArgumentException: “The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:47:“dbzcbvta.fifag”;v:4;v:713;}f:8:“fzbvy”;v:482;f:7:“fgbg”;f:55:“8fd593e201929524407016”;f:7:“yfbe”;v:447486;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:482;}} is not a serialized array” at /home/mymautic/public_html/mautic.mymautic.com/app/bundles/CoreBundle/Helper/ClickthroughHelper.php line 46 {“exception”:"[object] (InvalidArgumentException(code: 0): The string b:8:{f:9:“fbhedf”;b:5:{v:3;f:47:“dbzcbvta.fifag”;v:4;v:713;}f:8:“fzbvy”;v:482;f:7:“fgbg”;f:55:“8fd593e201929524407016”;f:7:“yfbe”;v:447486;f:0:“dubaafy”;b:4:{f:8:“fzbvy”;v:482;}} is not a serialized array at /home/mymautic/public_html/mautic.mymautic.com/app/bundles/CoreBundle/Helper/ClickthroughHelper.php:46)"}
[2020-05-18 10:23:27] mautic.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: “Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form).” at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig line 1 {“exception”:"[object] (Twig_Error_Loader(code: 0): Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form). at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig:1)"}
[2020-05-18 10:29:41] mautic.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: “Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form).” at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig line 1 {“exception”:"[object] (Twig_Error_Loader(code: 0): Unable to find template “:blank_left:base.html.twig” (looked into: /home/mymautic/public_html/mautic.mymautic.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /home/mymautic/public_html/mautic.mymautic.com/vendor/symfony/twig-bridge/Resources/views/Form). at /home/mymautic/public_html/mautic.mymautic.com/themes/blank_left/html/message.html.twig:1)"}

Steps I have tried to fix the problem:

I have a feeling it has something to do with the PHP Version I am using or one of the components installed with PHP. That a built in function for string contamination is missing (or something like this)

Hello,

Did you manage to know the cause of this error?

I have exactly the same issue

I have exactly the same error. I’m running Mautic 2.16.2 on PHP 7.3

In order to see what is the reason, you need to check the logs, why you get the 500 error.
Check mautic log first. /app/logs I think.

Anyone has any ideas why this is happening ?
I am running Mautic 3.0.1 with php 7.4 and still facing the issue,
error logs shows this:
2021-04-27 12:45:18] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\LoaderError: “Unable to find template “:stnewsletterv2:base.html.twig” (looked into: /var/www/mautic/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /var/www/mautic/vendor/symfony/twig-bridge/Resources/views/Form).” at /var/www/mautic/themes/blank/html/message.html.twig line 1 {“exception”:"[object] (Twig\Error\LoaderError(code: 0): Unable to find template “:stnewsletterv2:base.html.twig” (looked into: /var/www/mautic/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /var/www/mautic/vendor/symfony/twig-bridge/Resources/views/Form). at /var/www/mautic/themes/blank/html/message.html.twig:1)"}

In My case i found the issue, it seems like the default message display of the unsubscribe page tries to find the base and message.html.twig in the theme directory of the email in use, so even if there is no page.html.twig the base.html.twig and message.html.twig file is required else the unsubscribe page comes out to be broken.
Hope this helps someone in future.

2 Likes

Hi, was it a custom theme or a mautic theme?

It was custom theme.