{"record":{"id":"d041a059677193ee","repo":"GoogleContainerTools/skaffold","slug":"statuscode-deploy-cloud-run-update-worker-pool-err","errorCode":"StatusCode_DEPLOY_CLOUD_RUN_UPDATE_WORKER_POOL_ERR","errorMessage":"error deploying Cloud Run WorkerPool: %s","messagePattern":"error deploying Cloud Run WorkerPool: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/cloudrun/deploy.go","lineNumber":472,"sourceCode":"\t_, err := getCall.Do()\n\n\tif err != nil {\n\t\tgErr, ok := err.(*googleapi.Error)\n\t\tif !ok || gErr.Code != http.StatusNotFound {\n\t\t\treturn nil, sErrors.NewError(fmt.Errorf(\"error checking Cloud Run State: %w\", err), &proto.ActionableErr{\n\t\t\t\tMessage: err.Error(),\n\t\t\t\tErrCode: proto.StatusCode_DEPLOY_CLOUD_RUN_GET_WORKER_POOL_ERR,\n\t\t\t})\n\t\t}\n\t\t// This is a new workerpool, we need to create it\n\t\tcreateCall := crclient.Namespaces.Workerpools.Create(parent, workerpool)\n\t\t_, err = createCall.Do()\n\t} else {\n\t\treplaceCall := crclient.Namespaces.Workerpools.ReplaceWorkerPool(wpName, workerpool)\n\t\t_, err = replaceCall.Do()\n\t}\n\tif err != nil {\n\t\treturn nil, sErrors.NewError(fmt.Errorf(\"error deploying Cloud Run WorkerPool: %s\", err), &proto.ActionableErr{\n\t\t\tMessage: err.Error(),\n\t\t\tErrCode: proto.StatusCode_DEPLOY_CLOUD_RUN_UPDATE_WORKER_POOL_ERR,\n\t\t})\n\t}\n\treturn &resName, nil\n}\n\nfunc (d *Deployer) cleanupRun(ctx context.Context, out io.Writer, dryRun bool, manifests manifest.ManifestList) error {\n\tvar errors []error\n\tcOptions := d.clientOptions\n\tif d.useGcpOptions {\n\t\tcOptions = append(cOptions, option.WithEndpoint(fmt.Sprintf(\"%s-run.googleapis.com\", d.Region)))\n\t\tcOptions = append(gcp.ClientOptions(ctx), cOptions...)\n\t}\n\tcrclient, err := run.NewService(ctx, cOptions...)\n\tif err != nil {\n\t\treturn sErrors.NewError(fmt.Errorf(\"unable to create Cloud Run Client\"), &proto.ActionableErr{\n\t\t\tMessage: err.Error(),","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/cloudrun/deploy.go#L454-L490","documentation":"deployWorkerPool finalizes by calling Workerpools.Create (new pool) or ReplaceWorkerPool (existing pool). Any error from either call is wrapped as DEPLOY_CLOUD_RUN_UPDATE_WORKER_POOL_ERR with the upstream message; the WorkerPool was not deployed.","triggerScenarios":"CreateCall.Do() or ReplaceWorkerPool.Do() returns an error: invalid WorkerPool spec (400), 403 missing permissions, quota exceeded, immutable field conflicts on replace, or network failure.","commonSituations":"WorkerPool feature not enabled/allowed in the project (alpha surfaces); invalid CPU/memory or container spec rejected by the API; service account lacks run.workerpools permissions; regional quota exhaustion.","solutions":["Read the wrapped message for the API's specific rejection reason (usually names the invalid field)","Confirm the WorkerPool API is enabled/allowlisted for the project and region","Check IAM permissions for creating/updating WorkerPools","Validate CPU/memory/GPU settings against Cloud Run WorkerPool limits","Retry on transient 5xx errors"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// sanity-check WorkerPool spec before submit\nspec := workerpool.Spec.Template.Spec\nif len(spec.Containers) == 0 {\n    return fmt.Errorf(\"workerpool has no containers\")\n}\nif spec.Containers[0].Image == \"\" {\n    return fmt.Errorf(\"workerpool container image is empty\")\n}","typeGuard":"func isWPAPIRejection(err error) bool {\n    var gErr *googleapi.Error\n    return errors.As(err, &gErr) && gErr.Code == 400\n}","tryCatchPattern":"err := deployWorkerPool(crclient, manifest, out)\nif err != nil {\n    var gErr *googleapi.Error\n    if errors.As(err, &gErr) {\n        switch {\n        case gErr.Code == 400:\n            log.Errorf(\"invalid WorkerPool spec: %s\", gErr.Body)\n        case gErr.Code == 403:\n            return fmt.Errorf(\"missing WorkerPool create/update permission\")\n        case gErr.Code >= 500 || gErr.Code == 429:\n            return retryDeploy()\n        }\n    }\n    return err\n}","preventionTips":["Confirm WorkerPool API availability in your project/region","Validate CPU/memory/GPU values against WorkerPool limits","Check image URIs are resolvable before deploying","Retry transient 5xx with backoff"],"tags":["cloud-run","workerpool","deployment","gcp-api"],"backgroundTag":"cloud-run-deploy-rejected","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"}