{"record":{"id":"11e3b836ce6e730e","repo":"GoogleContainerTools/skaffold","slug":"sync-auto-is-not-supported-by-the-build-of-s","errorCode":null,"errorMessage":"Sync: Auto is not supported by the build of %s","messagePattern":"Sync: Auto is not supported by the build of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/sync/sync.go","lineNumber":215,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"extracting sync rules from labels for %q: %w\", tag, err)\n\t\t}\n\n\t\treturn syncItem(ctx, a, tag, e, rules, cfg)\n\n\tcase a.JibArtifact != nil:\n\t\ttoCopy, toDelete, err := jib.GetSyncDiff(ctx, a.Workspace, a.JibArtifact, e)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif toCopy == nil && toDelete == nil {\n\t\t\t// do a rebuild\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn &Item{Image: tag, Artifact: a, Copy: toCopy, Delete: toDelete}, nil\n\n\tdefault:\n\t\t// TODO: this error does appear a little late in the build, perhaps it could surface at first run, rather than first sync?\n\t\treturn nil, fmt.Errorf(\"Sync: Auto is not supported by the build of %s\", a.ImageName)\n\t}\n}\n\nfunc latestTag(image string, builds []graph.Artifact) string {\n\tfor _, build := range builds {\n\t\tif build.ImageName == image {\n\t\t\treturn build.Tag\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc intersect(ctx context.Context, contextWd, containerWd string, syncRules []*latest.SyncRule, files []string) (syncMap, error) {\n\tret := make(syncMap)\n\tfor _, f := range files {\n\t\trelPath, err := filepath.Rel(contextWd, f)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"changed file %s can't be found relative to context %q: %w\", f, contextWd, err)","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/sync/sync.go#L197-L233","documentation":"autoSyncItem supports auto sync only for buildpacks and jib builds. If an artifact has neither a BuildpackArtifact nor a JibArtifact (e.g. plain docker build), auto sync cannot derive what to sync, so Skaffold returns this error. The TODO notes it surfaces late — at first file change, not at startup.","triggerScenarios":"An artifact built with docker/kustomize/helm-local build (no buildpacks or jib) has `sync: auto` in skaffold.yaml; a file is changed and NewItem -> autoSyncItem hits the default branch and returns the error naming a.ImageName.","commonSituations":"Switching an artifact from jib to docker build but leaving sync: auto; copying a jib artifact's sync block onto a Dockerfile artifact; typo in build type so Skaffold treats it as a plain build.","solutions":["For non-jib/buildpack artifacts, replace `sync: auto` with `sync: manual` rules (`- src: '**/*.go' dest: /app/`)","Or enable auto sync by building with jib or buildpacks","Prefer `sync: infer` for Dockerfile builds where the container layout mirrors the source layout"],"exampleFix":"// before\nsync:\n  auto: true\n// after\nsync:\n  manual:\n    - src: 'src/**/*.go'\n      dest: /app/src/","handlingStrategy":"validation","validationCode":"if a.BuildpackArtifact == nil && a.JibArtifact != nil == false {\n    if a.Sync != nil && a.Sync.Auto != nil && *a.Sync.Auto {\n        return errors.New(\"sync: auto requires jib or buildpacks build; use sync.manual/infer instead\")\n    }\n}","typeGuard":"func autoSyncSupported(a *latest.Artifact) bool {\n    return a.BuildpackArtifact != nil || a.JibArtifact != nil\n}","tryCatchPattern":"item, err := sync.NewItem(ctx, a, tag, e, cfg, builds)\nif err != nil {\n    if strings.Contains(err.Error(), \"Auto is not supported\") {\n        log.Warnf(\"falling back to manual sync for %s\", a.ImageName)\n        return syncWithManualRules(ctx, a, tag, e, cfg)\n    }\n    return err\n}","preventionTips":["Use sync.auto only on jib or buildpack artifacts","For docker builds use sync.infer or explicit sync.manual rules","Document build-type/sync-mode pairings in project docs"],"tags":["skaffold","sync","configuration","docker","jib"],"backgroundTag":"auto-sync-unsupported-build","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"}