{"record":{"id":"1b0681345d7c953b","repo":"kopia/kopia","slug":"error-presenting-blob","errorCode":null,"errorMessage":"error presenting blob","messagePattern":"error presenting blob","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_blob_show.go","lineNumber":37,"sourceCode":"\tblobShowDecrypt bool\n\tblobShowIDs     []string\n\n\tout textOutput\n}\n\nfunc (c *commandBlobShow) setup(svc appServices, parent commandParent) {\n\tcmd := parent.Command(\"show\", \"Show contents of BLOBs\").Alias(\"cat\")\n\tcmd.Flag(\"decrypt\", \"Decrypt blob if possible\").BoolVar(&c.blobShowDecrypt)\n\tcmd.Arg(\"blobID\", \"Blob IDs\").Required().StringsVar(&c.blobShowIDs)\n\tcmd.Action(svc.directRepositoryReadAction(c.run))\n\n\tc.out.setup(svc)\n}\n\nfunc (c *commandBlobShow) run(ctx context.Context, rep repo.DirectRepository) error {\n\tfor _, blobID := range c.blobShowIDs {\n\t\tif err := c.maybeDecryptBlob(ctx, c.out.stdout(), rep, blob.ID(blobID)); err != nil {\n\t\t\treturn errors.Wrap(err, \"error presenting blob\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *commandBlobShow) maybeDecryptBlob(ctx context.Context, w io.Writer, rep repo.DirectRepository, blobID blob.ID) error {\n\tvar (\n\t\td gather.WriteBuffer\n\t\tb gather.Bytes\n\t)\n\n\tif err := rep.BlobReader().GetBlob(ctx, blobID, 0, -1, &d); err != nil {\n\t\treturn errors.Wrap(err, \"error reading blob\")\n\t}\n\n\tb = d.Bytes()\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_blob_show.go#L19-L55","documentation":"Wraps any failure from commandBlobShow.maybeDecryptBlob while the 'kopia blob show' command iterates over requested blob IDs, meaning a blob could not be read and/or decrypted/printed. Because errors are wrapped per-blob, the command aborts on the first problematic blob. It is an umbrella message — the underlying cause (read failure or decrypt failure) is in the wrapped chain.","triggerScenarios":"Running 'kopia blob show <blobID>' where GetBlob fails (blob missing from storage) or, with --decrypt, blobcrypto.Decrypt fails (wrong format/key) for any listed blob ID.","commonSituations":"Typo in the blob ID or a blob ID copied from a different repository; blob deleted by maintenance after the ID was obtained; asking to decrypt a non-encrypted or foreign-format blob.","solutions":["Verify the blob ID exists (kopia blob stats or listing) and belongs to this repository.","Drop the --decrypt flag if the blob is not encrypted, or check that the repository is connected with the correct credentials.","Run the command once per blob ID to isolate which one fails, then read the wrapped cause.","Re-run after maintenance completes if the blob was concurrently deleted."],"exampleFix":"// before: single failure aborts all blobs\nfor _, id := range ids { kopia blob show $id }   // aborts at first bad id\n// after: isolate and continue\nfor id in $ids; do kopia blob show \"$id\" || echo \"failed: $id\"; done","handlingStrategy":"try-catch","validationCode":"kopia blob stats | grep -q \"$blobID\" && echo exists || echo missing\n","typeGuard":null,"tryCatchPattern":"if err := c.maybeDecryptBlob(ctx, out, rep, blob.ID(id)); err != nil {\n    log.Printf(\"skipping blob %s: %v\", id, err)  // continue instead of aborting the batch\n    continue\n}","preventionTips":["Copy blob IDs from the same repository you are connected to.","Validate blob IDs against a listing before batch shows.","Re-check IDs after maintenance/gc operations.","Run the command per-ID so one failure does not hide the rest."],"tags":["cli","blob","storage"],"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"}