GoogleContainerTools/skaffold · error

creating builder: %w

Error message

creating builder: %w

What it means

Skaffold's NewForConfig wraps any failure that occurs while constructing the build pipeline (including build hooks wiring) with "creating builder: %w". It means the runner could not be created because the builder setup step returned an error, and the underlying cause is preserved via %w for errors.Is/As unwrapping.

Source

Thrown at pkg/skaffold/runner/new.go:155

	artifactCache, err := cache.NewCache(ctx, runCtx, isLocalImage, depLister, g, store)
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))
		return nil, fmt.Errorf("initializing cache: %w", err)
	}
	// The Builder must be instantiated AFTER the Deployer, because the Deploy target influences
	// the Cluster object on the RunContext, which in turn influences whether or not we will push images.
	var builder build.Builder
	builder, err = build.NewBuilderMux(runCtx, store, artifactCache, func(p latest.Pipeline) (build.PipelineBuilder, error) {
		pb, err := GetBuilder(ctx, runCtx, store, sourceDependencies, p)
		if err != nil {
			return nil, err
		}
		return withPipelineBuildHooks(pb, p.Build.Hooks), nil
	})
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))
		return nil, fmt.Errorf("creating builder: %w", err)
	}

	builder, tester, renderer, deployer = WithTimings(builder, tester, renderer, deployer, runCtx.CacheArtifacts())
	if runCtx.Notification() {
		deployer = WithNotification(deployer)
	}

	monitor := filemon.NewMonitor()
	intents, intentChan := setupIntents(runCtx)
	rtrigger, err := trigger.NewTrigger(runCtx, intents.IsAnyAutoEnabled)
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))
		return nil, fmt.Errorf("creating watch trigger: %w", err)
	}

	rbuilder := NewBuilder(builder, tagger, platforms, artifactCache, runCtx)
	return &SkaffoldRunner{
		Builder:            *rbuilder,

View on GitHub (pinned to a1189de023)

Solutions

  1. Read the wrapped cause after 'creating builder:' — it names the real failure
  2. Validate skaffold.yaml with `skaffold config` / `skaffold diagnose` before running
  3. Fix the build stanza (artifact image, builder type, context) indicated by the cause
  4. Update Skaffold if the cause points to an unsupported builder feature

Example fix

// before: opaque handling
runner, err := runner.NewForConfig(runCtx)
if err != nil { log.Fatal(err) }
// after: inspect the wrapped cause
runner, err := runner.NewForConfig(runCtx)
if err != nil {
    log.Fatalf("runner init failed: %v", err) // message includes 'creating builder: <real cause>'
}
Defensive patterns

Strategy: try-catch

Validate before calling

if err := validateRunCtx(runCtx); err != nil { return fmt.Errorf("invalid run context: %w", err) }

Try / catch

r, err := runner.NewForConfig(runCtx)
if err != nil {
    var inner error
    if errors.Unwrap(err) != nil { inner = errors.Unwrap(err) }
    return fmt.Errorf("runner creation failed (builder): %v / cause: %v", err, inner)
}

Prevention

When it happens

Trigger: Calling runner.NewForConfig (via createNewRunner/createRunner) when the internal pipeline-builder construction callback returns an error — e.g. invalid build configuration, failure instantiating a builder for the configured build type, or a hook-wiring failure.

Common situations: Malformed skaffold.yaml build sections, unsupported builder plugins, errors from custom build hooks, or initialization failures in the artifact/build pipeline during `skaffold dev`/`run`/`render` startup.

Related errors


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