apache/seatunnel · error · ConnectException

System or JVM property '${property}' is already defined, but

Error message

System or JVM property '${property}' is already defined, but the configuration property '${field.name()}' defines a different value' (or, when showValueInError: 'System or JVM property '${property}' is already defined as ${existingValue}, but the configuration property '${field.name()}' defines a different value '${value}'')

What it means

MySqlJdbcContext.setSystemProperty applies configuration fields that map to JVM/system properties (e.g. time zone settings). If the system property is already set with a value that differs from the one defined in the connector configuration, the connector refuses to proceed and throws a ConnectException, because the conflicting value would silently change behavior. When the same value is already set, it is a no-op.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/legacy/MySqlJdbcContext.java:530

                    String msg =
                            "System or JVM property '"
                                    + property
                                    + "' is already defined, but the configuration property '"
                                    + field.name()
                                    + "' defines a different value";
                    if (showValueInError) {
                        msg =
                                "System or JVM property '"
                                        + property
                                        + "' is already defined as "
                                        + existingValue
                                        + ", but the configuration property '"
                                        + field.name()
                                        + "' defines a different value '"
                                        + value
                                        + "'";
                    }
                    throw new ConnectException(msg);
                }
                // Otherwise, there was an existing property, and the value is exactly the same (so
                // do nothing!)
            }
        }
    }

    /**
     * Read the Ssl Version session variable.
     *
     * @return the session variables that are related to sessions ssl version
     */
    public String getSessionVariableForSslVersion() {
        final String SSL_VERSION = "Ssl_version";
        logger.debug("Reading MySQL Session variable for Ssl Version");
        Map<String, String> sessionVariables =
                querySystemVariables(SQL_SHOW_SESSION_VARIABLE_SSL_VERSION);
        if (!sessionVariables.isEmpty() && sessionVariables.containsKey(SSL_VERSION)) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Align the system property value with the connector configuration value (or remove the -D flag so the config value wins).
  2. Alternatively update the connector config to match the already-set system property.
  3. Check worker/agent startup scripts and java options for duplicate definitions of the same property.
  4. Restart the process after fixing so the JVM picks up a single consistent value.

Example fix

// before (JVM flags)
java -Duser.timezone=Asia/Shanghai ... // config says UTC
// after
java -Duser.timezone=UTC ... // matches config value 'UTC'
Defensive patterns

Strategy: validation

Validate before calling

// Detect conflicting JVM property before connector init
String prop = System.getProperty("user.timezone");
if (prop != null && !prop.equals(configTimezone)) {
    throw new IllegalStateException("Conflicting system property user.timezone=" + prop);
}

Try / catch

try { engine.start(); } catch (ConnectException e) { if (e.getMessage().contains("already defined")) { logger.error("Remove conflicting -D flag or align config value"); } throw e; }

Prevention

When it happens

Trigger: Calling setSystemProperty during connector task initialization when a field-backed property (e.g. database.serverTimezone) is already defined via -D JVM flags, System.setProperty, or the container/JVM environment with a different value than the config.

Common situations: Operator sets -Duser.timezone=UTC on the JVM while the connector config specifies a different serverTimezone; Kafka Connect worker properties predefine the property; duplicated configuration between worker and connector levels.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/159771266975a3d7. Report an issue: GitHub.