kopia/kopia · error

error reading object

Error message

error reading object %v

What it means

This error is returned by Verifier.VerifyFile when the periodic full-read verification path fails: after the entry hash matched, the verifier samples objects (based on VerifyFilesPercent) and reads the entire object from the repository to confirm its contents. It wraps a lower-level failure from readEntireObject (open or read error) with the object ID for context.

Solutions

  1. Run 'kopia blob list' / check storage backend to confirm the object blob still exists and is intact.
  2. Re-run verification to rule out transient storage/network errors; retry with a larger MaxErrors budget.
  3. If the blob is confirmed corrupt, restore the snapshot from another copy and rebuild the affected snapshot.
  4. Check storage credentials and connectivity; run 'kopia repository status' to confirm repository health.
  5. Update Kopia — older versions had verification bugs against certain storage providers.

Example fix

// before: failing verification sampling config
kopia snapshot verify --verify-files-percent=100
// after: start with lower sampling and fix repository first
kopia snapshot verify --verify-files-percent=10 --max-errors=50
Defensive patterns

Strategy: retry

Validate before calling

// before verifying, confirm the object resolves
if _, err := rep.VerifyObject(ctx, oid); err != nil {
    return fmt.Errorf("object %v not verifiable, skipping full read: %w", oid, err)
}

Type guard

func objectReadable(ctx context.Context, rep repo.Repository, oid object.ID) bool {
    r, err := rep.OpenObject(ctx, oid)
    if err != nil { return false }
    r.Close()
    return true
}

Try / catch

if err := v.VerifyFile(ctx, oid, entryPath); err != nil {
    var verifyErr *kopia.Error
    if errors.As(err, &verifyErr) {
        log.Warnf("verification failed for %s: %v — check storage backend health", oid, err)
        return err // surface; do not silently continue
    }
    return err
}

Prevention

When it happens

Trigger: The file entry passed hash verification but v.rep.OpenObject(ctx, oid) failed inside readEntireObject, or iocopy.Copy from the opened object failed (blob missing, corrupt, or unreadable from storage). Occurs during snapshot verification (snapshot verify or EstimateBackup verification) when VerifyFilesPercent sampling selects the object.

Common situations: Corrupted or deleted blobs in the underlying storage (S3/B2/filesystem backend); credentials or network errors reaching object storage mid-verify; repository integrity damaged after a failed maintenance/GC; manually copied or truncated repository data.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at snapshot/snapshotfs/snapshot_verifier.go:177

	}

	if v.blobMap != nil {
		for _, cid := range contentIDs {
			ci, err := v.rep.ContentInfo(ctx, cid)
			if err != nil {
				return errors.Wrapf(err, "error verifying content %v", cid)
			}

			if _, ok := v.blobMap[ci.PackBlobID]; !ok {
				return errors.Errorf("object %v is backed by missing blob %v", oid, ci.PackBlobID)
			}
		}
	}

	//nolint:gosec
	if 100*rand.Float64() < v.opts.VerifyFilesPercent {
		if err := v.readEntireObject(ctx, oid, entryPath); err != nil {
			return errors.Wrapf(err, "error reading object %v", oid)
		}
	}

	return nil
}

func (v *Verifier) updateProcessedStats(size int64) {
	v.statsMu.Lock()
	defer v.statsMu.Unlock()

	v.processed++
	v.processedBytes += size
}

// verifyObject enqueues a single object for verification.
func (v *Verifier) verifyObject(ctx context.Context, e fs.Entry, oid object.ID, entryPath string) error {
	if v.throttle.ShouldOutput(time.Second) {
		v.ShowStats(ctx)

View on GitHub (pinned to 82495e54b5)