kopia/kopia · error

unable to set stat totals from summary

Error message

unable to set stat totals from summary

What it means

Wraps a failure of addExpectedWorkFromDirSummaryToVerifier, which seeds the verifier's expected work counters from a directory summary entry when preparing `snapshot verify`. This is an internal bookkeeping step over the loaded root entry and rarely fails unless the in-memory entry is malformed.

Solutions

  1. Read the wrapped inner error for the underlying cause.
  2. Update Kopia to the latest version — older snapshots' summaries may be incompatible with newer verifier expectations.
  3. If one snapshot triggers it, skip it (verify remaining sources) and re-snapshot it.
  4. Report as a bug with the wrapped error if it persists on current versions.
Defensive patterns

Strategy: try-catch

Try / catch

if err := addExpectedWorkFromDirSummaryToVerifier(ctx, v, root); err != nil {
    log.Warnf("no dir summary for root %q; verifying without stat totals: %v", rootPath, err)
    // continue with default work estimates
}

Prevention

When it happens

Trigger: After successfully loading a snapshot root, computing stat totals from the root's DirSummary fails — typically a type assertion/mismatch on the entry's summary data or an unexpected entry state.

Common situations: Snapshots produced by older Kopia versions lacking directory summaries the verifier expects; corrupted or partially-loaded root entry; an internal invariant violation rather than user error.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at cli/command_snapshot_verify.go:140

		for _, man := range manifests {
			rootPath := fmt.Sprintf("%v@%v", man.Source, formatTimestamp(man.StartTime.ToTime()))

			if man.RootEntry == nil {
				continue
			}

			root, err := snapshotfs.SnapshotRoot(rep, man)
			if err != nil {
				return errors.Wrapf(err, "unable to get snapshot root: %q", rootPath)
			}

			treeWalkerEntries = append(treeWalkerEntries, twEntry{
				root:     root,
				rootPath: rootPath,
			})

			if err := addExpectedWorkFromDirSummaryToVerifier(ctx, v, root); err != nil {
				return errors.Wrapf(err, "unable to set stat totals from summary")
			}
		}

		for _, twEntry := range treeWalkerEntries {
			// ignore error now, return aggregate error at a higher level.
			//nolint:errcheck
			tw.Process(ctx, twEntry.root, twEntry.rootPath)
		}

		for _, oidStr := range c.verifyCommandDirObjectIDs {
			oid, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, oidStr)
			if err != nil {
				return errors.Wrapf(err, "unable to parse: %q", oidStr)
			}

			// ignore error now, return aggregate error at a higher level.
			//nolint:errcheck
			tw.Process(ctx, snapshotfs.DirectoryEntry(rep, oid, nil), oidStr)

View on GitHub (pinned to 82495e54b5)