{"record":{"id":"35f66f720c550458","repo":"apache/beam","slug":"missing-credentials-values-please-check-your-credentials","errorCode":null,"errorMessage":"Missing credentials values. Please check your credentials","messagePattern":"Missing credentials values\\. Please check your credentials","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":1849,"sourceCode":"        SnowflakeDataSource dataSource = SnowflakeDataSourceFactory.createDataSource();\n        dataSource.setUrl(buildUrl());\n\n        if (isNotEmpty(getOauthToken())) {\n          dataSource.setToken(getOauthToken().get());\n        } else if (isNotEmpty(getUsername()) && getPrivateKey() != null) {\n          dataSource.setUser(getUsername().get());\n          dataSource.setPrivateKey(getPrivateKey());\n        } else if (isNotEmpty(getUsername()) && isNotEmpty(getRawPrivateKey())) {\n          PrivateKey privateKey =\n              KeyPairUtils.preparePrivateKey(\n                  getRawPrivateKey().get(), getValueOrNull(getPrivateKeyPassphrase()));\n          dataSource.setPrivateKey(privateKey);\n          dataSource.setUser(getUsername().get());\n        } else if (isNotEmpty(getUsername()) && isNotEmpty(getPassword())) {\n          dataSource.setUser(getUsername().get());\n          dataSource.setPassword(getPassword().get());\n        } else {\n          throw new RuntimeException(\"Missing credentials values. Please check your credentials\");\n        }\n\n        if (isNotEmpty(getAccount())) {\n          dataSource.setAccount(getAccount().get());\n        }\n        if (isNotEmpty(getDatabase())) {\n          dataSource.setDatabaseName(getDatabase().get());\n        }\n        if (isNotEmpty(getWarehouse())) {\n          dataSource.setWarehouse(getWarehouse().get());\n        }\n        if (isNotEmpty(getSchema())) {\n          dataSource.setSchema(getSchema().get());\n        }\n        if (isNotEmpty(getServerName())) {\n          dataSource.setServerName(getServerName().get());\n        }\n        if (getPortNumber() != null) {","sourceCodeStart":1831,"sourceCodeEnd":1867,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeIO.java#L1831-L1867","documentation":"When building the Snowflake BasicJdbcDataSource, if neither a private key + username nor a username + password pair is configured, SnowflakeIO throws RuntimeException('Missing credentials values. Please check your credentials'). Snowflake requires one complete authentication credential set.","triggerScenarios":"Building a SnowflakeIO read/write where username is set but password and privateKey are both absent; password set without username; nothing authentication-related set at all.","commonSituations":"Password stored in pipeline options that resolved to null/empty (e.g. missing secret, ValueProvider not populated); using OAuth token without wiring it through this code path; credentials left out when moving from local test to Dataflow.","solutions":["Provide .withUsername(...) together with .withPassword(...) on the SnowflakeIO transform.","Or provide .withUsername(...) with .withPrivateKey(...) / key file for key-pair authentication.","Verify ValueProviders/options actually resolve to non-empty values (log or assert before expanding).","Store secrets in a secret manager and inject them rather than hardcoding, ensuring the value is present at runtime."],"exampleFix":"// before\nSnowflakeIO.<KV<String,String>>read().withDataSourceConfiguration(dsCfg); // dsCfg has only account/db, no user/pass\n// after\nDataSourceConfiguration dsCfg = DataSourceConfiguration.create(account, database)\n    .withUsername(\"user\").withPassword(\"secret\");","handlingStrategy":"validation","validationCode":"if ((username == null || username.isEmpty()) || ((password == null || password.isEmpty()) && (privateKey == null || privateKey.isEmpty()))) {\n  throw new IllegalArgumentException(\"Provide username plus either password or privateKey for Snowflake\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.apply(SnowflakeIO.read()...);\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"Missing credentials\")) {\n    throw new IllegalStateException(\"Check username/password/privateKey pipeline options\", e);\n  }\n  throw e;\n}","preventionTips":["Always set username alongside password or privateKey.","Verify ValueProviders resolve before expand().","Inject secrets from a secret manager and assert non-empty at startup."],"tags":["java","snowflake","authentication","jdbc"],"backgroundTag":"missing-credentials","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"}