{"record":{"id":"d24acae2386dde3c","repo":"kopia/kopia","slug":"manifest-is-not-a-snapshot","errorCode":null,"errorMessage":"manifest is not a snapshot","messagePattern":"manifest is not a snapshot","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"snapshot/manager.go","lineNumber":105,"sourceCode":"\n\treturn LoadSnapshots(ctx, rep, entryIDs(entries))\n}\n\n// LoadSnapshot loads and parses a snapshot with a given ID.\nfunc LoadSnapshot(ctx context.Context, rep repo.Repository, manifestID manifest.ID) (*Manifest, error) {\n\tsm := &Manifest{}\n\n\tem, err := rep.GetManifest(ctx, manifestID, sm)\n\tif err != nil {\n\t\tif errors.Is(err, manifest.ErrNotFound) {\n\t\t\treturn nil, ErrSnapshotNotFound\n\t\t}\n\n\t\treturn nil, errors.Wrap(err, \"unable to find manifest entries\")\n\t}\n\n\tif em.Labels[manifest.TypeLabelKey] != ManifestType {\n\t\treturn nil, errors.New(\"manifest is not a snapshot\")\n\t}\n\n\tsm.ID = manifestID\n\n\treturn sm, nil\n}\n\n// SaveSnapshot persists given snapshot manifest and returns manifest ID.\nfunc SaveSnapshot(ctx context.Context, rep repo.RepositoryWriter, man *Manifest) (manifest.ID, error) {\n\tif man.Source.Host == \"\" {\n\t\treturn \"\", errors.New(\"missing host\")\n\t}\n\n\tif man.Source.UserName == \"\" {\n\t\treturn \"\", errors.New(\"missing username\")\n\t}\n\n\tif man.Source.Path == \"\" {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/snapshot/manager.go#L87-L123","documentation":"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.","triggerScenarios":"Passing a policy or other manifest ID to LoadSnapshot; FindSnapshotByRootObjectIDOrManifestID or mustReadManifest resolving an ID that points at a non-snapshot manifest.","commonSituations":"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.","solutions":["Verify the ID with 'kopia manifest show <id>' to confirm its type is \"snapshot\" before loading it as a snapshot","Check the manifest's type label via repo.GetManifest and branch before calling LoadSnapshot","Use snapshot.ListSnapshots to obtain valid snapshot manifest IDs","If you intended policy data, call the policy package APIs instead"],"exampleFix":"// before\nman, err := snapshot.LoadSnapshot(ctx, rep, someManifestID)\n// after\nmd, err := rep.GetManifest(ctx, someManifestID)\nif err == nil && md.Labels[manifest.TypeLabelKey] != \"snapshot\" {\n    return fmt.Errorf(\"id %s is not a snapshot\", someManifestID)\n}\nman, err := snapshot.LoadSnapshot(ctx, rep, someManifestID)","handlingStrategy":"validation","validationCode":"md, err := rep.GetManifest(ctx, manifestID)\nif err == nil && md.Labels[manifest.TypeLabelKey] != \"snapshot\" {\n    return fmt.Errorf(\"%s is a %s manifest, not a snapshot\", manifestID, md.Labels[manifest.TypeLabelKey])\n}","typeGuard":null,"tryCatchPattern":"sm, err := snapshot.LoadSnapshot(ctx, rep, id)\nif err != nil && strings.Contains(err.Error(), \"manifest is not a snapshot\") {\n    return fmt.Errorf(\"ID %s is not a snapshot manifest\", id)\n}","preventionTips":["Take snapshot IDs from snapshot.ListSnapshots, not from 'kopia manifest list' or object IDs","Check the manifest type label before decoding as a snapshot","Don't reuse policy manifest IDs as snapshot IDs"],"tags":["snapshot","manifest","type-mismatch"],"backgroundTag":"incompatible-source-type","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}