GrapeJS not working after fresh install

Mautic version: 4.4.12
My PHP version is : 7.4
My MySQL version is 8.0.37

I have similar issue as in this topic: Landing Page Builder in 4.1.1 not working
when i try to create email with theme in Grape JS builder, it is blank - no matter if its custom theme or built-in

I installed Mautic yesterday on cpanel
this is example log i get after opening Builder:
mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to create the cache directory (/home/…/public_html/mautic.com/app/…/var/tmp/twig/98).” at /home/…/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php line 53 {“exception”:“[object] (RuntimeException(code: 0): Unable to create the cache directory (/home/…/public_html/mautic.com/app/…/var/tmp/twig/98). at /home/…/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php:53)”} {“hostname”:“my-cpanel.com”,“pid”:66650}
i get few errors like this every time, only number at the end of ‘var/tmp/twig/98’ and pid change

i tried clearing cache but it only made /var/tmp/twig/ empty and logs changed from “Unable to write in the cache directory” to "Unable to create the cache directory "
also i ran php bin/console mautic:assets:generate --env=prod, but it didnt resolve the issue either

is there anything I can do, or must I update Mautic to 5.x and try MJML builder?

and before question will appear: yes, i have grapejs enabled.
also, now i know that what is appearing is legacy builder, but as it can be seen, it does not work properly either

Guys, I have solution
Today log was:
[2024-06-28 14:17:03] mautic.WARNING: PHP Warning - file_put_contents(/home/user/public_html/mautic.com/var/cache/prod/lastUpdateCheck.txt): failed to open stream: Permission denied - in file /home/user/public_html/mautic.com/app/bundles/CoreBundle/Helper/UpdateHelper.php - at line 195 {“overrideCache”:false,“cacheFile”:“/home/user/public_html/mautic.com/var/cache/prod/lastUpdateCheck.txt”,“updateStability”:“stable”,“exception”:“[object] (Mautic\CoreBundle\Helper\Update\Exception\UpdateCacheDataNeedsToBeRefreshedException(code: 0): at /home/user/public_html/mautic.com/app/bundles/CoreBundle/Helper/UpdateHelper.php:315)”,“release”:“[object] (Mautic\CoreBundle\Helper\Update\Github\Release: {})”,“data”:{“error”:false,“message”:“mautic.core.updater.update.available”,“version”:“5.1.0”,“announcement”:“https://github.com/mautic/mautic/releases/tag/5.1.0",“package”:“https://github.com/mautic/mautic/releases/download/5.1.0/5.1.0-update.zip”,“stability”:“stable”,“checkedTime”:1719577023,“metadata”:"[object] (Mautic\CoreBundle\Release\Metadata: {"version":"5.1.0","stability":"stable","minimum_php_version":"8.0.2","maximum_php_version":"8.2.99","show_php_version_warning_if_under":"8.0.2","minimum_mautic_version":"4.4.10","announcement_url":"https://github.com/mautic/mautic/releases/tag/5.1.0\“,\“minimum_mysql_version\”:\“5.7.14\”,\“minimum_mariadb_version\”:\“10.2.7\”})”}} {“hostname”:“my-cpanel”,“pid”:596344} [2024-06-28 14:17:04] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/home/user/public_html/mautic.com/app/…/var/tmp/twig/18).” at /home/user/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php line 57 {“exception”:”[object] (RuntimeException(code: 0): Unable to write in the cache directory (/home/user/public_html/mautic.com/app/…/var/tmp/twig/18). at /home/user/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php:57)“} {“hostname”:“my-cpanel”,“pid”:596380} [2024-06-28 14:17:09] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/home/user/public_html/mautic.com/app/…/var/tmp/twig/ad).” at /home/user/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php line 57 {“exception”:”[object] (RuntimeException(code: 0): Unable to write in the cache directory (/home/user/public_html/mautic.com/app/…/var/tmp/twig/ad). at /home/user/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php:57)“} {“hostname”:“my-cpanel”,“pid”:596344} [2024-06-28 14:17:10] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/home/user/public_html/mautic.com/app/…/var/tmp/twig/18).” at /home/user/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php line 57 {“exception”:”[object] (RuntimeException(code: 0): Unable to write in the cache directory (/home/user/public_html/mautic.com/app/…/var/tmp/twig/18). at /home/user/public_html/mautic.com/vendor/twig/twig/src/Cache/FilesystemCache.php:57)“} {“hostname”:“my-cpanel”,“pid”:596380} [2024-06-28 14:17:14] mautic.WARNING: PHP Warning - file_put_contents(/home/user/public_html/mautic.com/var/cache/prod/lastUpdateCheck.txt): failed to open stream: Permission denied - in file /home/user/public_html/mautic.com/app/bundles/CoreBundle/Helper/UpdateHelper.php - at line 195 {“overrideCache”:false,“cacheFile”:”/home/user/public_html/mautic.com/var/cache/prod/lastUpdateCheck.txt",“updateStability”:“stable”,“exception”:“[object] (Mautic\CoreBundle\Helper\Update\Exception\UpdateCacheDataNeedsToBeRefreshedException(code: 0): at /home/user/public_html/mautic.com/app/bundles/CoreBundle/Helper/UpdateHelper.php:315)”,“release”:“[object] (Mautic\CoreBundle\Helper\Update\Github\Release: {})”,“data”:{“error”:false,“message”:“mautic.core.updater.update.available”,“version”:“5.1.0”,“announcement”:"https://github.com/mautic/mautic/releases/tag/5.1.0",“package”:“https://github.com/mautic/mautic/releases/download/5.1.0/5.1.0-update.zip”,“stability”:“stable”,“checkedTime”:1719577034,“metadata”:"[object] (Mautic\CoreBundle\Release\Metadata: {"version":"5.1.0","stability":"stable","minimum_php_version":"8.0.2","maximum_php_version":"8.2.99","show_php_version_warning_if_under":"8.0.2","minimum_mautic_version":"4.4.10","announcement_url":"https://github.com/mautic/mautic/releases/tag/5.1.0\“,\“minimum_mysql_version\”:\“5.7.14\”,\“minimum_mariadb_version\”:\“10.2.7\”})”}} {“hostname”:“my-cpanel”,“pid”:596344}

what i did next was changing permissions:
sudo chown -R www-data:www-data path/to/mautic
sudo chmod -R 775 path/to/mautic/var/cache
sudo chmod -R 775 path/to/mautic/var/tmp

and my grape js now works fine
topic is ready to be closed :slight_smile:

1 Like

Thanks for reporting back the solution!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.