{"record":{"id":"2de35b27332b350b","repo":"kopia/kopia","slug":"unable-to-load-snapshots","errorCode":null,"errorMessage":"unable to load snapshots","messagePattern":"unable to load snapshots","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_restore.go","lineNumber":508,"sourceCode":"\t\treturn \"\", errors.Errorf(\"invalid directory: '%s': %s\", source, err)\n\t}\n\n\tif si.Path == \"\" {\n\t\treturn \"\", errors.New(\"the source must contain a path element\")\n\t}\n\n\tmanifestIDs, err := findSnapshotsForSource(ctx, rep, si, map[string]string{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(manifestIDs) == 0 {\n\t\treturn \"\", errors.Errorf(\"no snapshots contain data for %v\", source)\n\t}\n\n\tms, err := snapshot.LoadSnapshots(ctx, rep, manifestIDs)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"unable to load snapshots\")\n\t}\n\n\tm, relPath, ohid := findLastManifestWithPath(ctx, rep, ms, si.Path, filter)\n\tif m == nil {\n\t\treturn \"\", errors.Errorf(\"no snapshots contain data for %v\", source)\n\t}\n\n\tlog(ctx).Infof(\"Restoring from\\n\"+\n\t\t\"   Snapshot source: %v\\n\"+\n\t\t\"   Snapshot time: %v\\n\"+\n\t\t\"   Relative path: %v\\n\"+\n\t\t\"   Object ID: %v\", m.Source, formatTimestamp(m.StartTime.ToTime()), relPath, ohid)\n\n\treturn ohid.String(), nil\n}\n\nfunc createSnapshotTimeFilter(timespec string) (func(*snapshot.Manifest, int, int) bool, error) {\n\tif timespec == \"\" || timespec == \"latest\" {","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_restore.go#L490-L526","documentation":"After finding snapshot manifest IDs, tryToConvertPathToID loads the full snapshot manifests via snapshot.LoadSnapshots. If that load fails (repository read error, corruption, connectivity), the error is wrapped with 'unable to load snapshots'. This is a wrapped underlying error — the root cause is in the chained cause.","triggerScenarios":"Calling kopia restore where manifest IDs exist but loading them from the repository fails — repository backend unreachable (S3/Blob/network issues), manifest data corrupted, or blob storage access denied.","commonSituations":"Network interruption to object storage during restore; expired/revoked cloud storage credentials; corrupted manifest blobs in the repository; concurrent maintenance deleting blobs mid-read.","solutions":["Inspect the full wrapped cause (kopia prints the chain) — fix the underlying repository access error first","Re-run `kopia repository status` and a simple read like `kopia snapshot list` to test repository connectivity","Check cloud credentials and network reachability to the storage backend","Run `kopia repository verify-parameters` or blob-level checks if corruption is suspected; restore from a replica if available"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check repository health\nif err := exec.Command(\"kopia\", \"repository\", \"status\").Run(); err != nil {\n    return fmt.Errorf(\"repository not accessible: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"manifests, err := snapshot.LoadSnapshots(ctx, rep, ids)\nif err != nil {\n    var retryable = isNetworkOrTempError(err)\n    if retryable { /* backoff and retry */ }\n    return fmt.Errorf(\"check repo connectivity/credentials: %w\", err)\n}","preventionTips":["Check repository connectivity (repository status) before restore jobs","Keep cloud credentials valid/rotated ahead of expiry","Avoid running maintenance concurrently with large restores"],"tags":["restore","repository","io","wrapped-error"],"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"}