apache/incubator-seata · error · IllegalArgumentException
not support config data type type: %s
Error message
not support config data type type: %s
What it means
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.
Source
Thrown at config/seata-config-core/src/main/java/org/apache/seata/config/processor/ConfigDataType.java:54
private String[] suffix;
ConfigDataType(String... suffix) {
this.suffix = suffix;
}
/**
* Gets type.
*
* @param name the name
* @return the type
*/
public static ConfigDataType getType(String name) {
for (ConfigDataType configDataType : values()) {
if (configDataType.name().equalsIgnoreCase(name)) {
return configDataType;
}
}
throw new IllegalArgumentException("not support config data type type: " + name);
}
/**
* Gets type by suffix.
*
* @param suffix the suffix
* @return the type
*/
public static ConfigDataType getTypeBySuffix(String suffix) {
for (ConfigDataType configDataType : values()) {
for (String sfx : configDataType.suffix) {
if (sfx.equals(suffix)) {
return configDataType;
}
}
}
throw new IllegalArgumentException("not support config data type suffix: " + suffix);
}View on GitHub (pinned to e01f97c6db)
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
Example fix
// before
ConfigDataType type = ConfigDataType.getType("yml"); // throws
// after
ConfigDataType type = ConfigDataType.getTypeBySuffix("yml"); // -> yaml
// or
ConfigDataType type = ConfigDataType.getType("yaml"); Defensive patterns
Strategy: validation
Validate before calling
static final Set<String> VALID = Stream.of(ConfigDataType.values()).map(Enum::name).collect(Collectors.toSet());
if (!VALID.contains(name.toUpperCase())) throw new IllegalArgumentException("Unsupported: " + name + ", valid: " + VALID); Type guard
boolean isSupportedDataType(String name) {
return Arrays.stream(ConfigDataType.values()).anyMatch(t -> t.name().equalsIgnoreCase(name));
} Try / catch
try { type = ConfigDataType.getType(name); } catch (IllegalArgumentException e) { log.warn(e.getMessage()); type = ConfigDataType.properties; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ERR_CONFIG
- Apollo configuration initialized failed,please check the val
- not support config type:
- config type can not be null
- file not found
AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14).
Data as JSON: /api/errors/5cabf71552a235ca.
Report an issue: GitHub.