{"record":{"id":"af60fe868008a76b","repo":"risingwavelabs/risingwave","slug":"missing-aws-region","errorCode":null,"errorMessage":"missing aws region","messagePattern":"missing aws region","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/kafka/client_context.rs","lineNumber":70,"sourceCode":"\nimpl KafkaContextCommon {\n    pub async fn new(\n        broker_rewrite_map: Option<BTreeMap<String, String>>,\n        identifier: Option<String>,\n        metrics: Option<Arc<RdKafkaStats>>,\n        auth: AwsAuthProps,\n        is_aws_msk_iam: bool,\n    ) -> ConnectorResult<Self> {\n        let addr_rewriter =\n            BrokerAddrRewriter::new(PrivateLinkContextRole::Consumer, broker_rewrite_map)?;\n        let auth = if is_aws_msk_iam {\n            let config = auth.build_config().await?;\n            let credentials_provider = config\n                .credentials_provider()\n                .ok_or_else(|| anyhow!(\"missing aws credentials_provider\"))?;\n            let region = config\n                .region()\n                .ok_or_else(|| anyhow!(\"missing aws region\"))?\n                .clone();\n            Some(IamAuthEnv {\n                credentials_provider,\n                region,\n                signer_timeout_sec: auth\n                    .msk_signer_timeout_sec\n                    .unwrap_or(Self::default_msk_signer_timeout_sec()),\n            })\n        } else {\n            None\n        };\n        Ok(Self {\n            addr_rewriter,\n            identifier,\n            metrics,\n            auth,\n        })\n    }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/kafka/client_context.rs#L52-L88","documentation":"AWS MSK IAM authentication signs requests with SigV4, which requires an AWS region. When `is_aws_msk_iam` is true but the resolved AWS SDK config has no region, context creation fails with this error.","triggerScenarios":"Creating a KafkaContextCommon with `is_aws_msk_iam=true` while AwsAuthProps lacks `aws.region` (or `AWS_REGION`/`AWS_DEFAULT_REGION` env and profile region are unset).","commonSituations":"User enables `aws.auth.msk_iam = true` but omits the `aws.region` WITH option; running in a container without AWS_REGION env; region only set in a profile that is not loaded.","solutions":["Add `aws.region='<cluster-region>'` to the WITH options (e.g. us-east-1) alongside `aws.auth.msk_iam = true`","Or set the AWS_REGION/AWS_DEFAULT_REGION environment variables in the RisingWave deployment","Verify with the region of the MSK cluster's bootstrap string (e.g. ...kafka.us-east-1.amazonaws.com implies us-east-1)"],"exampleFix":"// before\nWITH (\n  connector='kafka',\n  aws.auth.msk_iam='true'\n)\n// after\nWITH (\n  connector='kafka',\n  aws.auth.msk_iam='true',\n  aws.region='us-east-1'\n)","handlingStrategy":"validation","validationCode":"if msk_iam && with_options.get(\"aws.region\").is_none() && std::env::var(\"AWS_REGION\").is_err() {\n    return Err(\"aws.region is required for aws.auth.msk_iam\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair aws.auth.msk_iam=true with an explicit aws.region option","Derive the region from the MSK bootstrap string before building WITH options","Set AWS_REGION in container/deployment configs"],"tags":["kafka","aws","msk","region","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"}