apache/incubator-seata · error · IllegalArgumentException
unknown dbtype:{dbType}
Error message
unknown dbtype:{dbType} What it means
Thrown by DBType.valueof(String) when the configured database type string does not equal (case-insensitively) any DBType enum constant (mysql, oracle, postgresql, etc.). It is used when resolving store.db.dbType on the TC server and by datasource parsers.
Source
Thrown at core/src/main/java/org/apache/seata/core/constants/DBType.java:214
/**
* oscar db type.
*/
OSCAR;
/**
* Valueof db type.
*
* @param dbType the db type
* @return the db type
*/
public static DBType valueof(String dbType) {
for (DBType dt : values()) {
if (StringUtils.equalsIgnoreCase(dt.name(), dbType)) {
return dt;
}
}
throw new IllegalArgumentException("unknown dbtype:" + dbType);
}
}
View on GitHub (pinned to e01f97c6db)
Solutions
- Set store.db.dbType to the exact enum name, e.g. mysql, oracle, postgresql, db2, sqlserver, ... (case-insensitive but exact spelling).
- If pointing at PostgreSQL, use 'postgresql', not 'postgres'.
- Re-trim the config value and restart the server.
Example fix
# before store.db.dbType = postgres # after store.db.dbType = postgresql
Defensive patterns
Strategy: validation
Validate before calling
static boolean knownDb(String s) {
return Arrays.stream(DBType.values()).anyMatch(d -> d.name().equalsIgnoreCase(s == null ? "" : s.trim()));
} Type guard
static Optional<DBType> parseDb(String s) {
String n = s == null ? "" : s.trim();
return Arrays.stream(DBType.values()).filter(d -> d.name().equalsIgnoreCase(n)).findFirst();
} Prevention
- Use 'postgresql' not 'postgres'
- Maintain config templates reviewed against the current enum
- Test server config in a staging boot before prod rollout
When it happens
Trigger: Setting store.db.dbType (file.conf / application.yml on the server) to an unrecognized value such as 'postgres' (must be postgresql), 'maria', 'msql', or a value with stray whitespace/quotes; also reached by API code mapping a JDBC URL prefix to a DBType.
Common situations: Typo in server store configuration; using 'postgres' instead of 'postgresql'; copying a config written for a community fork; trailing whitespace from YAML copy-paste.
Related errors
- unknown codec:{name}
- Unknown BranchType[{name}]
- listen port: %s is invalid!
- ERR_CONFIG
- URL must not be null or blank
AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14).
Data as JSON: /api/errors/098ccaf759c59fd2.
Report an issue: GitHub.