How to solve "Exception: Violation for language value" during Upgrade process?

I'm using the CliUpgrade.php script to upgrade my instance, but I'm getting following error while upgrading to v11:

Starting script 7_RenameModules
ERROR: Exception: Violation for language value
Finished script 7_RenameModules
I looked at the upgrade script 7_RenameModules.php, the script fails at line 36:
$strings = $this->getAppListStrings($langKey);
The method getAppListStrings is defined in the same file on lines 149-157:
/**
* @param string $lang
*
* @return array
*/
protected function getAppListStrings($lang)
{
   return return_app_list_strings_language($lang, false);
The method return_app_list_strings_language is defined in the include\utils.php and executes a language validation at line:
$violations = Validator::getService()->validate($lang, new Language());
if ($violations->count() > 0) {
throw new ViolationException(
'Violation for language value',
$violations
);
}
which throws the Exception above.

I get this error on each upgrade process (v9 -> v10, v10 -> v11) and when I rerun the CliUpgrade.php script with the -S continue argument the upgrade process succeeds without any errors.

Any suggestions on how to solve this? Because it is annoying and irritating.

Thank you in advance.

  • Hello

    From your description, the issue seems related to the following defect #82818( portal.sugarondemand.com/ ).

    To be sure can you restore the languages parameter to the stock value in config.php of a test instance and retry to check if the error persists? 

    These are the default values: 

    'languages' => 
      array (
        'en_us' => 'English (US)',
        'bg_BG' => 'Български',
        'cs_CZ' => 'Česky',
        'da_DK' => 'Dansk',
        'de_DE' => 'Deutsch',
        'el_EL' => 'Ελληνικά',
        'es_ES' => 'Español',
        'fr_FR' => 'Français',
        'he_IL' => 'עברית',
        'hu_HU' => 'Magyar',
        'hr_HR' => 'Hrvatski',
        'it_it' => 'Italiano',
        'lt_LT' => 'Lietuvių',
        'ja_JP' => '日本語',
        'ko_KR' => '한국어',
        'lv_LV' => 'Latviešu',
        'nb_NO' => 'Norsk',
        'nl_NL' => 'Nederlands',
        'pl_PL' => 'Polski',
        'pt_PT' => 'Português',
        'ro_RO' => 'Română',
        'ru_RU' => 'Русский',
        'sv_SE' => 'Svenska',
        'th_TH' => 'ไทย',
        'tr_TR' => 'Türkçe',
        'zh_TW' => '繁體中文',
        'zh_CN' => '简体中文',
        'pt_BR' => 'Português Brasileiro',
        'ca_ES' => 'Català',
        'en_UK' => 'English (UK)',
        'sr_RS' => 'Српски',
        'sk_SK' => 'Slovenčina',
        'sq_AL' => 'Shqip',
        'et_EE' => 'Eesti',
        'es_LA' => 'Español (Latinoamérica)',
        'fi_FI' => 'Suomi',
        'ar_SA' => 'العربية',
        'uk_UA' => 'Українська',
      ),

  • Hi Andre, 

    you're my hero. It worked! Thank you.