{"record":{"id":"605afed833fa8f72","repo":"containerd/containerd","slug":"unable-to-create-manifests-file-w","errorCode":null,"errorMessage":"unable to create manifests file: %w","messagePattern":"unable to create manifests file: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/images/archive/exporter.go","lineNumber":345,"sourceCode":"\t\t\t}\n\t\t\tif d != \"\" {\n\t\t\t\tif name := desc.Annotations[images.AnnotationImageName]; name != \"\" {\n\t\t\t\t\tmt := dManifests[d]\n\t\t\t\t\tmt.names = append(mt.names, name)\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"only manifests may be exported: %w\", errdefs.ErrInvalidArgument)\n\t\t}\n\t}\n\n\trecords = append(records, ociIndexRecord(slices.Concat(manifests, filterReferrers(records))))\n\n\tif !eo.skipDockerManifest && len(dManifests) > 0 {\n\t\ttr, err := manifestsRecord(ctx, store, dManifests)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to create manifests file: %w\", err)\n\t\t}\n\n\t\trecords = append(records, tr)\n\t}\n\n\tif len(algorithms) > 0 {\n\t\trecords = append(records, directoryRecord(\"blobs/\", 0755))\n\t\tfor alg := range algorithms {\n\t\t\trecords = append(records, directoryRecord(\"blobs/\"+alg+\"/\", 0755))\n\t\t}\n\t}\n\n\ttw := tar.NewWriter(writer)\n\tdefer tw.Close()\n\treturn writeTar(ctx, tw, records)\n}\n\nfunc getRecords(ctx context.Context, store content.Provider, desc ocispec.Descriptor, algorithms map[string]struct{}, brOpts *blobRecordOptions, referrers content.ReferrersProvider) ([]tarRecord, error) {","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/core/images/archive/exporter.go#L327-L363","documentation":"Wraps a failure from manifestsRecord() while building the Docker-format manifests.json entry during a containerd image archive export (ctr images export / exporter.Export). When Docker manifests exist and skipDockerManifest is false, the exporter renders a tar record for manifests.json; any error reading manifests from the content store or encoding them is wrapped here. It means the export archive could not be fully assembled.","triggerScenarios":"Calling exporter.Export (or `ctr images export`) on a store where docker-format manifests reference blobs missing from the content store, or the manifest blobs are unreadable/corrupt, and skipDockerManifest is false so manifestsRecord runs.","commonSituations":"Exporting images whose content store was partially garbage-collected; exporting with a store missing docker-manifest-compatible entries; corrupted content store after interrupted pulls; exporting to old Docker consumers without disabling docker manifest generation.","solutions":["Inspect the wrapped cause (%w) to find which manifest digest failed and repair the content store (re-pull the image: ctr images pull).","Run ctr content verify or garbage-collect and re-fetch missing blobs to restore content-store integrity.","Pass exporter.WithSkipDockerManifest (or use OCI-layout-only export) so manifestsRecord is not invoked, if the consumer supports OCI layout.","Check disk space and permissions on the content store backing directory (blobs may be unreadable)."],"exampleFix":"// before\nerr := exporter.Export(ctx, tw, opts...)\n// after (skip docker manifests if target accepts OCI layout)\nerr := exporter.Export(ctx, tw, append(opts, exporter.WithSkipDockerManifest(true))...)","handlingStrategy":"try-catch","validationCode":"for _, d := range manifestDescriptors {\n  if _, err := store.ReaderAt(ctx, d); err != nil {\n    return fmt.Errorf(\"blob %s missing; re-pull image before export\", d.Digest)\n  }\n}","typeGuard":null,"tryCatchPattern":"if err := exporter.Export(ctx, tw, opts...); err != nil {\n  var missing bool\n  if strings.Contains(err.Error(), \"not found\") { missing = true }\n  // missing => re-pull image and retry export\n}","preventionTips":["Re-pull images before exporting after any GC or prune operation.","Use WithSkipDockerManifest when consumers accept OCI layout.","Monitor content-store health and disk space."],"tags":["containerd","export","content-store","tar"],"backgroundTag":"content-store-blob-missing","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}