{"record":{"id":"2fa5e0be8da3d3cd","repo":"GoogleContainerTools/skaffold","slug":"init-cloud-run-location-error","errorCode":"INIT_CLOUD_RUN_LOCATION_ERROR","errorMessage":"location must be specified with Cloud Run Deployer","messagePattern":"location must be specified with Cloud Run Deployer","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":923,"sourceCode":"\trunDeployer := false\n\thasLocation := false\n\tif rCtx.Opts.CloudRunLocation != \"\" {\n\t\thasLocation = true\n\t}\n\tif rCtx.Opts.CloudRunProject != \"\" {\n\t\trunDeployer = true\n\t} else {\n\t\tfor _, deployer := range rCtx.Pipelines.Deployers() {\n\t\t\tif deployer.CloudRunDeploy != nil {\n\t\t\t\trunDeployer = true\n\t\t\t\tif deployer.CloudRunDeploy.Region != \"\" {\n\t\t\t\t\thasLocation = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif runDeployer && !hasLocation {\n\t\treturn []error{sErrors.NewError(errors.New(\"location must be specified with Cloud Run Deployer\"),\n\t\t\t&proto.ActionableErr{\n\t\t\t\tMessage: \"Cloud Run Location is not specified\",\n\t\t\t\tErrCode: proto.StatusCode_INIT_CLOUD_RUN_LOCATION_ERROR,\n\t\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t\t{\n\t\t\t\t\t\tSuggestionCode: proto.SuggestionCode_SPECIFY_CLOUD_RUN_LOCATION,\n\t\t\t\t\t\tAction: \"Specify a Cloud Run location via the deploy.cloudrun.region field in skaffold.yaml \" +\n\t\t\t\t\t\t\t\"or the --cloud-run-location flag\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t}\n\t}\n\treturn nil\n}\n\n// requiresCloudRun returns true if the current command needs to connect to a Cloud Run regional endpoint.\nfunc requiresCloudRun(rCtx *runcontext.RunContext) bool {","sourceCodeStart":905,"sourceCodeEnd":941,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L905-L941","documentation":"The Cloud Run deployer requires an explicit deployment `location` (GCP region, e.g. us-central1). Validation walks the deployer configs for Cloud Run sections and, if any Cloud Run deployer is active but none sets a location, this actionable error is thrown.","triggerScenarios":"Using `deploy: cloudrun: {}` (or cloudrun in a profile) without `location:`; relying on gcloud default region, which Skaffold does not use; migrating from `gcb`/cloud-build deployer configs to cloudrun without adding location.","commonSituations":"New projects adopting Cloud Run deployer; profiles inheriting from a base config that lacks location; team members without gcloud defaults configured expecting auto-detection.","solutions":["Add `location: <region>` under `deploy.cloudrun` in skaffold.yaml (e.g. us-central1).","Alternatively set it via the `--cloud-run-location` flag when running skaffold.","Set the CLOUDSDK_CORE_REGION / gcloud default if using tooling that honors it — but prefer explicit config for Skaffold.","If Cloud Run deployer is unintended, remove/replace the cloudrun deploy section."],"exampleFix":"# before\ndeploy:\n  cloudrun: {}\n# after\ndeploy:\n  cloudrun:\n    location: us-central1","handlingStrategy":"validation","validationCode":"const cr = cfg.deploy?.cloudrun;\nif (cr && !cr.location && !process.argv.includes('--cloud-run-location')) {\n  throw new Error('deploy.cloudrun.location is required');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set location under deploy.cloudrun explicitly","Pass --cloud-run-location in CI where config is shared","Don't rely on gcloud defaults for Skaffold Cloud Run deploys"],"tags":["skaffold","cloud-run","gcp","config-validation"],"backgroundTag":"missing-required-config-field","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"}