GoogleContainerTools/skaffold · error

skaffold deployment failed. %d/%d failed to complete

Error message

skaffold deployment failed. %d/%d failed to complete

What it means

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.

Source

Thrown at pkg/skaffold/deploy/cloudrun/status.go:124

			if res.ae.ErrCode != proto.StatusCode_STATUSCHECK_SUCCESS {
				exitStatusOnce.Do(func() { exitStatus = res.ae.ErrCode })
				cancel()
			}
			s.printStatusCheckSummary(out, c, resource)
		}(resource)
	}
	// Retrieve pending resource statuses
	go func() {
		s.printResourceStatus(ctx, out, resources)
	}()

	wg.Wait()
	return checkResults(c, exitStatus)
}

func checkResults(c *counter, exitStatus proto.StatusCode) error {
	if exitStatus != proto.StatusCode_STATUSCHECK_SUCCESS {
		return fmt.Errorf("skaffold deployment failed. %d/%d failed to complete", c.pending, c.total)
	}
	return nil
}

type counter struct {
	total   int32
	pending int32
}

func newCounter(i int) *counter {
	return &counter{
		total:   int32(i),
		pending: int32(i),
	}
}

func (c *counter) markComplete() {
	atomic.AddInt32(&c.pending, int32(-1))

View on GitHub (pinned to a1189de023)

Solutions

  1. Inspect earlier skaffold/`gcloud` output for the underlying Cloud Run failure (IAM, quota, image pull, container crash)
  2. Increase the status-check deadline in skaffold.yaml (deploy.cloudrun or statusCheckDeadlineSeconds)
  3. Verify the container serves on the expected port and passes Cloud Run health/startup probes
  4. Re-run with `skaffold deploy --status-check=false` to bypass status checking while debugging
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check Cloud Run readiness prerequisites
if out, err := exec.Command("gcloud", "run", "services", "describe", serviceName, "--region", region).Output(); err != nil {
    // service may not be deployable; check IAM/quota first
}

Try / catch

err := skaffoldDeploy()
if err != nil && strings.Contains(err.Error(), "failed to complete") {
    log.Printf("Cloud Run deploy had %v; inspect gcloud output for root cause", err)
    // check service status: gcloud run services describe <svc> --region <region>
}

Prevention

When it happens

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

Common situations: 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.

Related errors


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