{"record":{"id":"f62b12646f396184","repo":"GoogleContainerTools/skaffold","slug":"statuscode-deploy-cloud-run-delete-worker-pool-err","errorCode":"StatusCode_DEPLOY_CLOUD_RUN_DELETE_WORKER_POOL_ERR","errorMessage":"unable to delete Cloud Run WorkerPool","messagePattern":"unable to delete Cloud Run WorkerPool","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/cloudrun/deploy.go","lineNumber":634,"sourceCode":"\t\tprojectID = workerpool.Metadata.Namespace\n\tdefault:\n\t\t// no project specified, we don't know what to delete.\n\t\treturn sErrors.NewError(fmt.Errorf(\"unable to determine Google Cloud Project\"), &proto.ActionableErr{\n\t\t\tMessage: \"No Google Cloud Project found in Cloud Run manifest or Skaffold Manifest.\",\n\t\t\tErrCode: proto.StatusCode_DEPLOY_READ_MANIFEST_ERR,\n\t\t})\n\t}\n\tparent := fmt.Sprintf(\"namespaces/%s\", projectID)\n\tsName := fmt.Sprintf(\"%s/workerpools/%s\", parent, workerpool.Metadata.Name)\n\tif dryRun {\n\t\toutput.Yellow.Fprintln(out, sName)\n\t\treturn nil\n\t}\n\n\tdelCall := crclient.Namespaces.Workerpools.Delete(sName)\n\t_, err := delCall.Do()\n\tif err != nil {\n\t\treturn sErrors.NewError(fmt.Errorf(\"unable to delete Cloud Run WorkerPool\"), &proto.ActionableErr{\n\t\t\tMessage: err.Error(),\n\t\t\tErrCode: proto.StatusCode_DEPLOY_CLOUD_RUN_DELETE_WORKER_POOL_ERR,\n\t\t})\n\t}\n\treturn nil\n}\n\nfunc getTypeFromManifest(manifest []byte) (string, error) {\n\tresource := &unstructured.Unstructured{}\n\tif err := k8syaml.Unmarshal(manifest, resource); err != nil {\n\t\treturn \"\", sErrors.NewError(fmt.Errorf(\"unable to unmarshal Cloud Run Service config: %w\", err), &proto.ActionableErr{\n\t\t\tMessage: err.Error(),\n\t\t\tErrCode: proto.StatusCode_DEPLOY_READ_MANIFEST_ERR,\n\t\t})\n\t}\n\tswitch {\n\tcase resource.GetAPIVersion() == \"serving.knative.dev/v1\" && resource.GetKind() == \"Service\":\n\t\treturn typeService, nil","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/cloudrun/deploy.go#L616-L652","documentation":"Thrown by deleteRunWorkerPool when the WorkerPools API delete call (crclient.Namespaces.Workerpools.Delete(sName).Do()) fails. Resource name construction succeeded, but the API returned an error, which is embedded verbatim in the actionable error message.","triggerScenarios":"cleanupRun -> deleteRunWorkerPool calls Namespaces.Workerpools.Delete on namespaces/<proj>/workerpools/<name> and the API returns non-2xx or a transport error.","commonSituations":"WorkerPool already deleted or never created (404); missing IAM permission for the (alpha) WorkerPool API; WorkerPool API not enabled/available in the project or region; transient network failures.","solutions":["Check the embedded API error: 404 means nothing to delete — safe to continue","Ensure the Cloud Run Worker Pool API is enabled and the caller has delete permissions (roles/run.admin)","Confirm the project and workerpool name in the constructed resource name are correct","Retry transient 5xx/network failures with backoff"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"call := crclient.Namespaces.Workerpools.Get(sName)\nif _, err := call.Do(); err != nil {\n\tif gErr, ok := err.(*googleapi.Error); ok && gErr.Code == 404 {\n\t\treturn nil // already gone\n\t}\n\treturn err\n}","typeGuard":null,"tryCatchPattern":"if _, err := delCall.Do(); err != nil {\n\tvar gErr *googleapi.Error\n\tif errors.As(err, &gErr) {\n\t\tswitch {\n\t\tcase gErr.Code == 404:\n\t\t\treturn nil // idempotent\n\t\tcase gErr.Code == 403:\n\t\t\treturn fmt.Errorf(\"missing WorkerPool delete permission / API not enabled: %w\", err)\n\t\tcase gErr.Code == 429 || gErr.Code >= 500:\n\t\t\treturn retryWithBackoff(delCall)\n\t\t}\n\t}\n\treturn err\n}","preventionTips":["Enable the Cloud Run Worker Pools (alpha) API in the target project","Grant the caller roles/run.admin for WorkerPool delete access","Treat 404 as success to keep cleanup idempotent","Retry 429/5xx with exponential backoff"],"tags":["gcp","cloud-run","api","deletion","workerpool"],"backgroundTag":"cloud-run-api-delete-failed","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"}