apache/flink · error · IllegalArgumentException
Unsupported type: {}
Error message
Unsupported type: {} What it means
Thrown by ConfigurationUtils.convertValue when the target type clazz is not one of the supported atomic types (Integer, Long, Boolean, Float, Double, String, Enum, Duration, MemorySize, Map). The configuration system only knows how to coerce raw values into this closed set of types, so any other class is rejected. It signals a mismatch between a ConfigOption's declared type and what the conversion layer can handle.
Source
Thrown at flink-core/src/main/java/org/apache/flink/configuration/ConfigurationUtils.java:398
} else if (Boolean.class.equals(clazz)) {
return (T) convertToBoolean(rawValue);
} else if (Float.class.equals(clazz)) {
return (T) convertToFloat(rawValue);
} else if (Double.class.equals(clazz)) {
return (T) convertToDouble(rawValue);
} else if (String.class.equals(clazz)) {
return (T) convertToString(rawValue);
} else if (clazz.isEnum()) {
return (T) convertToEnum(rawValue, (Class<? extends Enum<?>>) clazz);
} else if (clazz == Duration.class) {
return (T) convertToDuration(rawValue);
} else if (clazz == MemorySize.class) {
return (T) convertToMemorySize(rawValue);
} else if (clazz == Map.class) {
return (T) convertToProperties(rawValue);
}
throw new IllegalArgumentException("Unsupported type: " + clazz);
}
@SuppressWarnings("unchecked")
public static <T> T convertToList(Object rawValue, Class<?> atomicClass) {
if (rawValue instanceof List) {
return (T) rawValue;
} else {
try {
List<Object> data =
YamlParserUtils.convertToObject(rawValue.toString(), List.class);
// The Yaml parser conversion results in data of type List<Map<Object, Object>>,
// such as List<Map<Object, Boolean>>. However, ConfigOption currently requires that
// the data for Map type be strictly of the type Map<String, String>. Therefore, we
// convert each map in the list to Map<String, String>.
if (atomicClass == Map.class) {
return (T)
data.stream()
.map(map -> convertToStringMap((Map<Object, Object>) map))View on GitHub (pinned to 2f3c205e92)
Solutions
- Change the ConfigOption to a supported type (e.g., use String and parse in application code, or Duration/MemorySize for those types).
- For lists, use the list-aware configuration APIs (convertToList) and define the option with the list element type.
- If a custom object is needed, serialize it to a String or Map<String,String> and deserialize manually.
Example fix
// before
ConfigOption<MyPojo> opt = ConfigOptions.key("my.pojo").type(MyPojo.class).noDefaultValue();
// after
ConfigOption<String> opt = ConfigOptions.key("my.pojo").stringType().noDefaultValue();
// parse the string into MyPojo in user code Defensive patterns
Strategy: validation
Validate before calling
Set<Class<?>> SUPPORTED = Set.of(Integer.class, Long.class, Boolean.class, Float.class, Double.class, String.class, Duration.class, MemorySize.class, Map.class);
boolean ok = SUPPORTED.contains(targetType) || targetType.isEnum();
if (!ok) throw new IllegalArgumentException("Unsupported config type: " + targetType); Type guard
static boolean isSupportedConfigType(Class<?> c) {
return c == Integer.class || c == Long.class || c == Boolean.class
|| c == Float.class || c == Double.class || c == String.class
|| c == Duration.class || c == MemorySize.class || c == Map.class
|| c.isEnum();
} Try / catch
try {
Object v = ConfigurationUtils.convertValue(raw, clazz);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unsupported type:")) { /* handle */ }
throw e;
} Prevention
- Only declare ConfigOptions with the supported atomic types or enums.
- For complex types, store as String/Map and parse in user code.
- Use the list-aware API for List-typed options.
When it happens
Trigger: Calling Configuration.get/set (or convertValue directly) with a ConfigOption parameterized by an unsupported type such as a custom POJO, BigDecimal, LocalDateTime, or List (lists go through convertToList, not convertValue). Also triggered when YAML-deserialized values are coerced into a ConfigOption of an unrecognized class.
Common situations: Defining a ConfigOption<MyCustomType> and expecting Flink to deserialize it automatically. Using BigDecimal or java.time types other than Duration. Attempting to store a List via a plain ConfigOption<List<T>> instead of using the list-aware API.
Related errors
- Configuration value %s overflows/underflows the integer type
- Unrecognized option for boolean: %s. Expected either true or
- Configuration value %s overflows/underflows the float type.
- No cluster id was specified. Please specify a cluster to whi
- The configuration directory '{}', specified in the '{}' envi
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/6b19964b0b93a9b6.
Report an issue: GitHub.