kopia/kopia · error

manifest is not a snapshot

Error message

manifest is not a snapshot

What it means

LoadSnapshot fetched the requested manifest but its type label does not equal the snapshot manifest type ("snapshot"). The manifest exists — it just isn't a snapshot (e.g. it's a policy or other manifest type), so Kopia refuses to decode it as one.

Solutions

  1. Verify the ID with 'kopia manifest show <id>' to confirm its type is "snapshot" before loading it as a snapshot
  2. Check the manifest's type label via repo.GetManifest and branch before calling LoadSnapshot
  3. Use snapshot.ListSnapshots to obtain valid snapshot manifest IDs
  4. If you intended policy data, call the policy package APIs instead

Example fix

// before
man, err := snapshot.LoadSnapshot(ctx, rep, someManifestID)
// after
md, err := rep.GetManifest(ctx, someManifestID)
if err == nil && md.Labels[manifest.TypeLabelKey] != "snapshot" {
    return fmt.Errorf("id %s is not a snapshot", someManifestID)
}
man, err := snapshot.LoadSnapshot(ctx, rep, someManifestID)
Defensive patterns

Strategy: validation

Validate before calling

md, err := rep.GetManifest(ctx, manifestID)
if err == nil && md.Labels[manifest.TypeLabelKey] != "snapshot" {
    return fmt.Errorf("%s is a %s manifest, not a snapshot", manifestID, md.Labels[manifest.TypeLabelKey])
}

Try / catch

sm, err := snapshot.LoadSnapshot(ctx, rep, id)
if err != nil && strings.Contains(err.Error(), "manifest is not a snapshot") {
    return fmt.Errorf("ID %s is not a snapshot manifest", id)
}

Prevention

When it happens

Trigger: Passing a policy or other manifest ID to LoadSnapshot; FindSnapshotByRootObjectIDOrManifestID or mustReadManifest resolving an ID that points at a non-snapshot manifest.

Common situations: Confusing policy manifest IDs with snapshot manifest IDs; using a manifest ID copied from 'kopia manifest list' that belongs to a policy; bugs where an object ID maps to the wrong manifest.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


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

Appendix: source

Thrown at snapshot/manager.go:105

	return LoadSnapshots(ctx, rep, entryIDs(entries))
}

// LoadSnapshot loads and parses a snapshot with a given ID.
func LoadSnapshot(ctx context.Context, rep repo.Repository, manifestID manifest.ID) (*Manifest, error) {
	sm := &Manifest{}

	em, err := rep.GetManifest(ctx, manifestID, sm)
	if err != nil {
		if errors.Is(err, manifest.ErrNotFound) {
			return nil, ErrSnapshotNotFound
		}

		return nil, errors.Wrap(err, "unable to find manifest entries")
	}

	if em.Labels[manifest.TypeLabelKey] != ManifestType {
		return nil, errors.New("manifest is not a snapshot")
	}

	sm.ID = manifestID

	return sm, nil
}

// SaveSnapshot persists given snapshot manifest and returns manifest ID.
func SaveSnapshot(ctx context.Context, rep repo.RepositoryWriter, man *Manifest) (manifest.ID, error) {
	if man.Source.Host == "" {
		return "", errors.New("missing host")
	}

	if man.Source.UserName == "" {
		return "", errors.New("missing username")
	}

	if man.Source.Path == "" {

View on GitHub (pinned to 82495e54b5)