{"record":{"id":"67254bffd92b7b08","repo":"apache/beam","slug":"failed-to-setlogintimeout","errorCode":null,"errorMessage":"Failed to setLoginTimeout","messagePattern":"Failed to setLoginTimeout","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java","lineNumber":1880,"sourceCode":"          dataSource.setSchema(getSchema().get());\n        }\n        if (isNotEmpty(getServerName())) {\n          dataSource.setServerName(getServerName().get());\n        }\n        if (getPortNumber() != null) {\n          dataSource.setPortNumber(getPortNumber());\n        }\n        if (isNotEmpty(getRole())) {\n          dataSource.setRole(getRole().get());\n        }\n        if (getAuthenticator() != null) {\n          dataSource.setAuthenticator(getAuthenticator());\n        }\n        if (getLoginTimeout() != null) {\n          try {\n            dataSource.setLoginTimeout(getLoginTimeout());\n          } catch (SQLException e) {\n            throw new RuntimeException(\"Failed to setLoginTimeout\");\n          }\n        }\n        return dataSource;\n      }\n      return getDataSource();\n    }\n\n    private String buildUrl() {\n      StringBuilder url = new StringBuilder();\n\n      if (getUrl() != null) {\n        url.append(getUrl());\n      } else {\n        url.append(\"jdbc:snowflake://\");\n        url.append(getServerName().get());\n      }\n      if (getPortNumber() != null) {\n        url.append(\":\").append(getPortNumber());","sourceCodeStart":1862,"sourceCodeEnd":1898,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java#L1862-L1898","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n.withLoginTimeout(-1) // invalid\n// after\n.withLoginTimeout(30)","handlingStrategy":"validation","validationCode":"if (loginTimeout != null && loginTimeout <= 0) {\n  throw new IllegalArgumentException(\"loginTimeout must be a positive integer\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass positive integer timeouts.","Validate pipeline options parsing before submit.","Keep the Snowflake JDBC driver up to date."],"tags":["java","snowflake","jdbc","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}