Mautic Community Forums

Can't download any themes and can't use new themes

Your software
My Mautic version is:3.2.1
My PHP version is: PHP Version 7.3.27-1~deb10u1
My Database type and version is: MariaDB

Your problem
My problem is: New themes install but don’t work. Existing themes do not download

These errors are showing in the log:

[2022-01-12 19:25:57] mautic.CRITICAL: Uncaught PHP Exception UnexpectedValueException: “The Response content must be a string or object implementing __toString(), “boolean” given.” at /var/www/html/vendor/symfony/http-foundation/Response.php line 399 {“exception”:"[object] (UnexpectedValueException(code: 0): The Response content must be a string or object implementing __toString(), “boolean” given. at /var/www/html/vendor/symfony/http-foundation/Response.php:399)"}
[2022-01-12 19:26:07] mautic.WARNING: PHP Warning - ZipArchive::close(): Failure to create temporary file: Permission denied - in file /var/www/html/app/bundles/CoreBundle/Helper/ThemeHelper.php - at line 560 {“themeName”:“aurora”,“themePath”:"/var/www/html/themes/aurora",“tmpPath”:"/var/www/html/var/cache/prod/tmp_aurora.zip",“zipper”:"[object] (ZipArchive: {“status”:12,“statusSys”:13,“numFiles”:28,“filename”:"/var/www/html/var/cache/prod/tmp_aurora.zip",“comment”:""})",“finder”:"[object] (Symfony\Component\Finder\Finder: {})",“archive”:true,“file”:"[object] (Symfony\Component\Finder\SplFileInfo: /var/www/html/themes/aurora/html/email.html.twig)",“filePath”:"/var/www/html/themes/aurora/html/email.html.twig",“localPath”:“html/email.html.twig”}
[2022-01-12 19:26:07] mautic.WARNING: PHP Warning - filesize(): stat failed for /var/www/html/var/cache/prod/tmp_aurora.zip - in file /var/www/html/app/bundles/CoreBundle/Controller/ThemeController.php - at line 167 {“themeName”:“aurora”,“themeHelper”:"[object] (Mautic\CoreBundle\Helper\ThemeHelper: {})",“flashes”:,“error”:false,“zipPath”:"/var/www/html/var/cache/prod/tmp_aurora.zip",“response”:"[object] (Symfony\Component\HttpFoundation\Response: HTTP/1.0 200 OK\r\nCache-Control: no-cache, private\r\nContent-Type: application/octet-stream\r\nDate: Wed, 12 Jan 2022 19:26:07 GMT\r\n\r\n)"}
[2022-01-12 19:26:07] mautic.WARNING: PHP Warning - file_get_contents(/var/www/html/var/cache/prod/tmp_aurora.zip): failed to open stream: No such file or directory - in file /var/www/html/app/bundles/CoreBundle/Controller/ThemeController.php - at line 175 {“themeName”:“aurora”,“themeHelper”:"[object] (Mautic\CoreBundle\Helper\ThemeHelper: {})",“flashes”:,“error”:false,“zipPath”:"/var/www/html/var/cache/prod/tmp_aurora.zip",“response”:"[object] (Symfony\Component\HttpFoundation\Response: HTTP/1.0 200 OK\r\nCache-Control: no-cache, private\r\nContent-Disposition: attachment;filename=“aurora.zip”\r\nContent-Length: \r\nContent-Type: application/octet-stream\r\nDate: Wed, 12 Jan 2022 19:26:07 GMT\r\n\r\n)",“stream”:0}
[2022-01-12 19:26:07] mautic.CRITICAL: Uncaught PHP Exception UnexpectedValueException: “The Response content must be a string or object implementing __toString(), “boolean” given.” at /var/www/html/vendor/symfony/http-foundation/Response.php line 399 {“exception”:"[object] (UnexpectedValueException(code: 0): The Response content must be a string or object implementing __toString(), “boolean” given. at /var/www/html/vendor/symfony/http-foundation/Response.php:399)"}
[2022-01-12 19:26:17] mautic.WARNING: PHP Warning - ZipArchive::close(): Failure to create temporary file: Permission denied - in file /var/www/html/app/bundles/CoreBundle/Helper/ThemeHelper.php - at line 560 {“themeName”:“sunday”,“themePath”:"/var/www/html/themes/sunday",“tmpPath”:"/var/www/html/var/cache/prod/tmp_sunday.zip",“zipper”:"[object] (ZipArchive: {“status”:12,“statusSys”:13,“numFiles”:15,“filename”:"/var/www/html/var/cache/prod/tmp_sunday.zip",“comment”:""})",“finder”:"[object] (Symfony\Component\Finder\Finder: {})",“archive”:true,“file”:"[object] (Symfony\Component\Finder\SplFileInfo: /var/www/html/themes/sunday/html/email.html.twig)",“filePath”:"/var/www/html/themes/sunday/html/email.html.twig",“localPath”:“html/email.html.twig”}
[2022-01-12 19:26:17] mautic.WARNING: PHP Warning - filesize(): stat failed for /var/www/html/var/cache/prod/tmp_sunday.zip - in file /var/www/html/app/bundles/CoreBundle/Controller/ThemeController.php - at line 167 {“themeName”:“sunday”,“themeHelper”:"[object] (Mautic\CoreBundle\Helper\ThemeHelper: {})",“flashes”:,“error”:false,“zipPath”:"/var/www/html/var/cache/prod/tmp_sunday.zip",“response”:"[object] (Symfony\Component\HttpFoundation\Response: HTTP/1.0 200 OK\r\nCache-Control: no-cache, private\r\nContent-Type: application/octet-stream\r\nDate: Wed, 12 Jan 2022 19:26:17 GMT\r\n\r\n)"}
[2022-01-12 19:26:17] mautic.WARNING: PHP Warning - file_get_contents(/var/www/html/var/cache/prod/tmp_sunday.zip): failed to open stream: No such file or directory - in file /var/www/html/app/bundles/CoreBundle/Controller/ThemeController.php - at line 175 {“themeName”:“sunday”,“themeHelper”:"[object] (Mautic\CoreBundle\Helper\ThemeHelper: {})",“flashes”:,“error”:false,“zipPath”:"/var/www/html/var/cache/prod/tmp_sunday.zip",“response”:"[object] (Symfony\Component\HttpFoundation\Response: HTTP/1.0 200 OK\r\nCache-Control: no-cache, private\r\nContent-Disposition: attachment;filename=“sunday.zip”\r\nContent-Length: \r\nContent-Type: application/octet-stream\r\nDate: Wed, 12 Jan 2022 19:26:17 GMT\r\n\r\n)",“stream”:0}
[2022-01-12 19:26:17] mautic.CRITICAL: Uncaught PHP Exception UnexpectedValueException: “The Response content must be a string or object implementing __toString(), “boolean” given.” at /var/www/html/vendor/symfony/http-foundation/Response.php line 399 {“exception”:"[object] (UnexpectedValueException(code: 0): The Response content must be a string or object implementing __toString(), “boolean” given. at /var/www/html/vendor/symfony/http-foundation/Response.php:399)"}
[2022-01-12 19:34:42] mautic.WARNING: PHP Warning - ZipArchive::close(): Failure to create temporary file: Permission denied - in file /var/www/html/app/bundles/CoreBundle/Helper/ThemeHelper.php - at line 560 {“themeName”:“html_plain_text”,“themePath”:"/var/www/html/themes/html_plain_text",“tmpPath”:"/var/www/html/var/cache/prod/tmp_html_plain_text.zip",“zipper”:"[object] (ZipArchive: {“status”:12,“statusSys”:13,“numFiles”:7,“filename”:"/var/www/html/var/cache/prod/tmp_html_plain_text.zip",“comment”:""})",“finder”:"[object] (Symfony\Component\Finder\Finder: {})",“archive”:true,“file”:"[object] (Symfony\Component\Finder\SplFileInfo: /var/www/html/themes/html_plain_text/html/email.html.twig)",“filePath”:"/var/www/html/themes/html_plain_text/html/email.html.twig",“localPath”:“html/email.html.twig”}
[2022-01-12 19:34:42] mautic.WARNING: PHP Warning - filesize(): stat failed for /var/www/html/var/cache/prod/tmp_html_plain_text.zip - in file /var/www/html/app/bundles/CoreBundle/Controller/ThemeController.php - at line 167 {“themeName”:“html_plain_text”,“themeHelper”:"[object] (Mautic\CoreBundle\Helper\ThemeHelper: {})",“flashes”:,“error”:false,“zipPath”:"/var/www/html/var/cache/prod/tmp_html_plain_text.zip",“response”:"[object] (Symfony\Component\HttpFoundation\Response: HTTP/1.0 200 OK\r\nCache-Control: no-cache, private\r\nContent-Type: application/octet-stream\r\nDate: Wed, 12 Jan 2022 19:34:42 GMT\r\n\r\n)"}
[2022-01-12 19:34:42] mautic.WARNING: PHP Warning - file_get_contents(/var/www/html/var/cache/prod/tmp_html_plain_text.zip): failed to open stream: No such file or directory - in file /var/www/html/app/bundles/CoreBundle/Controller/ThemeController.php - at line 175 {“themeName”:“html_plain_text”,“themeHelper”:"[object] (Mautic\CoreBundle\Helper\ThemeHelper: {})",“flashes”:,“error”:false,“zipPath”:"/var/www/html/var/cache/prod/tmp_html_plain_text.zip",“response”:"[object] (Symfony\Component\HttpFoundation\Response: HTTP/1.0 200 OK\r\nCache-Control: no-cache, private\r\nContent-Disposition: attachment;filename=“html_plain_text.zip”\r\nContent-Length: \r\nContent-Type: application/octet-stream\r\nDate: Wed, 12 Jan 2022 19:34:42 GMT\r\n\r\n)",“stream”:0}
[2022-01-12 19:34:42] mautic.CRITICAL: Uncaught PHP Exception UnexpectedValueException: “The Response content must be a string or object implementing __toString(), “boolean” given.” at /var/www/html/vendor/symfony/http-foundation/Response.php line 399 {“exception”:"[object] (UnexpectedValueException(code: 0): The Response content must be a string or object implementing __toString(), “boolean” given. at /var/www/html/vendor/symfony/http-foundation/Response.php:399)"}
[2022-01-12 19:35:22] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/18).” at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php line 61 {“exception”:"[object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/18). at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php:61)"}
[2022-01-12 19:36:22] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/18).” at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php line 61 {“exception”:"[object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/18). at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php:61)"}
[2022-01-12 19:41:32] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/e1).” at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php line 61 {“exception”:"[object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/e1). at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php:61)"}
[2022-01-12 20:17:02] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/18).” at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php line 61 {“exception”:"[object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/18). at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php:61)"}
[2022-01-12 20:17:27] mautic.CRITICAL: Uncaught PHP Ex

Steps I have tried to fix the problem: Have cleared cache with : /var/www/html/bin/console cache:clear which ran fine.

The 2 themes I was wanting to try are:

https://cdn.devsrealm.com/wp-content/uploads/2020/12/html_plain_text.zip

My son is the server admin and he added a swap file as clearing cache command initially gave out of memory error. After swap file setup clear cache ran without error.

Any ideas please?

Thank you

Paul

I saw couple of permission errors in the log. This happens very often if the linux user running mautic doesn’t have the access to certain folders. Plz ask your son to chown the directory, run the cache clearing command as the user who runs Mautic and try again.

Thank you! That does seem to have worked. I can now use the new themes and download themes. Thanks again.