apache/seatunnel · error · OptionValidationException

Invalid YashanDB JDBC URL format: [%s], expected pattern: jd

Error message

Invalid YashanDB JDBC URL format: [%s], expected pattern: jdbc:yasdb://host:port[/database][?properties]

What it means

YashanDbCatalogFactory.checkValidURL (via JdbcUrlUtil.getUrlInfo) cannot parse the configured YashanDB JDBC URL, so it throws an OptionValidationException instead of silently continuing. The URL must follow jdbc:yasdb://host:port[/database][?properties]. This guard runs early so users get a clear config error rather than a driver connection failure later.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/yashandb/YashanDbCatalogFactory.java:89

                    + "' (e.g. jdbc:yasdb://host:port/database)";
        }

        @Override
        public boolean evaluate(ReadonlyConfig config, String url) {
            if (url == null || url.trim().isEmpty()) {
                return false;
            }
            if (!url.startsWith(YASHANDB_URL_PREFIX)) {
                throw new OptionValidationException(
                        String.format(
                                "Invalid YashanDB JDBC URL: [%s], URL must start with '%s'",
                                url, YASHANDB_URL_PREFIX));
            }
            try {
                JdbcUrlUtil.UrlInfo info = JdbcUrlUtil.getUrlInfo(url);
                return info.getHost() != null && !info.getHost().isEmpty();
            } catch (IllegalArgumentException e) {
                throw new OptionValidationException(
                        String.format(
                                "Invalid YashanDB JDBC URL format: [%s], "
                                        + "expected pattern: jdbc:yasdb://host:port[/database][?properties]",
                                url));
            }
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Fix the URL to exactly jdbc:yasdb://host:port[/database][?properties], e.g. jdbc:yasdb://192.168.1.10:1688/mydb
  2. Verify the scheme is jdbc:yasdb:// (not jdbc:yashandb:// or another vendor prefix)
  3. Check for stray whitespace, quotes, or newline characters picked up from YAML/HOCON config
  4. If properties are appended, ensure they start with ? and are URL-encoded

Example fix

// before
String url = "jdbc:yashandb://localhost:1688";
// after
String url = "jdbc:yasdb://localhost:1688/mydb";
Defensive patterns

Strategy: validation

Validate before calling

String url = (String) options.get("url");
if (url == null || !url.startsWith("jdbc:yasdb://")) {
    throw new IllegalArgumentException("YashanDB url must start with jdbc:yasdb://");
}
java.net.URI.create(url.substring("jdbc:".length()));

Type guard

static boolean isValidYashanUrl(String url) {
    return url != null && url.matches("jdbc:yasdb://[^:/\\s]+:\\d+(/[^?\\s]*)?(\\?.*)?");
}

Try / catch

try {
    catalog.validateUrl(url);
} catch (OptionValidationException e) {
    LOG.error("Bad YashanDB url: {}", e.getMessage());
    throw new ConfigException(e);
}

Prevention

When it happens

Trigger: Calling the YashanDB catalog/table-path validation with a url that is null/blank, lacks the jdbc:yasdb:// prefix, omits host or port, or has a malformed query/property section.

Common situations: Typo in the scheme (jdbc:yashandb:// or jdbc:oracle://), missing port, copy-pasted URL with spaces or quotes from YAML, URL containing unescaped '&' or missing '?', using an Oracle-style SID URL for YashanDB.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


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