kopia/kopia · error

error presenting blob

Error message

error presenting blob

What it means

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.

Solutions

  1. Verify the blob ID exists (kopia blob stats or listing) and belongs to this repository.
  2. Drop the --decrypt flag if the blob is not encrypted, or check that the repository is connected with the correct credentials.
  3. Run the command once per blob ID to isolate which one fails, then read the wrapped cause.
  4. Re-run after maintenance completes if the blob was concurrently deleted.

Example fix

// before: single failure aborts all blobs
for _, id := range ids { kopia blob show $id }   // aborts at first bad id
// after: isolate and continue
for id in $ids; do kopia blob show "$id" || echo "failed: $id"; done
Defensive patterns

Strategy: try-catch

Validate before calling

kopia blob stats | grep -q "$blobID" && echo exists || echo missing

Try / catch

if err := c.maybeDecryptBlob(ctx, out, rep, blob.ID(id)); err != nil {
    log.Printf("skipping blob %s: %v", id, err)  // continue instead of aborting the batch
    continue
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of kopia/kopia@82495e54b5 (2026-09-07). Data as JSON: /api/errors/1b0681345d7c953b. Report an issue: GitHub.

Appendix: source

Thrown at cli/command_blob_show.go:37

	blobShowDecrypt bool
	blobShowIDs     []string

	out textOutput
}

func (c *commandBlobShow) setup(svc appServices, parent commandParent) {
	cmd := parent.Command("show", "Show contents of BLOBs").Alias("cat")
	cmd.Flag("decrypt", "Decrypt blob if possible").BoolVar(&c.blobShowDecrypt)
	cmd.Arg("blobID", "Blob IDs").Required().StringsVar(&c.blobShowIDs)
	cmd.Action(svc.directRepositoryReadAction(c.run))

	c.out.setup(svc)
}

func (c *commandBlobShow) run(ctx context.Context, rep repo.DirectRepository) error {
	for _, blobID := range c.blobShowIDs {
		if err := c.maybeDecryptBlob(ctx, c.out.stdout(), rep, blob.ID(blobID)); err != nil {
			return errors.Wrap(err, "error presenting blob")
		}
	}

	return nil
}

func (c *commandBlobShow) maybeDecryptBlob(ctx context.Context, w io.Writer, rep repo.DirectRepository, blobID blob.ID) error {
	var (
		d gather.WriteBuffer
		b gather.Bytes
	)

	if err := rep.BlobReader().GetBlob(ctx, blobID, 0, -1, &d); err != nil {
		return errors.Wrap(err, "error reading blob")
	}

	b = d.Bytes()

View on GitHub (pinned to 82495e54b5)