{"record":{"id":"711dec2f0fc6ee91","repo":"GoogleContainerTools/skaffold","slug":"expected-all-cloud-run-deploys-to-use-the-same-pro","errorCode":null,"errorMessage":"expected all Cloud Run deploys to use the same project, found deploys to projects %s and %s","messagePattern":"expected all Cloud Run deploys to use the same project, found deploys to projects (.+?) and (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/deployer.go","lineNumber":354,"sourceCode":"\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}\n\t\t\t}\n\t\t}\n\t}\n\tstatusCheckDeadline := maxStatusCheckDeadline(deployers)\n\ttolerateFailures := runCtx.StatusCheckTolerateFailures()\n\t// The runctx.StatusCheck() method returns the value set by the cli flag `--status-check`,\n\t// which overrides the value set in the individual configs.\n\tif cliStatusCheck := runCtx.StatusCheck(); cliStatusCheck != nil {","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/deployer.go#L336-L372","documentation":"The Cloud Run deployer requires all Cloud Run deploy stanzas to target the same Google Cloud project. When no --project flag is supplied and configs disagree on ProjectID, this error aborts deployer construction.","triggerScenarios":"getCloudRunDeployer iterating configs: projectFlag not set, defaultProject already set from a prior stanza, and current crDeploy.ProjectID differs from it.","commonSituations":"Composing multiple skaffold configs that deploy Cloud Run services into different GCP projects; running `skaffold apply` without --project in a multi-project setup.","solutions":["Pass --project to pin a single target project","Set the same ProjectID in every CloudRunDeploy stanza","Split deploys per project into separate skaffold runs"],"exampleFix":"// before\nprojects: proj-a / proj-b\n// after\nskaffold apply --project proj-a","handlingStrategy":"validation","validationCode":"const projects = [...new Set(configs.map(c => c.deploy?.cloudrun?.projectId).filter(Boolean))]\nif (projects.length > 1 && !cliProject) throw new Error(`multiple projects in configs: ${projects}; pass --project`)","typeGuard":"function singleProject(configs, cliProject) {\n  const set = new Set(configs.map(c => c.deploy?.cloudrun?.projectId).filter(Boolean))\n  return cliProject != null || set.size <= 1\n}","tryCatchPattern":"if err := getCloudRunDeployer(...); err != nil {\n    if strings.Contains(err.Error(), \"same project\") {\n        return retryWithFlag(\"--project\", firstProject)\n    }\n    return err\n}","preventionTips":["Pin one GCP project per skaffold invocation","Always pass --project in multi-project environments","Keep ProjectID consistent across composed configs"],"tags":["cloud-run","gcp","project","config-conflict"],"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"}