kopia/kopia · error

error getting content info for

Error message

error getting content info for %v

What it means

VerifyObject walks the backing contents of an object and calls cr.ContentInfo for each underlying content ID to confirm it exists. If ContentInfo fails for any content ID, the error is wrapped with 'error getting content info for <contentID>'. It indicates that a piece of the object cannot be found or read metadata for in the content-addressable store.

Solutions

  1. Run repository consistency checks/garbage collection audit and restore the missing content from backup.
  2. Check storage backend health and connectivity, then re-run VerifyObject.
  3. Re-create the object from its source if the backing content is unrecoverable.
  4. Exclude unverifiable objects from restore/concatenation operations until repaired.

Example fix

// before: trusting the object exists
ids, err := object.VerifyObject(ctx, cr, oid)

// after: handle missing content distinctly
ids, err := object.VerifyObject(ctx, cr, oid)
if err != nil {
    return fmt.Errorf("object %v has missing backing content: %w", oid, err)
}
Defensive patterns

Strategy: try-catch

Validate before calling

func objectIntact(ctx context.Context, cr contentReader, oid ID) error {
    _, err := VerifyObject(ctx, cr, oid)
    return err
}

Try / catch

ids, err := VerifyObject(ctx, cr, oid)
if err != nil {
    if errors.Is(err, content.ErrContentNotFound) { return ErrObjectIncomplete }
    return fmt.Errorf("verify %v: %w", oid, err)
}

Prevention

When it happens

Trigger: Calling VerifyObject on an object whose backing content was deleted by garbage collection, or when the content manager cannot read content info due to backend errors or corruption.

Common situations: Post-GC dangling indirect objects, corrupted content-index blobs in the repository, storage backend failures during verification audits.

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/9b86db07907ba660. Report an issue: GitHub.

Appendix: source

Thrown at repo/object/object_reader.go:27

	"github.com/pkg/errors"

	"github.com/kopia/kopia/repo/compression"
	"github.com/kopia/kopia/repo/content"
)

// Open creates new ObjectReader for reading given object from a repository.
func Open(ctx context.Context, r contentReader, objectID ID) (Reader, error) {
	return openAndAssertLength(ctx, r, objectID, -1)
}

// VerifyObject ensures that all objects backing ObjectID are present in the repository
// and returns the content IDs of which it is composed.
func VerifyObject(ctx context.Context, cr contentReader, oid ID) ([]content.ID, error) {
	tracker := &contentIDTracker{}

	if err := iterateBackingContents(ctx, cr, oid, tracker, func(contentID content.ID) error {
		if _, err := cr.ContentInfo(ctx, contentID); err != nil {
			return errors.Wrapf(err, "error getting content info for %v", contentID)
		}

		return nil
	}); err != nil {
		return nil, err
	}

	return tracker.contentIDs(), nil
}

type objectReader struct {
	// objectReader implements io.Reader, but needs context to read from repository
	ctx context.Context //nolint:containedctx

	cr contentReader

	seekTable []IndirectObjectEntry

View on GitHub (pinned to 82495e54b5)