apache/beam · error · java.lang.RuntimeException
Failed to setLoginTimeout
Error message
Failed to setLoginTimeout
What it means
If dataSource.setLoginTimeout(int) throws SQLException while configuring the Snowflake data source, SnowflakeIO rethrows it as RuntimeException('Failed to setLoginTimeout'). The underlying SQLException detail is discarded, so only the driver-level failure to apply the timeout is reported.
Solutions
- Pass a non-negative integer login timeout (e.g. 30 seconds or more).
- Check the pipeline option feeding getLoginTimeout() for stray characters/negative values.
- Update the Snowflake JDBC driver (net.snowflake:snowflake-jdbc) to a current version.
- If the timeout isn't essential, remove .withLoginTimeout(...) to unblock the pipeline.
Example fix
// before .withLoginTimeout(-1) // invalid // after .withLoginTimeout(30)
Defensive patterns
Strategy: validation
Validate before calling
if (loginTimeout != null && loginTimeout <= 0) {
throw new IllegalArgumentException("loginTimeout must be a positive integer");
} Prevention
- Only pass positive integer timeouts.
- Validate pipeline options parsing before submit.
- Keep the Snowflake JDBC driver up to date.
When it happens
Trigger: Calling .withLoginTimeout(n) on SnowflakeIO / DataSourceConfiguration with a value the Snowflake JDBC driver refuses (e.g. negative or unparsable value driving driver-side validation), producing a SQLException inside setLoginTimeout.
Common situations: Passing a negative timeout from a misconfigured pipeline option; type coercion issues where the option string was parsed incorrectly; an unusual driver version that validates differently.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Either Query or Table must be specified.
- Either table or query must be specified.
- flushRowLimit must be greater than 0.
- flushTimeLimitMillis must be greater than 0.
- JDBC URL cannot be blank
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/67254bffd92b7b08.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java:1880
dataSource.setSchema(getSchema().get());
}
if (isNotEmpty(getServerName())) {
dataSource.setServerName(getServerName().get());
}
if (getPortNumber() != null) {
dataSource.setPortNumber(getPortNumber());
}
if (isNotEmpty(getRole())) {
dataSource.setRole(getRole().get());
}
if (getAuthenticator() != null) {
dataSource.setAuthenticator(getAuthenticator());
}
if (getLoginTimeout() != null) {
try {
dataSource.setLoginTimeout(getLoginTimeout());
} catch (SQLException e) {
throw new RuntimeException("Failed to setLoginTimeout");
}
}
return dataSource;
}
return getDataSource();
}
private String buildUrl() {
StringBuilder url = new StringBuilder();
if (getUrl() != null) {
url.append(getUrl());
} else {
url.append("jdbc:snowflake://");
url.append(getServerName().get());
}
if (getPortNumber() != null) {
url.append(":").append(getPortNumber());View on GitHub (pinned to 12126d8942)