{"record":{"id":"d34adc1ea71c30e3","repo":"GoogleContainerTools/skaffold","slug":"expected-all-cloud-run-deploys-to-be-in-the-same-r","errorCode":null,"errorMessage":"expected all Cloud Run deploys to be in the same region, found deploys to %s and %s","messagePattern":"expected all Cloud Run deploys to be in the same region, found deploys to (.+?) and (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/deployer.go","lineNumber":346,"sourceCode":"\tregionFlag := false\n\tvar defaultProject string\n\tprojectFlag := false\n\tif runCtx.Opts.CloudRunLocation != \"\" {\n\t\tregion = runCtx.Opts.CloudRunLocation\n\t\tregionFlag = true\n\t}\n\tif runCtx.Opts.CloudRunProject != \"\" {\n\t\tdefaultProject = runCtx.Opts.CloudRunProject\n\t\tprojectFlag = true\n\t}\n\tvar enableStatusCheck *bool\n\tfor _, d := range deployers {\n\t\tif d.CloudRunDeploy != nil {\n\t\t\tcrDeploy := d.CloudRunDeploy\n\t\t\tif !regionFlag {\n\t\t\t\t// No region flag was provided, so take it from the config.\n\t\t\t\tif region != \"\" && region != crDeploy.Region {\n\t\t\t\t\treturn nil, fmt.Errorf(\"expected all Cloud Run deploys to be in the same region, found deploys to %s and %s\", region, crDeploy.Region)\n\t\t\t\t}\n\n\t\t\t\tregion = crDeploy.Region\n\t\t\t}\n\t\t\tif !projectFlag {\n\t\t\t\t// No project flag was specified so take it from the config.\n\t\t\t\tif defaultProject != \"\" && defaultProject != crDeploy.ProjectID {\n\t\t\t\t\treturn nil, fmt.Errorf(\"expected all Cloud Run deploys to use the same project, found deploys to projects %s and %s\", defaultProject, crDeploy.ProjectID)\n\t\t\t\t}\n\t\t\t\tdefaultProject = crDeploy.ProjectID\n\t\t\t}\n\t\t\tif d.StatusCheck != nil {\n\t\t\t\tif enableStatusCheck == nil {\n\t\t\t\t\tenableStatusCheck = d.StatusCheck\n\t\t\t\t} else if enableStatusCheck != d.StatusCheck {\n\t\t\t\t\t// if we get conflicting values for status check from different skaffold configs, we turn status check off\n\t\t\t\t\tenableStatusCheck = util.Ptr(false)\n\t\t\t\t}","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/deployer.go#L328-L364","documentation":"The Cloud Run deployer for `skaffold apply` requires every Cloud Run deploy stanza to target one region. When no --region flag is supplied and configs disagree (first non-empty region vs a subsequent different region), this error aborts deployer construction.","triggerScenarios":"getCloudRunDeployer iterating multiple configs: regionFlag not set, region already taken from a previous stanza, and current crDeploy.Region differs from it.","commonSituations":"Multi-config skaffold project (skaffold.yaml with multiple -f configs) where one config deploys to us-central1 and another to europe-west1; forgotten --region flag.","solutions":["Pass an explicit --region flag so config regions are ignored","Make all CloudRunDeploy.Region values identical across configs","Split the deployment into separate skaffold invocations per region"],"exampleFix":"// before (configs disagree, no flag)\nregions: us-central1 / europe-west1\n// after\nskaffold apply --region us-central1","handlingStrategy":"validation","validationCode":"const regions = [...new Set(configs.map(c => c.deploy?.cloudrun?.region).filter(Boolean))]\nif (regions.length > 1 && !cliRegion) throw new Error(`multiple regions in configs: ${regions}; pass --region`)","typeGuard":"function singleRegion(configs, cliRegion) {\n  const set = new Set(configs.map(c => c.deploy?.cloudrun?.region).filter(Boolean))\n  return cliRegion != null || set.size <= 1\n}","tryCatchPattern":"if err := getCloudRunDeployer(...); err != nil {\n    if strings.Contains(err.Error(), \"same region\") {\n        return retryWithFlag(\"--region\", firstRegion)\n    }\n    return err\n}","preventionTips":["Always pass --region for multi-config Cloud Run projects","Keep Region identical across all cloudrun stanzas","Lint composed configs before apply"],"tags":["cloud-run","region","config-conflict","skaffold"],"backgroundTag":"multi-config-region-mismatch","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}