{"record":{"id":"2c421b4352eabd92","repo":"containerd/containerd","slug":"failed-to-get-info-from-content-store-w","errorCode":null,"errorMessage":"failed to get info from content store: %w","messagePattern":"failed to get info from content store: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/diff/erofs/compare_linux.go","lineNumber":172,"sourceCode":"\t\t}\n\t}\n\n\tvar commitopts []content.Opt\n\tif config.Labels != nil {\n\t\tcommitopts = append(commitopts, content.WithLabels(config.Labels))\n\t}\n\n\tdgst := cw.Digest()\n\tif errOpen = cw.Commit(ctx, 0, dgst, commitopts...); errOpen != nil {\n\t\tif !errdefs.IsAlreadyExists(errOpen) {\n\t\t\treturn emptyDesc, fmt.Errorf(\"failed to commit: %w\", errOpen)\n\t\t}\n\t\terrOpen = nil\n\t}\n\n\tinfo, err := s.store.Info(ctx, dgst)\n\tif err != nil {\n\t\treturn emptyDesc, fmt.Errorf(\"failed to get info from content store: %w\", err)\n\t}\n\tif info.Labels == nil {\n\t\tinfo.Labels = make(map[string]string)\n\t}\n\t// Set \"containerd.io/uncompressed\" label if digest already existed without label\n\tif _, ok := info.Labels[labels.LabelUncompressed]; !ok {\n\t\tinfo.Labels[labels.LabelUncompressed] = config.Labels[labels.LabelUncompressed]\n\t\tif _, err := s.store.Update(ctx, info, \"labels.\"+labels.LabelUncompressed); err != nil {\n\t\t\treturn emptyDesc, fmt.Errorf(\"error setting uncompressed label: %w\", err)\n\t\t}\n\t}\n\n\treturn ocispec.Descriptor{\n\t\tMediaType: config.MediaType,\n\t\tSize:      info.Size,\n\t\tDigest:    info.Digest,\n\t}, nil\n}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/plugins/diff/erofs/compare_linux.go#L154-L190","documentation":"This error is returned by the EROFS differ's Compare method when the underlying containerd content store lookup fails. After opening the layer blob, Compare calls s.store.Info(ctx, dgst) to fetch metadata for the diff's digest; any error from the content store (blob missing, backend failure, cancelled context) is wrapped with this message and Compare returns an empty descriptor.","triggerScenarios":"Calling Compare (via the diff service or on snapshot commit) with a digest that is not present in the local content store; a content store backend (e.g. bolt metadata or blob store) I/O failure; ctx cancelled before Info completes; a garbage-collected blob whose digest is still referenced.","commonSituations":"Layers pruned by automatic GC before the diff is computed; pulling with content disabled or partial (lazy/remote) content so the blob was never materialized locally; corrupted content store DB after an unclean shutdown; referencing a digest from a different containerd namespace than the one the store is opened with.","solutions":["Verify the blob exists in the content store: `ctr -n <namespace> content ls` or `ctr content get <dgst>`; re-pull the image if it is missing.","Check that the Compare call runs in the same namespace as the store that holds the blob.","Check content store backend health (bolt DB file, disk space, permissions) and inspect daemon logs for the underlying wrapped error.","If blobs are being evicted, raise GC limits or re-pull the image before calling Compare."],"exampleFix":"// before: assuming the layer blob is local\nmeta, err := differ.Compare(ctx, layerDesc, mounts, opts...)\n// after: ensure the blob is present before comparing\nif _, err := client.ContentStore().Info(ctx, layerDesc.Digest); err != nil {\n    if err := client.Fetch(ctx, container, layerDesc); err != nil { return err }\n}\nmeta, err := differ.Compare(ctx, layerDesc, mounts, opts...)","handlingStrategy":"validation","validationCode":"cs := client.ContentStore()\nif _, err := cs.Info(ctx, desc.Digest); err != nil {\n    // blob missing locally; fetch it before calling Compare\n    if err := client.Fetch(ctx, container, desc); err != nil { return fmt.Errorf(\"blob %s unavailable: %w\", desc.Digest, err) }\n}","typeGuard":"func blobInStore(ctx context.Context, cs contentstore.ContentStore, dgst digest.Digest) bool {\n    _, err := cs.Info(ctx, dgst)\n    return err == nil\n}","tryCatchPattern":"desc, err := differ.Compare(ctx, layerDesc, mounts, opts...)\nif err != nil && strings.Contains(err.Error(), \"failed to get info from content store\") {\n    // re-pull the image / restore the blob, then retry once\n    if rerr := repull(ctx, ref); rerr == nil { desc, err = differ.Compare(ctx, layerDesc, mounts, opts...) }\n}","preventionTips":["Check the blob's presence via ContentStore().Info before diff operations.","Avoid aggressive GC settings that evict blobs still needed for diffs.","Keep Compare calls in the same containerd namespace that owns the content.","Monitor content store health and disk space; treat bolt DB corruption alerts as urgent."],"tags":["containerd","content-store","erofs","diff"],"backgroundTag":"content-store-blob-not-found","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}