{"record":{"id":"93d2f8642740f933","repo":"containerd/containerd","slug":"walk-all-snapshots-for-q-failed-w","errorCode":null,"errorMessage":"walk all snapshots for %q failed: %w","messagePattern":"walk all snapshots for %q failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/cri/server/images/snapshots.go","lineNumber":98,"sourceCode":"\treturn previous + alpha*(sample-previous)\n}\n\n// sync updates all snapshots stats.\nfunc (s *snapshotsSyncer) sync() error {\n\tctx := ctrdutil.NamespacedContext()\n\tstart := time.Now().UnixNano()\n\n\tfor key, snapshotter := range s.snapshotters {\n\t\tvar snapshots []snapshot.Info\n\t\t// Do not call `Usage` directly in collect function, because\n\t\t// `Usage` takes time, we don't want `Walk` to hold read lock\n\t\t// of snapshot metadata store for too long time.\n\t\t// TODO(random-liu): Set timeout for the following 2 contexts.\n\t\tif err := snapshotter.Walk(ctx, func(ctx context.Context, info snapshot.Info) error {\n\t\t\tsnapshots = append(snapshots, info)\n\t\t\treturn nil\n\t\t}); err != nil {\n\t\t\treturn fmt.Errorf(\"walk all snapshots for %q failed: %w\", key, err)\n\t\t}\n\t\tfor _, info := range snapshots {\n\t\t\tsnapshotKey := snapshotstore.Key{\n\t\t\t\tKey:         info.Name,\n\t\t\t\tSnapshotter: key,\n\t\t\t}\n\t\t\tsn, err := s.store.Get(snapshotKey)\n\t\t\tif err == nil {\n\t\t\t\t// Only update timestamp for non-active snapshot.\n\t\t\t\tif sn.Kind == info.Kind && sn.Kind != snapshot.KindActive {\n\t\t\t\t\tsn.Timestamp = time.Now().UnixNano()\n\t\t\t\t\ts.store.Add(sn)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Get newest stats if the snapshot is new or active.\n\t\t\tsn = snapshotstore.Snapshot{\n\t\t\t\tKey: snapshotstore.Key{","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/internal/cri/server/images/snapshots.go#L80-L116","documentation":"The snapshot stats syncer walks every snapshotter (key = snapshotter name like overlayfs) and calls snapshotter.Walk to enumerate snapshots. This error wraps a Walk failure for the given snapshotter, aborting the sync for that snapshotter and meaning snapshot usage stats could not be collected.","triggerScenarios":"snapshotter.Walk(ctx, fn) returns an error during periodic stats sync — snapshotter backend failure, metadata DB read error, or context cancellation while iterating overlayfs snapshot metadata.","commonSituations":"Overlayfs/kernel issues or disk errors; heavy IO causing snapshotter metadata read timeouts; snapshotter plugin misconfiguration in containerd config.","solutions":["Check the wrapped cause and containerd logs for snapshotter-specific failures","Verify the snapshotter (e.g. overlayfs) is healthy: ctr plugins ls, check kernel/disk health","Restart containerd to reset snapshotter metadata handles; verify the snapshotter config under [plugins.\"io.containerd.snapshotter.v1...\"]"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// probe snapshotter health before sync\nif _, err := snapshotter.Usage(ctx, key); err != nil {\n    return fmt.Errorf(\"snapshotter %s unhealthy: %w\", key, err)\n}","typeGuard":null,"tryCatchPattern":"err := sync(ctx, key)\nif err != nil && strings.Contains(err.Error(), \"walk all snapshots\") {\n    log.WithError(err).Warn(\"snapshot walk failed; will retry next sync interval\")\n    // skip this snapshotter this round; do not crash the syncer\n}","preventionTips":["Monitor snapshotter plugin status (ctr plugins ls) regularly","Keep contexts/limits generous during stats walks on large node","Watch for overlayfs/disk kernel errors in node logs"],"tags":["containerd","snapshots","metrics","stats-sync"],"backgroundTag":"snapshot-walk-failed","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}