{"record":{"id":"c33110627b473823","repo":"GoogleContainerTools/skaffold","slug":"skaffold-deployment-failed-d-d-failed-to-comple","errorCode":null,"errorMessage":"skaffold deployment failed. %d/%d failed to complete","messagePattern":"skaffold deployment failed\\. (.+?)/(.+?) failed to complete","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/cloudrun/status.go","lineNumber":124,"sourceCode":"\t\t\tif res.ae.ErrCode != proto.StatusCode_STATUSCHECK_SUCCESS {\n\t\t\t\texitStatusOnce.Do(func() { exitStatus = res.ae.ErrCode })\n\t\t\t\tcancel()\n\t\t\t}\n\t\t\ts.printStatusCheckSummary(out, c, resource)\n\t\t}(resource)\n\t}\n\t// Retrieve pending resource statuses\n\tgo func() {\n\t\ts.printResourceStatus(ctx, out, resources)\n\t}()\n\n\twg.Wait()\n\treturn checkResults(c, exitStatus)\n}\n\nfunc checkResults(c *counter, exitStatus proto.StatusCode) error {\n\tif exitStatus != proto.StatusCode_STATUSCHECK_SUCCESS {\n\t\treturn fmt.Errorf(\"skaffold deployment failed. %d/%d failed to complete\", c.pending, c.total)\n\t}\n\treturn nil\n}\n\ntype counter struct {\n\ttotal   int32\n\tpending int32\n}\n\nfunc newCounter(i int) *counter {\n\treturn &counter{\n\t\ttotal:   int32(i),\n\t\tpending: int32(i),\n\t}\n}\n\nfunc (c *counter) markComplete() {\n\tatomic.AddInt32(&c.pending, int32(-1))","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/cloudrun/status.go#L106-L142","documentation":"After waiting for all Cloud Run sub-resources to reach a terminal state, `checkResults` verifies the aggregated exit status. If the status is anything other than STATUSCHECK_SUCCESS, it fails reporting how many resources are still pending out of the total monitored.","triggerScenarios":"Cloud Run service/job/worker-pool deployment failed or did not become ready within the status-check deadline; the `gcloud run deploy` step returned a non-success status code; a sub-resource returned an error that set the overall exitStatus.","commonSituations":"Container image fails to start in Cloud Run (bad port, crash loop); insufficient IAM permissions for deployment; quota exceeded; status-check timeout (default deadline) too short for slow-starting services.","solutions":["Inspect earlier skaffold/`gcloud` output for the underlying Cloud Run failure (IAM, quota, image pull, container crash)","Increase the status-check deadline in skaffold.yaml (deploy.cloudrun or statusCheckDeadlineSeconds)","Verify the container serves on the expected port and passes Cloud Run health/startup probes","Re-run with `skaffold deploy --status-check=false` to bypass status checking while debugging"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check Cloud Run readiness prerequisites\nif out, err := exec.Command(\"gcloud\", \"run\", \"services\", \"describe\", serviceName, \"--region\", region).Output(); err != nil {\n    // service may not be deployable; check IAM/quota first\n}\n","typeGuard":null,"tryCatchPattern":"err := skaffoldDeploy()\nif err != nil && strings.Contains(err.Error(), \"failed to complete\") {\n    log.Printf(\"Cloud Run deploy had %v; inspect gcloud output for root cause\", err)\n    // check service status: gcloud run services describe <svc> --region <region>\n}\n","preventionTips":["Set an adequate statusCheckDeadlineSeconds for slow-starting services","Verify container listens on $PORT and passes Cloud Run health checks","Check IAM roles (run.admin, iam.serviceAccountUser) and quotas before deploying","Tail Cloud Run logs for crash-loop causes when the deploy fails"],"tags":["cloudrun","deployment","statuscheck"],"backgroundTag":"deployment-not-ready","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"}