{"record":{"id":"29685a35533d0548","repo":"apache/dubbo","slug":"illegal-dubbo-config-mode-config-value-configm","errorCode":null,"errorMessage":"Illegal 'dubbo.config.mode' config value [<configModeStr>], available values <Arrays.toString(ConfigMode.values())>","messagePattern":"Illegal 'dubbo\\.config\\.mode' config value \\[<configModeStr>\\], available values <Arrays\\.toString\\(ConfigMode\\.values\\(\\)\\)>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java","lineNumber":130,"sourceCode":"\n    @Override\n    public void initialize() throws IllegalStateException {\n        if (!initialized.compareAndSet(false, true)) {\n            return;\n        }\n        CompositeConfiguration configuration = scopeModel.modelEnvironment().getConfiguration();\n\n        // dubbo.config.mode\n        String configModeStr = (String) configuration.getProperty(ConfigKeys.DUBBO_CONFIG_MODE);\n        try {\n            if (StringUtils.hasText(configModeStr)) {\n                this.configMode = ConfigMode.valueOf(configModeStr.toUpperCase());\n            }\n        } catch (Exception e) {\n            String msg = \"Illegal '\" + ConfigKeys.DUBBO_CONFIG_MODE + \"' config value [\" + configModeStr\n                    + \"], available values \" + Arrays.toString(ConfigMode.values());\n            logger.error(COMMON_PROPERTY_TYPE_MISMATCH, \"\", \"\", msg, e);\n            throw new IllegalArgumentException(msg, e);\n        }\n\n        // dubbo.config.ignore-duplicated-interface\n        String ignoreDuplicatedInterfaceStr =\n                (String) configuration.getProperty(ConfigKeys.DUBBO_CONFIG_IGNORE_DUPLICATED_INTERFACE);\n        if (ignoreDuplicatedInterfaceStr != null) {\n            this.ignoreDuplicatedInterface = Boolean.parseBoolean(ignoreDuplicatedInterfaceStr);\n        }\n\n        // print\n        Map<String, Object> map = new LinkedHashMap<>();\n        map.put(ConfigKeys.DUBBO_CONFIG_MODE, configMode);\n        map.put(ConfigKeys.DUBBO_CONFIG_IGNORE_DUPLICATED_INTERFACE, this.ignoreDuplicatedInterface);\n        logger.info(\"Config settings: \" + map);\n    }\n\n    /**\n     * Add the dubbo {@link AbstractConfig config}","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java#L112-L148","documentation":"Thrown by AbstractConfigManager constructor when the 'dubbo.config.mode' property cannot be parsed into a ConfigMode enum value. ConfigMode controls how duplicate unique configs are handled and accepts: STRICT, OVERRIDE, OVERRIDE_ALL, OVERRIDE_IF_ABSENT, IGNORE. The value is uppercased before parsing, so a totally unrecognized token causes IllegalArgumentException wrapping the original EnumParseException.","triggerScenarios":"Setting -Ddubbo.config.mode=strict_mode, dubbo.properties dubbo.config.mode=relaxed, or any string that is not (case-insensitively) one of the five enum constants. Whitespace-embedded values also fail.","commonSituations":"Using a value from documentation for a different version. Typos like 'overide'. Setting it to a custom mode name assuming extensibility.","solutions":["Use one of: STRICT, OVERRIDE, OVERRIDE_ALL, OVERRIDE_IF_ABSENT, IGNORE (case-insensitive).","Remove the property to accept the default mode if unsure.","Check for trailing whitespace or quotes in the property source."],"exampleFix":"# before\ndubbo.config.mode=strict_mode\n# after\ndubbo.config.mode=STRICT","handlingStrategy":"validation","validationCode":"import org.apache.dubbo.config.context.ConfigMode;\nimport java.util.Arrays;\n\nString raw = System.getProperty(\"dubbo.config.mode\");\nif (raw != null && !raw.isBlank()) {\n    try {\n        ConfigMode.valueOf(raw.toUpperCase());\n    } catch (IllegalArgumentException e) {\n        throw new IllegalArgumentException(\"Invalid dubbo.config.mode: \" + raw\n            + \". Allowed: \" + Arrays.toString(ConfigMode.values()));\n    }\n}","typeGuard":"static boolean isValidConfigMode(String s) {\n    if (s == null || s.isBlank()) return true;\n    try { ConfigMode.valueOf(s.toUpperCase()); return true; } catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    // trigger config manager init\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"dubbo.config.mode\")) {\n        System.clearProperty(\"dubbo.config.mode\"); // fall back to default\n    } else throw e;\n}","preventionTips":["Keep config mode values in a shared constant.","Validate the property in a startup health check.","Avoid trailing whitespace/quotes in properties files."],"tags":["config","config-mode","properties","validation"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}