Error 500 when opening contacts after usage of assets

My Mautic version is: 7.0.1
My PHP version is: 8.4

Your problem
Error 500 after usage of ASSETS.
Usage of assets break opening contact properties afterwards.

Steps to reproduce:
CREATE asset (either local or remote)
SEND email to CONTACT including an asset link
Open email from the contact mailbox (then clic on the asset link, no automation involved)
Go to MAUTIC and open CONTACT properties - ERROR 500

(DELETING the asset solves the problem)

ERROR 500

What does your server’s logs saying?

Yes I got a chance to look into it and in order to fix the bug modify ‘@MauticAsset/Asset/preview.html.twig’ to ‘@MauticAsset/Modules/preview.html.twig’ at AssetBundle/Resources/views/SubscribedEvents/Timeline/index.html.twig line no.3

I can confirm both the problem and the solution (v7.1.0)

mautic.noname_server.es@www:~/mautic/var/logs$ tail -f /home/mautic.noname_server.es/mautic/var/logs/mautic_prod-2026-05-04.php
[2026-05-04T15:51:50.369027+00:00] mautic.ERROR: STAT UPDATE: cURL error 6: Could not resolve host: updates.mautic.org (see libcurl - Error Codes) for https://updates.mautic.org/stats/send {“hostname”:“www.noname_domain.es”,“pid”:3808713}
[2026-05-04T15:51:50.413784+00:00] mautic.ERROR: UPDATE CHECK: cURL error 6: Could not resolve host: api.github.com (see libcurl - Error Codes) for https://api.github.com/repos/mautic/mautic/releases {“hostname”:“www.noname_domain.es”,“pid”:3808713}
[2026-05-04T16:01:40.078483+00:00] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\LoaderError: “Unable to find template “@MauticAsset/Asset/preview.html.twig” (looked into: /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views) in “@MauticAsset/SubscribedEvents/Timeline/index.html.twig” at line 3.” at /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views/SubscribedEvents/Timeline/index.html.twig line 3 {“exception”:“[object] (Twig\Error\LoaderError(code: 0): Unable to find template “@MauticAsset/Asset/preview.html.twig” (looked into: /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views) in “@MauticAsset/SubscribedEvents/Timeline/index.html.twig” at line 3. at /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views/SubscribedEvents/Timeline/index.html.twig:3)”} {“hostname”:“www.noname_domain.es”,“pid”:4062560}
[2026-05-04T16:16:16.661201+00:00] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\LoaderError: “Unable to find template “@MauticAsset/Asset/preview.html.twig” (looked into: /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views) in “@MauticAsset/SubscribedEvents/Timeline/index.html.twig” at line 3.” at /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views/SubscribedEvents/Timeline/index.html.twig line 3 {“exception”:“[object] (Twig\Error\LoaderError(code: 0): Unable to find template “@MauticAsset/Asset/preview.html.twig” (looked into: /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views) in “@MauticAsset/SubscribedEvents/Timeline/index.html.twig” at line 3. at /home/mautic.noname_server.es/mautic/docroot/app/bundles/AssetBundle/Resources/views/SubscribedEvents/Timeline/index.html.twig:3)”} {“hostname”:“www.noname_domain.es”,“pid”:4062561}

Thanks a lot, @ravi_2002 and @ejobs — your fix worked perfectly on my end too (Mautic 7.0.1, PHP 8.4). Confirming for anyone landing here from search.

Before applying it, I caught the exact error in var/logs/mautic_prod-*.php, which matches your diagnosis 1:1:

mautic.CRITICAL: Uncaught PHP Exception Twig\Error\LoaderError:
"Unable to find template '@MauticAsset/Asset/preview.html.twig'
(looked into: .../AssetBundle/Resources/views)
in '@MauticAsset/SubscribedEvents/Timeline/index.html.twig' at line 3."

One extra thing worth flagging: when I opened index.html.twig to apply the fix, I noticed the file also contains a leftover debug line — a literal Hello on line 2:

twig

<div>
Hello
{{- include('@MauticAsset/Asset/preview.html.twig', { ... }) -}}
</div>

It does not cause the 500, but it does render a stray “Hello” in the contact timeline whenever an asset event is shown. Looks like leftover debug code that slipped into the 7.0.1 release. I removed it along with applying the path fix, so my final file looks like:

twig

<div>
{{- include('@MauticAsset/Modules/preview.html.twig', {'activeAsset' : event.extra.asset, 'assetDownloadUrl' : url(
    'mautic_asset_action',
    {'objectAction' : 'preview', 'objectId' : event.extra.asset.getId()}
)}) -}}
</div>

After that and a php bin/console cache:clear --env=prod --no-debug, contact properties open without issues.

Thanks again!