GoogleContainerTools/skaffold · error
Sync: Auto is not supported by the build of %s
Error message
Sync: Auto is not supported by the build of %s
What it means
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.
Source
Thrown at pkg/skaffold/sync/sync.go:215
return nil, fmt.Errorf("extracting sync rules from labels for %q: %w", tag, err)
}
return syncItem(ctx, a, tag, e, rules, cfg)
case a.JibArtifact != nil:
toCopy, toDelete, err := jib.GetSyncDiff(ctx, a.Workspace, a.JibArtifact, e)
if err != nil {
return nil, err
}
if toCopy == nil && toDelete == nil {
// do a rebuild
return nil, nil
}
return &Item{Image: tag, Artifact: a, Copy: toCopy, Delete: toDelete}, nil
default:
// TODO: this error does appear a little late in the build, perhaps it could surface at first run, rather than first sync?
return nil, fmt.Errorf("Sync: Auto is not supported by the build of %s", a.ImageName)
}
}
func latestTag(image string, builds []graph.Artifact) string {
for _, build := range builds {
if build.ImageName == image {
return build.Tag
}
}
return ""
}
func intersect(ctx context.Context, contextWd, containerWd string, syncRules []*latest.SyncRule, files []string) (syncMap, error) {
ret := make(syncMap)
for _, f := range files {
relPath, err := filepath.Rel(contextWd, f)
if err != nil {
return nil, fmt.Errorf("changed file %s can't be found relative to context %q: %w", f, contextWd, err)View on GitHub (pinned to a1189de023)
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
Example fix
// before
sync:
auto: true
// after
sync:
manual:
- src: 'src/**/*.go'
dest: /app/src/ Defensive patterns
Strategy: validation
Validate before calling
if a.BuildpackArtifact == nil && a.JibArtifact != nil == false {
if a.Sync != nil && a.Sync.Auto != nil && *a.Sync.Auto {
return errors.New("sync: auto requires jib or buildpacks build; use sync.manual/infer instead")
}
} Type guard
func autoSyncSupported(a *latest.Artifact) bool {
return a.BuildpackArtifact != nil || a.JibArtifact != nil
} Try / catch
item, err := sync.NewItem(ctx, a, tag, e, cfg, builds)
if err != nil {
if strings.Contains(err.Error(), "Auto is not supported") {
log.Warnf("falling back to manual sync for %s", a.ImageName)
return syncWithManualRules(ctx, a, tag, e, cfg)
}
return err
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- retrieving labels for %q: %w
- %q running container image %q errored during run with status
- value must be one of `always`, `missing`, or `never`
- CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
- CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/11e3b836ce6e730e.
Report an issue: GitHub.