kopia/kopia · error

unable to convert entry to info

Error message

unable to convert entry to info

What it means

This wraps any error returned by entryToInfoStruct while converting a fixed-length v1 entry's raw bytes into an Info struct (e.g. invalid compression header byte or pack offset decoding failure). The library throws it to add context: an entry was found in the index, but its value bytes could not be decoded into content metadata. It almost always accompanies an underlying decode error.

Solutions

  1. Upgrade to a matching (or newer) kopia version so all entry fields decode correctly
  2. Clear the local index/content cache and re-sync indexes from storage
  3. Run repository verification/repair to detect and rebuild corrupt index blobs
  4. Inspect the wrapped (Cause) error for the specific decoding failure
Defensive patterns

Strategy: try-catch

Try / catch

found, err := idx.GetInfo(contentID, &info)
if err != nil {
    var unwrapped error = errors.Unwrap(err)
    log.Printf("index entry decode failed: %v (cause: %v)", err, unwrapped)
    return fmt.Errorf("content %v: %w", contentID, err)
}

Prevention

When it happens

Trigger: Calling GetInfo on an indexV1 entry whose packed value bits (flags, pack offset/length fields) are invalid — e.g. a reserved/unknown compression header ID byte in a corrupt or future-format entry.

Common situations: Index blobs written by a newer kopia version being read by an older binary, corrupted cache/index data, or storage returning stale/partial blobs.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at repo/content/index/index_v1.go:246

// GetInfo returns information about a given content. If a content is not found, nil is returned.
func (b *indexV1) GetInfo(contentID ID, result *Info) (bool, error) {
	var entryBuf [v1MaxEntrySize]byte

	e, err := b.findEntry(entryBuf[:0], contentID)
	if err != nil {
		return false, err
	}

	if e == nil {
		return false, nil
	}

	if len(e) != v1EntryLength {
		return false, errors.Errorf("invalid entry length: %v", len(e))
	}

	if err := b.entryToInfoStruct(contentID, e, result); err != nil {
		return false, errors.Wrap(err, "unable to convert entry to info")
	}

	return true, nil
}

// Close closes the index.
func (b *indexV1) Close() error {
	if closer := b.closer; closer != nil {
		return errors.Wrap(closer(), "error closing index file")
	}

	return nil
}

var errInvalidKeySize = errors.New("invalid key length")

type indexBuilderV1 struct {
	packBlobIDOffsets map[blob.ID]uint32

View on GitHub (pinned to 82495e54b5)