alibaba/spring-cloud-alibaba · error · RuntimeException

[Sentinel Starter] DataSource {dataSourceName} dataType: {pr

Error message

[Sentinel Starter] DataSource {dataSourceName} dataType: {propertyValue} is not support now. please using these types: {dataTypeList}

What it means

For non-custom data types, Sentinel validates the configured value against a known list (json, xml). If the trimmed data-type is not in that list, this RuntimeException is thrown, listing the supported types. It guards against silently falling back to a default converter for an unrecognized format.

Source

Thrown at spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-sentinel/src/main/java/com/alibaba/cloud/sentinel/custom/SentinelDataSourceHandler.java:180

						builder.addPropertyReference("converter", customConvertBeanName);
					}
					catch (ClassNotFoundException e) {
						log.error("[Sentinel Starter] DataSource " + dataSourceName
								+ " handle "
								+ dataSourceProperties.getClass().getSimpleName()
								+ " error, class name: "
								+ dataSourceProperties.getConverterClass());
						throw new RuntimeException("[Sentinel Starter] DataSource "
								+ dataSourceName + " handle "
								+ dataSourceProperties.getClass().getSimpleName()
								+ " error, class name: "
								+ dataSourceProperties.getConverterClass(), e);
					}
				}
				else {
					if (!dataTypeList.contains(
							StringUtils.trimAllWhitespace(propertyValue.toString()))) {
						throw new RuntimeException("[Sentinel Starter] DataSource "
								+ dataSourceName + " dataType: " + propertyValue
								+ " is not support now. please using these types: "
								+ dataTypeList.toString());
					}
					// converter type now support xml or json.
					// The bean name of these converters wrapped by
					// 'sentinel-{converterType}-{ruleType}-converter'
					if (dataSourceProperties.getRuleType() != null) {
						builder.addPropertyReference("converter",
								"sentinel-" + propertyValue.toString() + "-"
										+ dataSourceProperties.getRuleType().getName()
										+ "-converter");
					}
				}
			}
			else {
				if (!CONVERTER_CLASS_FIELD.equals(propertyName)) {
					// wired properties

View on GitHub (pinned to 115d590110)

Solutions

  1. Use one of the supported data types exactly: 'json' or 'xml'.
  2. If you need another format, implement a custom Converter and set data-type=custom with converter-class.
  3. Copy the value from the error message's supported list to avoid spelling mistakes.

Example fix

# before
spring.cloud.sentinel.datasource.ds1.data-type=yaml
# after
spring.cloud.sentinel.datasource.ds1.data-type=json
Defensive patterns

Strategy: validation

Validate before calling

private static final Set<String> SUPPORTED = Set.of("json", "xml");
void validateDataType(String t) {
  if (!SUPPORTED.contains(t == null ? null : t.trim().toLowerCase(Locale.ROOT)))
    throw new IllegalArgumentException("Unsupported data-type " + t + "; use one of " + SUPPORTED);
}

Prevention

When it happens

Trigger: Setting spring.cloud.sentinel.datasource.xxx.data-type to an unsupported value such as 'yaml', 'JSON' (case mismatch handled by trim only, not lowercasing), 'properties', or a typo like 'jso'.

Common situations: Assuming YAML/properties are supported. Case-sensitive typo. Upgrading and not noticing the supported set differs from a fork.

Related errors


AI-assisted analysis of alibaba/spring-cloud-alibaba@115d590110 (2026-08-14). Data as JSON: /api/errors/8e309262624e19e6. Report an issue: GitHub.