GoogleContainerTools/skaffold · error

executing build: %w

Error message

executing build: %w

What it means

In `skaffold render`, when no pre-built images are supplied, render builds the target artifacts itself via `r.Build`. This wrapper reports any build failure. It means the build step (kaniko, docker, jib, etc.) failed while render was producing manifests, so there are no tagged images to render with.

Source

Thrown at cmd/skaffold/app/cmd/render.go:74

	buildOut := io.Discard
	if showBuild {
		buildOut = out
	}

	return withRunner(ctx, out, func(r runner.Runner, configs []util.VersionedConfig) error {
		var bRes []graph.Artifact
		var err error

		if fromBuildOutputFile.String() != "" || len(preBuiltImages.GetSlice()) > 0 {
			// pass `nil` as render shouldn't build if provided --build-artifacts or --images
			bRes, err = getBuildArtifactsAndSetTags(nil, r.ApplyDefaultRepo)
			if err != nil {
				return fmt.Errorf("loading artifacts: %w", err)
			}
		} else {
			bRes, err = r.Build(ctx, buildOut, targetArtifacts(opts, configs))
			if err != nil {
				return fmt.Errorf("executing build: %w", err)
			}
		}

		manifests, err := r.Render(ctx, out, bRes, offline)
		if err != nil {
			return fmt.Errorf("rendering manifests: %w", err)
		}
		return manifest.Write(manifests.String(), opts.RenderOutput, out)
	})
}

View on GitHub (pinned to a1189de023)

Solutions

  1. Run `skaffold build` (or `skaffold dev`) directly to see the full underlying build error.
  2. Fix the reported build issue: Dockerfile errors, missing dependencies, or compile failures.
  3. Confirm the Docker daemon/container runtime is running and reachable.
  4. If you only want to render, skip building by passing pre-built artifacts: `skaffold render --build-artifacts artifacts.json`.

Example fix

// before: render tries to build and fails on daemon down
skaffold render
// after: use pre-built artifacts so render never builds
skaffold build -q > artifacts.json
skaffold render --build-artifacts artifacts.json
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight checks before a render that builds
const dockerOk = (() => { try { execSync('docker info', {stdio: 'ignore'}); return true; } catch { return false; } })();
if (!dockerOk) throw new Error('Docker daemon unreachable; skaffold render would fail building');
// and confirm the source compiles/builds cheaply first:
execFileSync('skaffold', ['build', '-q'], {stdio: 'pipe'}); // isolate build failures from render

Try / catch

try {
  execFileSync('skaffold', ['render'], {stdio: 'pipe'});
} catch (e) {
  const msg = e.stderr?.toString() ?? '';
  if (msg.includes('executing build')) {
    console.error('Render-time build failed; run `skaffold build` to see the raw error.');
    // fallback: render with pre-built artifacts
    execFileSync('skaffold', ['render', '--build-artifacts', 'artifacts.json']);
  } else throw e;
}

Prevention

When it happens

Trigger: `skaffold render` without --build-artifacts/--images where the underlying build fails: Dockerfile syntax error, missing base image, buildkit daemon unreachable, out-of-disk build context, compile errors in the source, or jib/gradle/maven failures.

Common situations: Docker daemon not running or not accessible; source code does not compile; Dockerfile FROM image not pullable (private registry auth); file-sync/context too large; running render remotely where local images aren't available.

Related errors


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