apache/shardingsphere · error · InvalidDataSourcePoolPropertiesException
Invalid data source `%s`, error message is: %s
Error message
Invalid data source `%s`, error message is: %s
What it means
Error "Invalid data source `%s`, error message is: %s" thrown in apache/shardingsphere.
Source
Thrown at infra/data-source-pool/core/src/main/java/org/apache/shardingsphere/infra/datasource/pool/props/validator/DataSourcePoolPropertiesValidator.java:71
*/
public static Map<String, Exception> validate(final Map<String, DataSourcePoolProperties> propsMap, final Collection<PrivilegeCheckType> expectedPrivileges) {
Map<String, Exception> result = new LinkedHashMap<>(propsMap.size(), 1F);
for (Entry<String, DataSourcePoolProperties> entry : propsMap.entrySet()) {
try {
validateProperties(entry.getKey(), entry.getValue());
validateConnection(entry.getKey(), entry.getValue(), expectedPrivileges);
} catch (final InvalidDataSourcePoolPropertiesException ex) {
result.put(entry.getKey(), ex);
}
}
return result;
}
private static void validateProperties(final String dataSourceName, final DataSourcePoolProperties props) throws InvalidDataSourcePoolPropertiesException {
try {
TypedSPILoader.findService(DataSourcePoolPropertiesContentValidator.class, props.getPoolClassName()).ifPresent(optional -> optional.validate(props));
} catch (final IllegalArgumentException ex) {
throw new InvalidDataSourcePoolPropertiesException(dataSourceName, ex.getMessage());
}
}
private static void validateConnection(final String dataSourceName, final DataSourcePoolProperties props,
final Collection<PrivilegeCheckType> expectedPrivileges) throws InvalidDataSourcePoolPropertiesException {
DataSource dataSource = null;
try {
dataSource = DataSourcePoolCreator.create(props);
checkFailFast(dataSource);
if (expectedPrivileges.isEmpty() || expectedPrivileges.contains(PrivilegeCheckType.NONE)) {
return;
}
checkPrivileges(dataSource, props, expectedPrivileges);
// CHECKSTYLE:OFF
} catch (final SQLException | RuntimeException ex) {
// CHECKSTYLE:ON
throw new InvalidDataSourcePoolPropertiesException(dataSourceName, ex.getMessage());
} finally {View on GitHub (pinned to e952770a21)
Solutions
- Verify the JDBC URL, username, and password of the failing data source.
- Check the pool properties (e.g. maximumPoolSize, connectionTimeout) for invalid values.
- Confirm the target database is reachable and accepts connections.
When it happens
Trigger: Data source pool property validation fails when ShardingSphere initializes or validates a connection pool.
Common situations: Wrong credentials, unreachable host, or invalid pool property in the data source configuration at startup or ALTER/REGISTER STORAGE UNIT time.
AI-assisted analysis of apache/shardingsphere@e952770a21 (2026-08-14).
Data as JSON: /api/errors/1689679f8552a842.
Report an issue: GitHub.