{"record":{"id":"b5d3c332ac384183","repo":"risingwavelabs/risingwave","slug":"username-is-required","errorCode":null,"errorMessage":"username is required","messagePattern":"username is required","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/snowflake_redshift/snowflake.rs","lineNumber":185,"sourceCode":"fn default_with_s3() -> bool {\n    true\n}\n\nimpl SnowflakeV2Config {\n    /// Build JDBC Properties for the Snowflake JDBC connection (no URL parameters).\n    /// Returns (`jdbc_url`, `driver_properties`).\n    /// - `driver_properties` are transformed/used by the Java runner and passed to `DriverManager::getConnection(url, props)`\n    ///\n    /// Note: This method assumes the config has been validated by `from_btreemap`.\n    pub fn build_jdbc_connection_properties(&self) -> Result<(String, Vec<(String, String)>)> {\n        let jdbc_url = self\n            .jdbc_url\n            .clone()\n            .ok_or(SinkError::Config(anyhow!(\"jdbc.url is required\")))?;\n        let username = self\n            .username\n            .clone()\n            .ok_or(SinkError::Config(anyhow!(\"username is required\")))?;\n\n        let mut connection_properties: Vec<(String, String)> = vec![(\"user\".to_owned(), username)];\n\n        // auth_method is guaranteed to be Some after validation in from_btreemap\n        match self.auth_method.as_deref().unwrap() {\n            AUTH_METHOD_PASSWORD => {\n                // password is guaranteed to exist by from_btreemap validation\n                connection_properties.push((\"password\".to_owned(), self.password.clone().unwrap()));\n            }\n            AUTH_METHOD_KEY_PAIR_FILE => {\n                // private_key_file is guaranteed to exist by from_btreemap validation\n                connection_properties.push((\n                    \"private_key_file\".to_owned(),\n                    self.private_key_file.clone().unwrap(),\n                ));\n                if let Some(pwd) = self.private_key_file_pwd.clone() {\n                    connection_properties.push((\"private_key_file_pwd\".to_owned(), pwd));\n                }","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/snowflake_redshift/snowflake.rs#L167-L203","documentation":"Alongside `jdbc.url`, `build_jdbc_connection_properties` requires a `username` to set the `user` JDBC connection property. When `config.username` is `None`, this Config error is thrown while building the Snowflake JDBC client.","triggerScenarios":"Calling `build_jdbc_connection_properties` (via `build_snowflake_task_ctx_jdbc_client`) with a config where `username` is None, i.e. `snowflake.username` was missing from the sink's WITH options.","commonSituations":"Snowflake sink created without the username option; username supplied under a wrong key name; key-based auth configured but username still required and omitted.","solutions":["Add `snowflake.username = '<user>'` to the sink WITH options and recreate the sink.","Double-check the exact option name (`snowflake.username`) matches the connector version.","Run config validation (`from_btreemap`) upfront to surface all missing fields at once."],"exampleFix":"// before\nWITH (connector='snowflake', snowflake.jdbc.url='jdbc:snowflake://...');\n// after\nWITH (connector='snowflake', snowflake.jdbc.url='jdbc:snowflake://...', snowflake.username='my_user');","handlingStrategy":"validation","validationCode":"if !props.contains_key(\"snowflake.username\") {\n    return Err(anyhow!(\"snowflake.username is required\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include snowflake.username even when using key-pair auth.","Validate the full properties map before sink creation."],"tags":["rust","snowflake","jdbc","sink-config"],"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-14T16:17:12.679Z"}