{"record":{"id":"5c0dd6626d128a46","repo":"kopia/kopia","slug":"unable-to-set-stat-totals-from-summary","errorCode":null,"errorMessage":"unable to set stat totals from summary","messagePattern":"unable to set stat totals from summary","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_snapshot_verify.go","lineNumber":140,"sourceCode":"\t\tfor _, man := range manifests {\n\t\t\trootPath := fmt.Sprintf(\"%v@%v\", man.Source, formatTimestamp(man.StartTime.ToTime()))\n\n\t\t\tif man.RootEntry == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\troot, err := snapshotfs.SnapshotRoot(rep, man)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"unable to get snapshot root: %q\", rootPath)\n\t\t\t}\n\n\t\t\ttreeWalkerEntries = append(treeWalkerEntries, twEntry{\n\t\t\t\troot:     root,\n\t\t\t\trootPath: rootPath,\n\t\t\t})\n\n\t\t\tif err := addExpectedWorkFromDirSummaryToVerifier(ctx, v, root); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"unable to set stat totals from summary\")\n\t\t\t}\n\t\t}\n\n\t\tfor _, twEntry := range treeWalkerEntries {\n\t\t\t// ignore error now, return aggregate error at a higher level.\n\t\t\t//nolint:errcheck\n\t\t\ttw.Process(ctx, twEntry.root, twEntry.rootPath)\n\t\t}\n\n\t\tfor _, oidStr := range c.verifyCommandDirObjectIDs {\n\t\t\toid, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, oidStr)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"unable to parse: %q\", oidStr)\n\t\t\t}\n\n\t\t\t// ignore error now, return aggregate error at a higher level.\n\t\t\t//nolint:errcheck\n\t\t\ttw.Process(ctx, snapshotfs.DirectoryEntry(rep, oid, nil), oidStr)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_snapshot_verify.go#L122-L158","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the wrapped inner error for the underlying cause.","Update Kopia to the latest version — older snapshots' summaries may be incompatible with newer verifier expectations.","If one snapshot triggers it, skip it (verify remaining sources) and re-snapshot it.","Report as a bug with the wrapped error if it persists on current versions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := addExpectedWorkFromDirSummaryToVerifier(ctx, v, root); err != nil {\n    log.Warnf(\"no dir summary for root %q; verifying without stat totals: %v\", rootPath, err)\n    // continue with default work estimates\n}","preventionTips":["Keep Kopia upgraded so snapshot/summary formats stay compatible","Treat this as a signal of a malformed/partially-loaded entry — re-check the repository","Skip and re-snapshots affected sources if one snapshot consistently triggers it"],"tags":["cli","verify","internal","dir-summary"],"backgroundTag":"internal-invariant-violation","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}