kopia/kopia · error

no snapshots for

Error message

no snapshots for %v

What it means

In kopia's snapshot-fix command, listManifestIDs fails with this error when snapshot.ListSnapshotManifests returns zero manifests for the explicitly requested source (user@host:path). The tool refuses to proceed because a rewrite pass has nothing to operate on. It is an errors.Errorf (not a wrap), so the underlying cause is simply an empty manifest set for the given source.

Solutions

  1. Run `kopia snapshot list` (without source filter) to see the exact source identifiers available and correct the source string.
  2. Verify the hostname/username components match what kopia recorded (use `kopia snapshot list --all`).
  3. If no snapshots exist, take a snapshot first with `kopia snapshot create`.

Example fix

// before
kopia snapshot fix remove-files --remove-files 'tmp/*' myhost@user:/wrong/path
// after
kopia snapshot list --all  # confirm exact source
kopia snapshot fix remove-files --remove-files 'tmp/*' myhost@user:/correct/path
Defensive patterns

Strategy: validation

Validate before calling

sources, _ := snapshot.ListSnapshotManifests(ctx, rep, nil, nil)
// confirm the exact source exists before filtering:
if len(sources) == 0 { return errors.New("repository has no snapshots") }

Prevention

When it happens

Trigger: Running `kopia snapshot fix ...` with a --source or path argument that matches a snapshot source which has no snapshot manifests in the repository (e.g. wrong hostname/username/path spelling).

Common situations: Typo in the source string; snapshots were deleted or the source was never backed up; querying a different host's snapshots than intended; case sensitivity in username/hostname.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of kopia/kopia@82495e54b5 (2026-09-07). Data as JSON: /api/errors/4df37700de47d1cb. Report an issue: GitHub.

Appendix: source

Thrown at cli/command_snapshot_fix.go:187

func (c *commonRewriteSnapshots) listManifestIDs(ctx context.Context, rep repo.Repository) ([]manifest.ID, error) {
	manifests := toManifestIDs(c.manifestIDs)

	for _, src := range c.sources {
		log(ctx).Infof("Listing snapshots for source %q...", src)

		si, err := snapshot.ParseSourceInfo(src, rep.ClientOptions().Hostname, rep.ClientOptions().Username)
		if err != nil {
			return nil, errors.Wrap(err, "unable to parse source")
		}

		m, err := snapshot.ListSnapshotManifests(ctx, rep, &si, nil)
		if err != nil {
			return nil, errors.Wrap(err, "unable to list manifests")
		}

		if len(m) == 0 {
			return nil, errors.Errorf("no snapshots for %v", src)
		}

		manifests = append(manifests, m...)
	}

	if len(manifests) == 0 {
		log(ctx).Info("Listing all snapshots...")

		m, err := snapshot.ListSnapshotManifests(ctx, rep, nil, nil)
		if err != nil {
			return nil, errors.Wrap(err, "unable to list snapshot manifests")
		}

		manifests = append(manifests, m...)
	}

	return manifests, nil
}

View on GitHub (pinned to 82495e54b5)