{"record":{"id":"5cabf71552a235ca","repo":"apache/incubator-seata","slug":"not-support-config-data-type-type-s","errorCode":null,"errorMessage":"not support config data type type: %s","messagePattern":"not support config data type type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"config/seata-config-core/src/main/java/org/apache/seata/config/processor/ConfigDataType.java","lineNumber":54,"sourceCode":"    private String[] suffix;\n\n    ConfigDataType(String... suffix) {\n        this.suffix = suffix;\n    }\n\n    /**\n     * Gets type.\n     *\n     * @param name the name\n     * @return the type\n     */\n    public static ConfigDataType getType(String name) {\n        for (ConfigDataType configDataType : values()) {\n            if (configDataType.name().equalsIgnoreCase(name)) {\n                return configDataType;\n            }\n        }\n        throw new IllegalArgumentException(\"not support config data type type: \" + name);\n    }\n\n    /**\n     * Gets type by suffix.\n     *\n     * @param suffix the suffix\n     * @return the type\n     */\n    public static ConfigDataType getTypeBySuffix(String suffix) {\n        for (ConfigDataType configDataType : values()) {\n            for (String sfx : configDataType.suffix) {\n                if (sfx.equals(suffix)) {\n                    return configDataType;\n                }\n            }\n        }\n        throw new IllegalArgumentException(\"not support config data type suffix: \" + suffix);\n    }","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/config/seata-config-core/src/main/java/org/apache/seata/config/processor/ConfigDataType.java#L36-L72","documentation":"Thrown by ConfigDataType.getType(String name) when the requested config data type name matches neither enum constant (only 'yaml' and 'properties' exist). Seata's configuration processor layer uses this lookup to pick a parser for configuration file content, so an unrecognized name aborts config loading at startup with an IllegalArgumentException.","triggerScenarios":"Calling ConfigDataType.getType(name) with any string other than 'yaml' or 'properties' (case-insensitive), e.g. 'json', 'yml', 'xml', null, or a typo like 'prop'. Typically reached indirectly when a custom data-type property is passed into the config processor chain.","commonSituations":"Setting a config file type of 'yml' instead of 'yaml', assuming JSON config files are supported, or passing the file extension where the type name is expected. Also occurs after upgrading Seata when a previously accepted type token is no longer valid.","solutions":["Set the data type name to exactly 'yaml' or 'properties' (case-insensitive)","If you have a '.yml' file, use the suffix-based lookup getTypeBySuffix('yml') or rename the file to .yaml","If you need JSON or another format, extend ConfigDataType with a new enum constant and a matching ConfigProcessor rather than passing an unknown name","Check for leading/trailing whitespace or null in the value read from your config file"],"exampleFix":"// before\nConfigDataType type = ConfigDataType.getType(\"yml\"); // throws\n\n// after\nConfigDataType type = ConfigDataType.getTypeBySuffix(\"yml\"); // -> yaml\n// or\nConfigDataType type = ConfigDataType.getType(\"yaml\");","handlingStrategy":"validation","validationCode":"static final Set<String> VALID = Stream.of(ConfigDataType.values()).map(Enum::name).collect(Collectors.toSet());\nif (!VALID.contains(name.toUpperCase())) throw new IllegalArgumentException(\"Unsupported: \" + name + \", valid: \" + VALID);","typeGuard":"boolean isSupportedDataType(String name) {\n    return Arrays.stream(ConfigDataType.values()).anyMatch(t -> t.name().equalsIgnoreCase(name));\n}","tryCatchPattern":"try { type = ConfigDataType.getType(name); } catch (IllegalArgumentException e) { log.warn(e.getMessage()); type = ConfigDataType.properties; }","preventionTips":["Whitelist-check the type name against ConfigDataType.values() before parsing","Keep an integration test asserting your shipped config type strings resolve","Prefer getTypeBySuffix when working from file names"],"tags":["config","seata","enum","startup"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}