GoogleContainerTools/skaffold · error

executing build: %w

Error message

executing build: %w

What it means

Wraps a failure from Runner.Build during `skaffold delete`. Delete intentionally performs a full build and render (RenderOnly=true, tag digest source) to reconstruct the manifests before cleanup, so any build error — failed container image build, push failure, missing builder — surfaces here instead of during deploy.

Source

Thrown at cmd/skaffold/app/cmd/delete.go:53

// NewCmdDelete describes the CLI command to delete deployed resources.
func NewCmdDelete() *cobra.Command {
	return NewCmd("delete").
		WithDescription("Delete any resources deployed by Skaffold").
		WithCommonFlags().
		WithExample("Print the resources to be deleted", "delete --dry-run").
		WithFlags([]*Flag{
			{Value: &dryRun, Name: "dry-run", DefValue: false, Usage: "Don't delete resources, just print them.", IsEnum: true},
		}).
		NoArgs(doDelete)
}

func doDelete(ctx context.Context, out io.Writer) error {
	opts.DigestSource = constants.TagDigestSource
	opts.RenderOnly = true
	return withRunner(ctx, out, func(r runner.Runner, configs []util.VersionedConfig) error {
		bRes, err := r.Build(ctx, io.Discard, targetArtifacts(opts, configs))
		if err != nil {
			return fmt.Errorf("executing build: %w", err)
		}

		manifestListByConfig, err := r.Render(ctx, io.Discard, bRes, false)
		if err != nil {
			return fmt.Errorf("rendering manifests: %w", err)
		}
		return r.Cleanup(ctx, out, dryRun, manifestListByConfig, opts.Command)
	})
}

View on GitHub (pinned to a1189de023)

Solutions

  1. Inspect the wrapped underlying error for the real build failure (daemon down, Dockerfile error, push denied)
  2. Start/repair the builder (e.g. `docker info`) or fix the Dockerfile/config
  3. If cleanup is urgent, skip manifest reconstruction with `skaffold delete --dry-run=false` alternatives or manually delete resources (kubectl delete)
  4. Use `skaffold delete` from the same working directory/config used for deploy

Example fix

// before: delete fails because tagger needs to rebuild to get digests
// after: keep image digests so delete can clean up without a fresh build
//   export KUBECONFIG and run deploy with --digest-source=local, or
//   skaffold delete --kube-context <ctx>   # after fixing build
# fallback manual cleanup
kubectl delete -f <rendered-manifests.yaml>
Defensive patterns

Strategy: try-catch

Validate before calling

// before delete, confirm the builder works
docker info >/dev/null 2>&1 || echo "docker daemon down"
skaffold build --dry-run 2>/dev/null || echo "check skaffold.yaml build section"

Try / catch

err := skaffoldDelete(); err != nil {
    if strings.Contains(err.Error(), "executing build:") {
        // underlying cause is after this prefix — inspect and fix build env
    }
}

Prevention

When it happens

Trigger: Running `skaffold delete` when the build step fails: Dockerfile/builder error, registry push failure, missing dependencies, or invalid build configuration, since delete re-runs the build to regenerate manifests for cleanup.

Common situations: Cluster/image context changed since the resources were deployed so the build no longer succeeds; Docker daemon not running; registry credentials expired; user modified source files or build config after deploy.

Related errors


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