GoogleContainerTools/skaffold · error

INIT_CLOUD_RUN_LOCATION_ERROR

INIT_CLOUD_RUN_LOCATION_ERROR

Error message

location must be specified with Cloud Run Deployer

What it means

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.

Source

Thrown at pkg/skaffold/schema/validation/validation.go:923

	runDeployer := false
	hasLocation := false
	if rCtx.Opts.CloudRunLocation != "" {
		hasLocation = true
	}
	if rCtx.Opts.CloudRunProject != "" {
		runDeployer = true
	} else {
		for _, deployer := range rCtx.Pipelines.Deployers() {
			if deployer.CloudRunDeploy != nil {
				runDeployer = true
				if deployer.CloudRunDeploy.Region != "" {
					hasLocation = true
				}
			}
		}
	}
	if runDeployer && !hasLocation {
		return []error{sErrors.NewError(errors.New("location must be specified with Cloud Run Deployer"),
			&proto.ActionableErr{
				Message: "Cloud Run Location is not specified",
				ErrCode: proto.StatusCode_INIT_CLOUD_RUN_LOCATION_ERROR,
				Suggestions: []*proto.Suggestion{
					{
						SuggestionCode: proto.SuggestionCode_SPECIFY_CLOUD_RUN_LOCATION,
						Action: "Specify a Cloud Run location via the deploy.cloudrun.region field in skaffold.yaml " +
							"or the --cloud-run-location flag",
					},
				},
			}),
		}
	}
	return nil
}

// requiresCloudRun returns true if the current command needs to connect to a Cloud Run regional endpoint.
func requiresCloudRun(rCtx *runcontext.RunContext) bool {

View on GitHub (pinned to a1189de023)

Solutions

  1. Add `location: <region>` under `deploy.cloudrun` in skaffold.yaml (e.g. us-central1).
  2. Alternatively set it via the `--cloud-run-location` flag when running skaffold.
  3. Set the CLOUDSDK_CORE_REGION / gcloud default if using tooling that honors it — but prefer explicit config for Skaffold.
  4. If Cloud Run deployer is unintended, remove/replace the cloudrun deploy section.

Example fix

# before
deploy:
  cloudrun: {}
# after
deploy:
  cloudrun:
    location: us-central1
Defensive patterns

Strategy: validation

Validate before calling

const cr = cfg.deploy?.cloudrun;
if (cr && !cr.location && !process.argv.includes('--cloud-run-location')) {
  throw new Error('deploy.cloudrun.location is required');
}

Prevention

When it happens

Trigger: 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.

Common situations: New projects adopting Cloud Run deployer; profiles inheriting from a base config that lacks location; team members without gcloud defaults configured expecting auto-detection.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/2fa5e0be8da3d3cd. Report an issue: GitHub.