kopia/kopia · error

error listing previous snapshots

Error message

error listing previous snapshots

What it means

FindPreviousManifests wraps any failure from ListSnapshots when enumerating prior snapshots for a source. Without the prior snapshot list, incremental snapshotting cannot determine a base, so the operation aborts. It is a wrapper preserving the underlying repository listing error.

Solutions

  1. Examine the wrapped underlying error — it names the actual repository/storage failure
  2. Verify the repository is accessible (kopia repository connect / check credentials)
  3. Run 'kopia repository status' or blob-storage health checks for connectivity/throttling
  4. If indexes are corrupt, run 'kopia index recover' or 'kopia maintenance run'
Defensive patterns

Strategy: retry

Validate before calling

// before creating a snapshot
if err := rep.Refresh(ctx); err != nil {
    return fmt.Errorf("repository not accessible: %w", err)
}

Try / catch

prev, err := snapshot.FindPreviousManifests(ctx, rep, srcInfo, nil)
if err != nil {
    if isTransientStorageError(err) {
        return retryWithBackoff(func() error { _, err = snapshot.FindPreviousManifests(ctx, rep, srcInfo, nil); return err })
    }
    return err
}

Prevention

When it happens

Trigger: Called from createSnapshot/snapshotSingleSource/migrateSingleSourceSnapshot when snapshot.ListSnapshots(ctx, rep, sourceInfo) fails — repository read error, corrupt manifest metadata, or inaccessible storage.

Common situations: Blob storage outage or throttling during snapshot creation; corrupted repository indexes; migrating snapshots while the repo is offline or credentials expired.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

Thrown at snapshot/manager.go:255

	if err != nil {
		return errors.Wrap(err, "error saving snapshot")
	}

	if oldID != newID {
		if err := rep.DeleteManifest(ctx, oldID); err != nil {
			return errors.Wrap(err, "error deleting old manifest")
		}
	}

	return nil
}

// FindPreviousManifests returns the list of previous snapshots for a given source, including
// last complete snapshot and possibly some number of incomplete snapshots following it.
func FindPreviousManifests(ctx context.Context, rep repo.Repository, sourceInfo SourceInfo, noLaterThan *fs.UTCTimestamp) ([]*Manifest, error) {
	man, err := ListSnapshots(ctx, rep, sourceInfo)
	if err != nil {
		return nil, errors.Wrap(err, "error listing previous snapshots")
	}

	// phase 1 - find latest complete snapshot.
	var (
		previousComplete          *Manifest
		previousCompleteStartTime fs.UTCTimestamp
		result                    []*Manifest
	)

	for _, p := range man {
		if noLaterThan != nil && p.StartTime.After(*noLaterThan) {
			continue
		}

		if p.IncompleteReason == "" && (previousComplete == nil || p.StartTime.After(previousComplete.StartTime)) {
			previousComplete = p
			previousCompleteStartTime = p.StartTime
		}

View on GitHub (pinned to 82495e54b5)