{"record":{"id":"b8571db06c5e2efe","repo":"kopia/kopia","slug":"unable-to-find-snapshots-by-id-v","errorCode":null,"errorMessage":"unable to find snapshots by ID %v","messagePattern":"unable to find snapshots by ID (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"snapshot/snapshotfs/objref.go","lineNumber":96,"sourceCode":"// FindSnapshotByRootObjectIDOrManifestID returns the list of matching snapshots for a given rootID.\n// which can be either snapshot manifest ID (which matches 0 or 1 snapshots)\n// or the root object ID (which can match arbitrary number of snapshots).\n// If multiple snapshots match and they don't agree on root object attributes and consistentAttributes==true\n// the function fails, otherwise it returns the latest of the snapshots.\nfunc FindSnapshotByRootObjectIDOrManifestID(ctx context.Context, rep repo.Repository, rootID string, consistentAttributes bool) (*snapshot.Manifest, error) {\n\tm, err := snapshot.LoadSnapshot(ctx, rep, manifest.ID(rootID))\n\tif err == nil {\n\t\treturn m, nil\n\t}\n\n\trootOID, err := object.ParseID(rootID)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error parsing root object ID\")\n\t}\n\n\tmans, err := snapshot.FindSnapshotsByRootObjectID(ctx, rep, rootOID)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to find snapshots by ID %v\", rootID)\n\t}\n\n\t// no matching snapshots.\n\tif len(mans) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// all snapshots have consistent metadata, pick any.\n\tif areSnapshotsConsistent(mans) {\n\t\treturn mans[0], nil\n\t}\n\n\t// at this point we found multiple snapshots with the same root ID which don't agree on other\n\t// metadata (the attributes, ACLs, ownership, etc. of the root)\n\tif consistentAttributes {\n\t\treturn nil, errors.Errorf(\"found multiple snapshots matching %v with inconsistent root attributes\", rootID)\n\t}\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/snapshot/snapshotfs/objref.go#L78-L114","documentation":"After successfully parsing the argument as a root object ID, FindSnapshotByRootObjectIDOrManifestID queries the repository for snapshots with that root. This error wraps any failure from snapshot.FindSnapshotsByRootObjectID — typically a repository/manifest-store read failure rather than 'no results found' (an empty result returns nil, nil).","triggerScenarios":"Calling FindSnapshotByRootObjectIDOrManifestID when the manifest store query fails — repository connectivity loss, backend errors, or corrupt manifest metadata during the search.","commonSituations":"Repository backend (S3/BlobStorage etc.) temporarily unavailable; authentication failures when listing manifests; corrupted manifest data after interrupted writes.","solutions":["Check the wrapped cause for the underlying repository error.","Verify repository connectivity and credentials ('kopia repository status').","Retry the operation; backend errors are often transient.","Run 'kopia repository verify' if manifest corruption is suspected."],"exampleFix":"// before\nmans, err := snapshot.FindSnapshotsByRootObjectID(ctx, rep, rootOID)\nif err != nil {\n    return nil, errors.Wrapf(err, \"unable to find snapshots by ID %v\", rootID)\n}\n// after\nmans, err := snapshot.FindSnapshotsByRootObjectID(ctx, rep, rootOID)\nif err != nil {\n    return nil, retryable(errors.Wrapf(err, \"unable to find snapshots by ID %v\", rootID))\n}","handlingStrategy":"retry","validationCode":"if err := rep.Refresh(ctx); err != nil {\n    return fmt.Errorf(\"repository unreachable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"m, err := snapshotfs.FindSnapshotByRootObjectIDOrManifestID(ctx, rep, id)\nif err != nil {\n    if isTransient(err) { return retryWithBackoff(...) }\n    return err\n}","preventionTips":["Check repository connectivity before manifest queries","Keep storage credentials valid and refreshed","Retry transient backend failures with backoff","Run repository verification if errors recur"],"tags":["repository","snapshot","query"],"backgroundTag":"database-query-failed","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"}