{"record":{"id":"cfbeeb43ee608a67","repo":"kopia/kopia","slug":"unable-to-open-object-v","errorCode":null,"errorMessage":"unable to open object: %v","messagePattern":"unable to open object: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"snapshot/snapshotfs/repofs.go","lineNumber":178,"sourceCode":"\n\treturn rd.loadLocked(ctx)\n}\n\nfunc (rd *repositoryDirectory) ensureSummary(ctx context.Context) error {\n\trd.mu.Lock()\n\tdefer rd.mu.Unlock()\n\n\tif rd.summary != nil {\n\t\treturn nil\n\t}\n\n\treturn rd.loadLocked(ctx)\n}\n\nfunc (rd *repositoryDirectory) loadLocked(ctx context.Context) error {\n\tr, err := rd.repo.OpenObject(ctx, rd.metadata.ObjectID)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"unable to open object: %v\", rd.metadata.ObjectID)\n\t}\n\tdefer r.Close() //nolint:errcheck\n\n\tent, summ, err := readDirEntries(r)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"unable to read dir entries for: %v\", rd.metadata.ObjectID)\n\t}\n\n\tfor _, md := range ent {\n\t\tif md.Type == snapshot.EntryTypeDirectory && md.DirSummary != nil {\n\t\t\tmd.FileSize = md.DirSummary.TotalFileSize\n\t\t\tmd.ModTime = md.DirSummary.MaxModTime\n\t\t}\n\t}\n\n\trd.summary = summ\n\trd.dirEntries = map[string]*snapshot.DirEntry{}\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/snapshot/snapshotfs/repofs.go#L160-L196","documentation":"repositoryDirectory.loadLocked opens the directory's underlying object (rd.metadata.ObjectID) via repo.OpenObject to read its entries. This wrapped error means the repository blob backing the directory could not be opened — typically because the object does not exist, is unreadable, or the underlying blob storage failed.","triggerScenarios":"Listing/iterating a directory in a mounted or browsed snapshot when ensureDirEntriesLoaded or ensureSummary triggers loadLocked and OpenObject fails for the directory's ObjectID (missing blob, storage backend error, corrupted/edited directory entry metadata).","commonSituations":"Repository maintained with a different/older tool version; blobs pruned or lost by faulty maintenance; cloud storage credentials/expiry causing OpenObject failures; corrupted directory object IDs after interrupted maintenance.","solutions":["Run `kopia repository verify` / `kopia blob list` to confirm the object exists","Check storage backend connectivity and credentials (the wrapped error usually shows the real cause)","Run `kopia maintenance run --full` and verify indexes are consistent","Restore the directory from another snapshot if the object is genuinely missing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check connectivity/health of the repository before browsing\nerr := rep.Repository.Open(ctx)\nif err != nil { return fmt.Errorf(\"repository unavailable: %w\", err) }","typeGuard":null,"tryCatchPattern":"err := dir.IterateEntries(ctx, cb)\nif err != nil {\n    if isTransient(err) { backoffAndRetry(ctx) } else { return fmt.Errorf(\"dir object %v unreadable: %w\", oid, err) }\n}","preventionTips":["Run regular `kopia maintenance run --full` so indexes and blobs stay consistent","Never manually prune or edit repository blobs/indexes","Use the same kopia major version for writers and readers of a repository","Monitor storage backend health and credentials before long browse/restore sessions"],"tags":["repository","blob-storage","object-open"],"backgroundTag":"resource-not-found","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"}