kopia/kopia · error

error getting blob

Error message

error getting blob %v

What it means

Wrapper in attemptReadPackFileLocalIndex: GetBlob failed on the ranged read of the pack-file region containing the local index, meaning the pack blob could not be fetched (missing, corrupt, or storage error); the pack file ID is interpolated.

Solutions

  1. Check storage connectivity.
  2. If persistent, the pack file may be corrupt; full-blob recovery or repository repair may be needed.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at repo/content/committed_read_manager.go:177 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at repo/content/committed_read_manager.go:177

			"recovered index bytes from blob using full blob read",
			logparam.Int("length", output.Length()),
			blobparam.BlobID("packFile", packFile))

		return nil
	}

	return err
}

func (sm *SharedManager) attemptReadPackFileLocalIndex(ctx context.Context, packFile blob.ID, offset, length int64, output *gather.WriteBuffer) error {
	var payload gather.WriteBuffer
	defer payload.Close()

	output.Reset()

	err := sm.st.GetBlob(ctx, packFile, offset, length, &payload)
	if err != nil {
		return errors.Wrapf(err, "error getting blob %v", packFile)
	}

	postamble := findPostamble(payload.Bytes().ToByteSlice())
	if postamble == nil {
		return errors.Errorf("unable to find valid postamble in file %v", packFile)
	}

	if uint32(offset) > postamble.localIndexOffset { //nolint:gosec
		return errors.Errorf("not enough data read during optimized attempt %v", packFile)
	}

	postamble.localIndexOffset -= uint32(offset) //nolint:gosec

	//nolint:gosec
	if uint64(postamble.localIndexOffset+postamble.localIndexLength) > uint64(payload.Length()) {
		// invalid offset/length
		return errors.Errorf("unable to find valid local index in file %v - invalid offset/length", packFile)
	}

View on GitHub (pinned to 82495e54b5)