{"record":{"id":"c3cc1ee12f0d1f29","repo":"zed-industries/zed","slug":"unsupported-region-region","errorCode":null,"errorMessage":"Unsupported Region {region}","messagePattern":"Unsupported Region (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/bedrock/src/models.rs","lineNumber":735,"sourceCode":"                \"global\"\n            } else {\n                \"au\"\n            }\n        } else if region == \"ap-northeast-1\" || region == \"ap-northeast-3\" {\n            // Japan\n            if allow_global && supports_global {\n                \"global\"\n            } else {\n                \"jp\"\n            }\n        } else if region.starts_with(\"ap-\") || region.starts_with(\"me-\") {\n            if allow_global && supports_global {\n                \"global\"\n            } else {\n                \"apac\"\n            }\n        } else {\n            anyhow::bail!(\"Unsupported Region {region}\");\n        };\n\n        match (self, region_group) {\n            (Self::Custom { .. }, _) => Ok(model_id.into()),\n\n            // Global inference profiles\n            (\n                Self::ClaudeFable5\n                | Self::ClaudeOpus5\n                | Self::ClaudeOpus4_8\n                | Self::ClaudeOpus4_7\n                | Self::ClaudeOpus4_6\n                | Self::ClaudeOpus4_5\n                | Self::ClaudeSonnet5\n                | Self::ClaudeSonnet4_6\n                | Self::ClaudeSonnet4_5\n                | Self::ClaudeSonnet4\n                | Self::ClaudeHaiku4_5","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/bedrock/src/models.rs#L717-L753","documentation":"Bedrock model ids must be rewritten into per-region inference profile prefixes (`us.`, `eu.`, `global.`, `apac.`, `jp.`, `au.`, `us-gov.`, ...). This code buckets the configured AWS region by prefix (us-gov-, us-, sa-, ca-, eu-, specific ap- regions, ap-, me-); any region outside those buckets has no inference profile group and bails. Note the check runs before the `Custom` early-return, so even custom models fail on unsupported regions.","triggerScenarios":"Configuring Zed's Bedrock provider with a region outside the recognized buckets: `cn-north-1`/`cn-northwest-1` (China partitions), `af-south-1` (Africa), `il-central-1` (Israel), `mx-central-1`, or any typo'd region string like `use-east-1`. The `converse_model_id`/profile rewrite path then fails before any AWS call is made.","commonSituations":"Users on Bedrock China partition regions; newer AWS regions (af-, il-, mx-) added after this mapping was written; typos or wrong partitions (`aws-cn` vs `aws`) in credentials/config; company-mandated region not in the mapping.","solutions":["Switch the Bedrock region setting to one the mapping covers (any us-/sa-/ca-/eu-/me-/ap- region, plus the special-cased ap-southeast-2/4 and ap-northeast-1/3).","Fix typos: verify the region string against `aws configure list` / your AWS config.","If you must use an unmapped region, update Zed — newer releases extend this mapping; or contribute the region group upstream.","As a code-level guard, validate the region against the recognized prefixes before constructing the model id."],"exampleFix":"// before: unmapped region aborts id construction\nlet model_id = model.converse_model_id(\"af-south-1\", allow_global)?; // Unsupported Region af-south-1\n\n// after: validate the region bucket up front\nconst SUPPORTED_PREFIXES: [&str; 6] = [\"us-gov-\", \"us-\", \"sa-\", \"ca-\", \"eu-\", \"me-\"];\nlet region_group_ok = SUPPORTED_PREFIXES.iter().any(|p| region.starts_with(p))\n    || region.starts_with(\"ap-\");\nanyhow::ensure!(region_group_ok, \"region {region} has no Bedrock inference profile group; use a supported region\");\nlet model_id = model.converse_model_id(region, allow_global)?;","handlingStrategy":"validation","validationCode":"// Validate the region bucket before any converse_model_id call\nfn region_has_profile_group(region: &str) -> bool {\n    region.starts_with(\"us-gov-\") || region.starts_with(\"us-\") || region.starts_with(\"sa-\")\n        || region.starts_with(\"ca-\") || region.starts_with(\"eu-\")\n        || region == \"ap-southeast-2\" || region == \"ap-southeast-4\"\n        || region == \"ap-northeast-1\" || region == \"ap-northeast-3\"\n        || region.starts_with(\"ap-\") || region.starts_with(\"me-\")\n}\nanyhow::ensure!(region_has_profile_group(region), \"region {region} unsupported for Bedrock inference profiles\");","typeGuard":"fn supported_bedrock_region(region: &str) -> bool {\n    // true when the region maps to an inference-profile group (see validation snippet)\n    region_has_profile_group(region)\n}","tryCatchPattern":"match model.converse_model_id(region, allow_global) {\n    Err(err) if err.to_string().contains(\"Unsupported Region\") => {\n        return Err(anyhow!(\"{err:#}; switch to a us-/eu-/ap-/me-/sa-/ca- region or update Zed\"));\n    }\n    result => result?,\n}","preventionTips":["Pin the Bedrock provider to a mainstream region (us-east-1, eu-central-1, ap-northeast-1, ...).","Remember cn-*, af-*, il-*, and mx-* regions have no group and fail even for Custom models.","Keep Zed updated — the region mapping is extended as AWS adds inference-profile regions."],"tags":["bedrock","aws-region","inference-profile","settings"],"backgroundTag":"unsupported-region","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}