{"record":{"id":"b96c729eb9539048","repo":"GoogleContainerTools/skaffold","slug":"found-a-s-artifact-which-is-incompatible-with-b96c72","errorCode":null,"errorMessage":"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/","messagePattern":"found a '(.+?)' artifact, which is incompatible with the 'gcb' builder:\n\n(.+?)\n\nTo use the '(.+?)' builder, remove the 'googleCloudBuild' stanza from 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":660,"sourceCode":"// 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{\n\t\t\t\t\tError:    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)),\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\t}\n\treturn cfgErrs\n}\n\n// validateGCBConfig checks if GCB config is valid.","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L642-L678","documentation":"Google Cloud Build (gcb) can only build kaniko, docker, jib, buildpack, and ko artifact types. Any other artifact type (e.g. custom, bazel, nixpacks) under a googleCloudBuild build stanza fails validation, with advice to remove the gcb stanza to use a builder that supports that type.","triggerScenarios":"skaffold.yaml has `build.googleCloudBuild:` and an artifact whose type is not one of kaniko/docker/jib/buildpack/ko; validated in validateArtifactTypes.","commonSituations":"Using a `custom:` build script while submitting builds to Cloud Build, or leftover bazel artifacts from older configs.","solutions":["Remove the `googleCloudBuild` stanza and use `local:` or `cluster:` if the artifact type needs it","Convert the artifact to a supported type (docker/jib/buildpack/ko/kaniko)","Move the unsupported artifact to a separate profile with a compatible builder"],"exampleFix":"# before\nbuild:\n  googleCloudBuild:\n    projectId: my-project\n  artifacts:\n    - image: myapp\n      custom:\n        buildCommand: ./build.sh\n# after\nbuild:\n  local: {}\n  artifacts:\n    - image: myapp\n      custom:\n        buildCommand: ./build.sh","handlingStrategy":"validation","validationCode":"const gcbAllowed = ['kaniko','docker','jib','buildpack','ko'];\nif (config.build?.googleCloudBuild && config.build.artifacts?.some(a => !gcbAllowed.some(t => a[t]))) {\n  throw new Error('artifact type not supported by googleCloudBuild builder');\n}","typeGuard":"function gcbCompatible(cfg) {\n  const ok = ['kaniko','docker','jib','buildpack','ko'];\n  return !cfg?.build?.googleCloudBuild || cfg.build.artifacts?.every(a => ok.some(t => a[t]));\n}","tryCatchPattern":"try {\n  await skaffold.run(config);\n} catch (e) {\n  if (/incompatible with the 'gcb' builder/.test(e.message)) {\n    console.error('Use a supported artifact type or switch builder stanza');\n  } else throw e;\n}","preventionTips":["Remember gcb supports only kaniko/docker/jib/buildpack/ko","Use profiles to give custom artifacts a local builder","Check artifact type support tables in skaffold docs when adopting gcb"],"tags":["skaffold","config-validation","google-cloud-build","artifact-type"],"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"}