{"record":{"id":"9750846bafdbd068","repo":"risingwavelabs/risingwave","slug":"auth-method-key-pair-file-requires-private-key-fi","errorCode":null,"errorMessage":"auth.method=key_pair_file requires `private_key_file`","messagePattern":"auth\\.method=key_pair_file requires `private_key_file`","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/snowflake_redshift/snowflake.rs","lineNumber":296,"sourceCode":"            .as_deref()\n            .map(|s| s.trim().to_ascii_lowercase())\n        {\n            Some(method) if method == AUTH_METHOD_PASSWORD => {\n                if !has_password {\n                    return Err(SinkError::Config(anyhow!(\n                        \"auth.method=password requires `password`\"\n                    )));\n                }\n                if has_file || has_pem {\n                    return Err(SinkError::Config(anyhow!(\n                        \"auth.method=password must not set `private_key_file`/`private_key_pem`\"\n                    )));\n                }\n                AUTH_METHOD_PASSWORD.to_owned()\n            }\n            Some(method) if method == AUTH_METHOD_KEY_PAIR_FILE => {\n                if !has_file {\n                    return Err(SinkError::Config(anyhow!(\n                        \"auth.method=key_pair_file requires `private_key_file`\"\n                    )));\n                }\n                if has_password {\n                    return Err(SinkError::Config(anyhow!(\n                        \"auth.method=key_pair_file must not set `password`\"\n                    )));\n                }\n                if has_pem {\n                    return Err(SinkError::Config(anyhow!(\n                        \"auth.method=key_pair_file must not set `private_key_pem`\"\n                    )));\n                }\n                AUTH_METHOD_KEY_PAIR_FILE.to_owned()\n            }\n            Some(method) if method == AUTH_METHOD_KEY_PAIR_OBJECT => {\n                if !has_pem {\n                    return Err(SinkError::Config(anyhow!(","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/snowflake_redshift/snowflake.rs#L278-L314","documentation":"`auth.method = 'key_pair_file'` loads the RSA private key from a local file path given by `private_key_file`. from_btreemap requires that option when this method is selected and fails at sink creation otherwise.","triggerScenarios":"CREATE SINK with `auth.method = 'key_pair_file'` but no `private_key_file` in the WITH options.","commonSituations":"Switching auth.method to key_pair_file while credentials were previously supplied as an inline PEM; option renamed or dropped when parameterizing the DDL.","solutions":["Add `private_key_file = '/path/to/private_key.p8'` to the WITH options","Or set `private_key_pem` and use `auth.method = 'key_pair_object'` if the key is inline","Drop the explicit auth.method to rely on automatic auth detection"],"exampleFix":"// before\nWITH (connector='snowflake', auth.method='key_pair_file', user='u');\n// after\nWITH (connector='snowflake', auth.method='key_pair_file', user='u', private_key_file='/keys/rsa.p8');","handlingStrategy":"validation","validationCode":"if auth_method == \"key_pair_file\" && !options.contains_key(\"private_key_file\") {\n    return Err(\"auth.method=key_pair_file requires private_key_file\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mount the key file on the cluster and reference its path consistently","Check the key file path exists and is readable from compute nodes","Match the auth.method to how the key is actually supplied (file vs inline PEM)"],"tags":["snowflake","sink","auth","config-validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}