Hi All,
I have a weird problem in the shop. My shop is gone offline with the error log saying Files in the cache folder cannot create (1 time when I deactivated a plugin, 2 times after the cron jobs completed. So not sure which scheduled task made the issue).
When I have this issue, clearing cache will not work. Only solution to fix this is, re-build and upload the plugin(built by me) which add custom style changes to the shop. Initially there was an error showing from a line in my plugin. I fixed it (error was happening when a snippet loading a number. Added the number directly to the view file and now the error is not showing). But now again the same issue happens. But now the error line is from the 3rd party theme Plugin.
Funny thing is, if I build my custom plugin and upload to shop, the error will be fixed. No need to make any change, fix any error. Build and upload the plugin with a new version is all I need to do.
So as I mentioned, previously error was showing from my custom plugin. Now the issue is showing from 3rd party theme Plugin. The line showing error now is loading a snippet (the content of the snippet is empty in the shop).
My problem here is,
- I am not sure what is the reason for the issue here
- I’m not sure how to reproduce the error in my machine to fix the issue. How can I reproduce the issue?
- Is empty/number in a snippet not allowed? What may be the reason snippet loading line trigger a big issue like this? Or the issue is loading from somewhere else?
- I never had this issue in the development period or in the development environment (as far I check), so is it something related to server or production environment?
The error is as follows,
[2025-07-09T01:45:30.704048+00:00] php.ERROR: Warning: include(/var/www/vhosts/domain/var/cache/prod_hffb8b4ff44be3041c902b2186791404a/translations/catalogue.de-DE.aPBPWz+.php): Failed to open stream: No such file or directory {"exception":"[object] (ErrorException(code: 0): Warning: include(/var/www/vhosts/domain/var/cache/prod_hffb8b4ff44be3041c902b2186791404a/translations/catalogue.de-DE.aPBPWz+.php): Failed to open stream: No such file or directory at /var/www/vhosts/domain/vendor/symfony/translation/Translator.php:267)"} []
[2025-07-09T01:45:30.704720+00:00] php.ERROR: Warning: include(): Failed opening '/var/www/vhosts/domain/var/cache/prod_hffb8b4ff44be3041c902b2186791404a/translations/catalogue.de-DE.aPBPWz+.php' for inclusion (include_path='.:/opt/plesk/php/8.2/share/pear') {"exception":"[object] (ErrorException(code: 0): Warning: include(): Failed opening '/var/www/vhosts/domain/var/cache/prod_hffb8b4ff44be3041c902b2186791404a/translations/catalogue.de-DE.aPBPWz+.php' for inclusion (include_path='.:/opt/plesk/php/8.2/share/pear') at /var/www/vhosts/domain/vendor/symfony/translation/Translator.php:267)"} []
[2025-07-09T01:45:30.723991+00:00] request.CRITICAL: Uncaught PHP Exception Shopware\Storefront\Controller\Exception\StorefrontException: "Can not render @TcinnThemeWareElectric/storefront/themeware/twt-base-meta-styles.html.twig view: An exception has been thrown during the rendering of a template ("Symfony\Component\Translation\Translator::getCatalogue(): Return value must be of type Symfony\Component\Translation\MessageCatalogueInterface, bool returned"). with these parameters: {"sendinblueIsPageTrackingEnabled":false,"appShopId":"xxxxxxxxx","themeIconConfig":[],"translateTo":"Deutsch"}" at twt-base-meta-styles.html.twig line 33 {"exception":"[object] (Shopware\\Storefront\\Controller\\Exception\\StorefrontException(code: 0): Can not render @TcinnThemeWareElectric/storefront/themeware/twt-base-meta-styles.html.twig view: An exception has been thrown during the rendering of a template (\"Symfony\\Component\\Translation\\Translator::getCatalogue(): Return value must be of type Symfony\\Component\\Translation\\MessageCatalogueInterface, bool returned\"). with these parameters: {\"sendinblueIsPageTrackingEnabled\":false,\"appShopId\":\"xxxxxxxxx\",\"themeIconConfig\":[],\"translateTo\":\"Deutsch\"} at /var/www/vhosts/domain/custom/plugins/TcinnThemeWareElectric/src/Resources/views/storefront/themeware/twt-base-meta-styles.html.twig:33)\n[previous exception] [object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Symfony\\Component\\Translation\\Translator::getCatalogue(): Return value must be of type Symfony\\Component\\Translation\\MessageCatalogueInterface, bool returned\"). at /var/www/vhosts/domain/custom/plugins/TcinnThemeWareElectric/src/Resources/views/storefront/themeware/twt-base-meta-styles.html.twig:33)\n[previous exception] [object] (TypeError(code: 0): Symfony\\Component\\Translation\\Translator::getCatalogue(): Return value must be of type Symfony\\Component\\Translation\\MessageCatalogueInterface, bool returned at /var/www/vhosts/domain/vendor/symfony/translation/Translator.php:206)"} []
[2025-07-09T01:45:30.733184+00:00] request.CRITICAL: Uncaught PHP Exception TypeError: "Symfony\Component\Translation\Translator::getCatalogue(): Return value must be of type Symfony\Component\Translation\MessageCatalogueInterface, bool returned" at Translator.php line 206 {"exception":"[object] (TypeError(code: 0): Symfony\\Component\\Translation\\Translator::getCatalogue(): Return value must be of type Symfony\\Component\\Translation\\MessageCatalogueInterface, bool returned at /var/www/vhosts/domain/vendor/symfony/translation/Translator.php:206)"} []
[2025-07-09T01:45:31.021178+00:00] php.ERROR: Warning: include(/var/www/vhosts/domain/var/cache/prod_hffb8b4ff44be3041c902b2186791404a/translations/catalogue.de-DE.aPBPWz+.php): Failed to open stream: No such file or directory {"exception":"[object] (ErrorException(code: 0): Warning: include(/var/www/vhosts/domain/var/cache/prod_hffb8b4ff44be3041c902b2186791404a/translations/catalogue.de-DE.aPBPWz+.php): Failed to open stream: No such file or directory at /var/www/vhosts/domain/vendor/symfony/translation/Translator.php:267)"} []
The line showing the error in the theme plugin is as follows (I don't find any issue in the code)
{# ThemeWare: Add CSS code via snippets (v1) @deprecated #}
{% set twtSnippetCssCode = ‚twt.custom.css‘|trans|raw %}
{% if twtCustomCss == 2 and twtSnippetCssCode is not empty and twtExpertMode == 2 %}
<!-- Custom css code (old) -->
<style>{% apply spaceless %}
{{ twtSnippetCssCode }}
{% endapply %}</style>
{% endif %}
The snippet "twt.custom.css" is empty in our shop.
Any help is appreciated.
Thank you