apache/seatunnel · warning
' ' is set to 'true'. This setting is not recommended and…
Error message
'{}' is set to 'true'. This setting is not recommended and can result in timezone issues. What it means
When building the MySQL JDBC configuration, MySqlConnectionConfiguration checks the legacy connection property useLegacyDatetimeCode. If it is explicitly set to 'true', this warning is logged because the legacy datetime handling changes how DATE/TIME/TIMESTAMP values are converted, commonly producing timezone shifts. The value is kept as configured but is not recommended.
Solutions
- Remove the useLegacyDatetimeCode=true property from the JDBC config entirely (the code defaults it to false).
- Set serverTimezone/connectionTimeZone explicitly to the actual server timezone instead.
- Verify timestamps read by the CDC job match the database after the change.
- If timezone problems persist, align the JVM timezone with the MySQL server timezone.
Example fix
// before (url/config) jdbc.properties.useLegacyDatetimeCode = true // after: remove it and set explicit zone jdbc.properties.connectionTimeZone = Asia/Shanghai
Defensive patterns
Strategy: validation
Validate before calling
// before building config, assert legacy datetime is off
if ("true".equals(props.get("database.jdbc.properties.useLegacyDatetimeCode"))) {
throw new IllegalArgumentException("Remove useLegacyDatetimeCode=true");
} Prevention
- Never copy legacy useLegacyDatetimeCode settings from old Debezium/Flink-CDC configs.
- Handle timezones with connectionTimeZone/serverTimezone explicitly instead.
- Snapshot-compare a few TIMESTAMP rows between DB and sink after connector upgrades.
When it happens
Trigger: The user's database config (jdbc properties map) contains JDBC_PROPERTY_LEGACY_DATETIME (useLegacyDatetimeCode) set to the string 'true' while constructing MySqlConnectionConfiguration for CDC snapshot/stream reading.
Common situations: Copy-pasted old Debezium/connector configs from pre-Connector/J 8 era; trying to 'fix' timestamp discrepancies by enabling legacy datetime code; migrating configs from Flink CDC or older SeaTunnel versions.
Understand the failure class
Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.
Related errors
- Database configuration option
- Error reading default database charsets:
- Error reading default database charsets
- Error reading MySQL variables:
- Error reading MySQL variables
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/8ea53a60084fc2b9.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnection.java:633
jdbcConfigBuilder.with(
"trustCertificateKeyStorePassword",
String.valueOf(sslTrustStorePassword()));
}
if (!Strings.isNullOrBlank(sslKeyStore())) {
jdbcConfigBuilder.with("clientCertificateKeyStoreUrl", "file:" + sslKeyStore());
}
if (sslKeyStorePassword() != null) {
jdbcConfigBuilder.with(
"clientCertificateKeyStorePassword",
String.valueOf(sslKeyStorePassword()));
}
}
final String legacyDateTime = dbConfig.getString(JDBC_PROPERTY_LEGACY_DATETIME);
if (legacyDateTime == null) {
jdbcConfigBuilder.with(JDBC_PROPERTY_LEGACY_DATETIME, "false");
} else if ("true".equals(legacyDateTime)) {
LOGGER.warn(
"'{}' is set to 'true'. This setting is not recommended and can result in timezone issues.",
JDBC_PROPERTY_LEGACY_DATETIME);
}
jdbcConfigBuilder.with(
JDBC_PROPERTY_CONNECTION_TIME_ZONE, determineConnectionTimeZone(dbConfig));
this.jdbcConfig = JdbcConfiguration.adapt(jdbcConfigBuilder.build());
String driverClassName = this.jdbcConfig.getString(MySqlConnectorConfig.JDBC_DRIVER);
factory =
JdbcConnection.patternBasedFactory(
MySqlConnection.URL_PATTERN,
driverClassName,
getClass().getClassLoader());
}
private static String determineConnectionTimeZone(final Configuration dbConfig) {
// Debezium by default expects timezoned data delivered in server timezoneView on GitHub (pinned to cf67b549a7)