{"record":{"id":"27fbbc7cff3d0e3e","repo":"GoogleContainerTools/skaffold","slug":"found-a-s-artifact-which-is-incompatible-with","errorCode":null,"errorMessage":"found a '%s' artifact, which is incompatible with the 'local' builder:\n\n%s\n\nTo use the '%s' builder, add the 'cluster' stanza to the 'build' section of your configuration. For information, see https://skaffold.dev/docs/pipeline-stages/builders/","messagePattern":"found a '(.+?)' artifact, which is incompatible with the 'local' builder:\n\n(.+?)\n\nTo use the '(.+?)' builder, add the 'cluster' stanza to the 'build' section of your configuration\\. For information, see https://skaffold\\.dev/docs/pipeline-stages/builders/","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":650,"sourceCode":"\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"artifact %s has an invalid pattern %s for inferred file sync with the ko builder. The pattern must specify the 'kodata' directory. For instance, if you want to sync all static content, and your main package is in the workspace directory, you can use the pattern 'kodata/**/*'\", a.ImageName, pattern),\n\t\t\t\t\tLocation: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i].Sync, \"Infer\"),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\treturn cfgErrs\n}\n\n// validateArtifactTypes checks that the artifact types are compatible with the specified builder.\nfunc validateArtifactTypes(cfg *parser.SkaffoldConfigEntry, bc latest.BuildConfig) []ErrorWithLocation {\n\tcfgErrs := []ErrorWithLocation{}\n\tswitch {\n\tcase bc.LocalBuild != nil:\n\t\tfor i, a := range bc.Artifacts {\n\t\t\tif misc.ArtifactType(a) == misc.Kaniko {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    fmt.Errorf(\"found a '%s' artifact, which is incompatible with the 'local' builder:\\n\\n%s\\n\\nTo use the '%s' builder, add the 'cluster' stanza to 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)),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Build.Artifacts[i].ArtifactType),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\tcase bc.GoogleCloudBuild != nil:\n\t\tfor i, a := range bc.Artifacts {\n\t\t\tat := misc.ArtifactType(a)\n\t\t\tif at != misc.Kaniko && at != misc.Docker && at != misc.Jib && at != misc.Buildpack && at != misc.Ko {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\t\tError:    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)),\n\t\t\t\t\tLocation: cfg.YAMLInfos.Locate(&cfg.Build.Artifacts[i].ArtifactType),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\tcase bc.Cluster != nil:\n\t\tfor i, a := range bc.Artifacts {\n\t\t\tif misc.ArtifactType(a) != misc.Kaniko && misc.ArtifactType(a) != misc.Custom {\n\t\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L632-L668","documentation":"The 'local' builder (build.local) can only build docker, jib, buildpack, and ko-style artifacts. If any artifact is a kaniko (cluster) artifact, Skaffold fails validation because the local Docker daemon cannot perform a kaniko build, and it suggests switching the build stanza.","triggerScenarios":"skaffold.yaml has `build.local: {}` while one or more artifacts define `kaniko:`; validated in validateArtifactTypes via ProcessToErrorWithLocation.","commonSituations":"Merging configs from a cluster-deployment project into a local-dev project, or switching build environments without changing artifact types.","solutions":["Add a `cluster:` stanza under build (and optionally set `build.cluster.pullSecretName`) so kaniko artifacts can build in-cluster","Change the artifact from kaniko to docker if a local build is intended","Remove the kaniko artifact if it is not needed"],"exampleFix":"# before\nbuild:\n  local: {}\n  artifacts:\n    - image: myapp\n      kaniko: {}\n# after\nbuild:\n  cluster: {}\n  artifacts:\n    - image: myapp\n      kaniko: {}","handlingStrategy":"validation","validationCode":"if (config.build?.local && config.build.artifacts?.some(a => a.kaniko)) {\n  throw new Error('kaniko artifacts require build.cluster, not build.local');\n}","typeGuard":"function localBuildCompatible(cfg) {\n  return !cfg?.build?.local || !cfg.build.artifacts?.some(a => a.kaniko);\n}","tryCatchPattern":"try {\n  await skaffold.run(config);\n} catch (e) {\n  if (/incompatible with the 'local' builder/.test(e.message)) {\n    console.error('Add a build.cluster stanza or change the artifact type');\n  } else throw e;\n}","preventionTips":["Match builder stanza (local/cluster/gcb) to artifact types before committing config","Keep kaniko artifacts in profiles that enable the cluster builder","Run `skaffold diagnose` in CI to catch builder/artifact mismatches"],"tags":["skaffold","config-validation","kaniko","local-builder"],"backgroundTag":"skaffold-config-validation","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}