GoogleContainerTools/skaffold · error

found a '%s' artifact, which is incompatible with the 'clust

Error message

found a '%s' artifact, which is incompatible with the 'cluster' builder:

%s

To use the '%s' builder, remove the 'cluster' stanza from the 'build' section of your configuration. For information, see https://skaffold.dev/docs/pipeline-stages/builders/

What it means

The 'cluster' builder executes builds in-cluster via kaniko, so it only supports kaniko and custom artifact types. Any other artifact type combined with build.cluster fails validation, suggesting removal of the cluster stanza.

Source

Thrown at pkg/skaffold/schema/validation/validation.go:669

					Location: cfg.YAMLInfos.Locate(&cfg.Build.Artifacts[i].ArtifactType),
				})
			}
		}
	case bc.GoogleCloudBuild != nil:
		for i, a := range bc.Artifacts {
			at := misc.ArtifactType(a)
			if at != misc.Kaniko && at != misc.Docker && at != misc.Jib && at != misc.Buildpack && at != misc.Ko {
				cfgErrs = append(cfgErrs, ErrorWithLocation{
					Error:    fmt.Errorf("found a '%s' artifact, which is incompatible with the 'gcb' builder:\n\n%s\n\nTo use the '%s' builder, remove the 'googleCloudBuild' stanza from the 'build' section of your configuration. For information, see https://skaffold.dev/docs/pipeline-stages/builders/", misc.ArtifactType(a), misc.FormatArtifact(a), misc.ArtifactType(a)),
					Location: cfg.YAMLInfos.Locate(&cfg.Build.Artifacts[i].ArtifactType),
				})
			}
		}
	case bc.Cluster != nil:
		for i, a := range bc.Artifacts {
			if misc.ArtifactType(a) != misc.Kaniko && misc.ArtifactType(a) != misc.Custom {
				cfgErrs = append(cfgErrs, ErrorWithLocation{
					Error:    fmt.Errorf("found a '%s' artifact, which is incompatible with the 'cluster' builder:\n\n%s\n\nTo use the '%s' builder, remove the 'cluster' stanza from the 'build' section of your configuration. For information, see https://skaffold.dev/docs/pipeline-stages/builders/", misc.ArtifactType(a), misc.FormatArtifact(a), misc.ArtifactType(a)),
					Location: cfg.YAMLInfos.Locate(&cfg.Build.Artifacts[i].ArtifactType),
				})
			}
		}
	}
	return cfgErrs
}

// validateGCBConfig checks if GCB config is valid.
func validateGCBConfig(cfg *parser.SkaffoldConfigEntry, bc latest.BuildConfig) (cfgErrs []ErrorWithLocation) {
	if bc.GoogleCloudBuild != nil && bc.GoogleCloudBuild.WorkerPool != "" {
		if !gcbWorkerPoolPattern.MatchString(bc.GoogleCloudBuild.WorkerPool) {
			cfgErrs = append(cfgErrs, ErrorWithLocation{
				Error:    fmt.Errorf("invalid value for worker pool. Must match pattern projects/{project}/locations/{location}/workerPools/{worker_pool}"),
				Location: cfg.YAMLInfos.Locate(&cfg.Build.GoogleCloudBuild.WorkerPool),
			})
		}
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Remove the `cluster` stanza from build to use the local builder with these artifact types
  2. Change artifacts to kaniko (or custom) if in-cluster building is required
  3. Split artifacts across profiles with appropriate builders

Example fix

# before
build:
  cluster: {}
  artifacts:
    - image: myapp
      docker:
        dockerfile: Dockerfile
# after
build:
  local: {}
  artifacts:
    - image: myapp
      docker:
        dockerfile: Dockerfile
Defensive patterns

Strategy: validation

Validate before calling

if (config.build?.cluster && config.build.artifacts?.some(a => !a.kaniko && !a.custom)) {
  throw new Error('cluster builder only supports kaniko and custom artifacts');
}

Type guard

function clusterCompatible(cfg) {
  return !cfg?.build?.cluster || cfg.build.artifacts?.every(a => !!a.kaniko || !!a.custom);
}

Try / catch

try {
  await skaffold.run(config);
} catch (e) {
  if (/incompatible with the 'cluster' builder/.test(e.message)) {
    console.error('Switch to kaniko/custom artifacts or remove build.cluster');
  } else throw e;
}

Prevention

When it happens

Trigger: skaffold.yaml has `build.cluster:` and an artifact whose type is neither kaniko nor custom; validated in validateArtifactTypes.

Common situations: Enabling in-cluster builds while keeping local docker/jib artifacts, or profiles that toggle cluster builds without adjusting artifacts.

Related errors


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