We are getting this error for a specific product in the German and English sales channel in a Shopware 6 catalog:
request.CRITICAL: Uncaught PHP Exception Symfony\Component\Intl\Exception\
MissingResourceException:
"Couldn't read the indices [LocalizedNames][dede] for the locale
"de-DE" in "/var/www/html/example.com/web/vendor/symfony/intl/
Resources/data/
languages". The indices also couldn't be found for the fallback locale(s)
"de", "en", "root"." at
/var/www/html/example.com/web/vendor/symfony/intl/Data/Bundle/Reader/
BundleEntryReader.php line 175 {"exception":"[object]
(Symfony\\Component\\Intl\\Exception\\MissingResourceException(code:
0): Couldn't read the indices [LocalizedNames][dede] for the locale
\"de-DE\" in
\"/var/www/html/example.com/web/vendor/symfony/intl/Resources/data/
languages\". The indices also couldn't be found for the fallback
locale(s) \"de\", \"en\", \"root\". at
/var/www/html/example.com/web/vendor/symfony/intl/
Data/Bundle/Reader/
BundleEntryReader.php:175)\n[previous exception] [object]
(Symfony\\Component\\Intl\\Exception\\
ResourceBundleNotFoundException
(code: 0): The resource bundle
\"/var/www/html/example.com/web/vendor/symfony/intl/Resources/data/
languages/root.php\" does not exist.
at /var/www/html/example.com/web/vendor/symfony/intl/Data/Bundle/
Reader/PhpBundleReader.php:38)"} []
It also does not happen for other products.
We tried to reproduce the issue locally using the same database and code. No luck.
Also we tried refreshing the Shopware indices and cache - the issue persists.
What could be the reason?
Is it related to the system locale?
On both systems de_DE is present:
$ locale -a|grep de_DE
de_DE.utf8
This is caused by providing an invalid value for the translation of language names. It's a feature of Symfony's intl
component.
The exact error can be reproduced like this:
use Symfony\Component\Intl\Languages;
Languages::getName('dede', 'de_DE');
The valid language code in this case would be de
:
Languages::getName('de', 'de_DE');
// Deutsch
So the question is where the false iso language code dede
is coming from.
You may want to check settings for languages and countries if the locales and iso codes are valid. If you do use third party plugins deactivate them one by one to check if one of them causes the error. Just to be sure search the entire codebase for occurrences of dede
. This is not the kind of error that happens by chance.