{"record":{"id":"7aa9a7fa36487ea6","repo":"containerd/containerd","slug":"invalidargument-7aa9a7","errorCode":"InvalidArgument","errorMessage":"ref source not supported: %w","messagePattern":"ref source not supported: %w","errorType":"error_code","errorClass":null,"httpStatus":400,"severity":"error","filePath":"core/transfer/image/imagestore.go","lineNumber":282,"sourceCode":"\n\t\t\t\timgs = append(imgs, images.Image{\n\t\t\t\t\tName:   name,\n\t\t\t\t\tTarget: desc,\n\t\t\t\t\tLabels: extraRefLabels(),\n\t\t\t\t})\n\n\t\t\t\t// If a named reference was found and SkipNamedDigest is true, do\n\t\t\t\t// not use this reference\n\t\t\t\tif ref.AddDigest && !ref.SkipNamedDigest {\n\t\t\t\t\timgs = append(imgs, images.Image{\n\t\t\t\t\t\tName:   fmt.Sprintf(\"%s@%s\", ref.Name, desc.Digest),\n\t\t\t\t\t\tTarget: desc,\n\t\t\t\t\t\tLabels: extraRefLabels(),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"ref source not supported: %w\", errdefs.ErrInvalidArgument)\n\t\t}\n\t\tdelete(desc.Annotations, \"io.containerd.import.ref-source\")\n\t} else {\n\t\tif is.imageName != \"\" {\n\t\t\timgs = append(imgs, images.Image{\n\t\t\t\tName:   is.imageName,\n\t\t\t\tTarget: desc,\n\t\t\t\tLabels: is.imageLabels,\n\t\t\t})\n\t\t}\n\n\t\t// If extra references, store all complete references and prefix\n\t\t// references which add a digest (prefixes without a digest are skipped\n\t\t// since they have no concrete name to store).\n\t\t//\n\t\t// Note: SkipNamedDigest is intentionally not honored here. It applies\n\t\t// to the annotation branch where a named reference is resolved from a\n\t\t// descriptor's own annotations via the prefix — in that case a name","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/core/transfer/image/imagestore.go#L264-L300","documentation":"Store in the transfer/image service builds image records from a descriptor's annotations. The annotation \"io.containerd.import.ref-source\" can mark the reference source as digest, tag, or prefix; the switch handles only known values, and any other value (or an unparseable one) falls into default and returns this InvalidArgument error. The client supplied a ref-source value the store does not understand.","triggerScenarios":"Store() processing an image descriptor whose desc.Annotations[\"io.containerd.import.ref-source\"] is set to an unsupported value (anything other than digest/tag/prefix, or malformed) during image import via the transfer service.","commonSituations":"Hand-crafted or tool-generated import requests with a typo'd ref-source annotation; version mismatch where a newer producer sets a ref-source value the running containerd doesn't recognize.","solutions":["Set the annotation to a supported value: \"digest\", \"tag\", or remove it entirely","Inspect the import request/manifest annotations for typos in io.containerd.import.ref-source","Align producer and consumer containerd versions so both understand the ref-source values in use"],"exampleFix":"// before\n\"io.containerd.import.ref-source\": \"tagName\"\n// after\n\"io.containerd.import.ref-source\": \"tag\"","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"digest\": true, \"tag\": true}\nif v, ok := desc.Annotations[\"io.containerd.import.ref-source\"]; ok && !valid[v] {\n    return fmt.Errorf(\"invalid ref-source annotation %q: must be digest or tag\", v)\n}","typeGuard":null,"tryCatchPattern":"_, err := imageStore.Store(ctx, desc)\nif err != nil {\n    if errdefs.IsInvalidArgument(err) && strings.Contains(err.Error(), \"ref source not supported\") {\n        // strip/fix the annotation and retry\n        delete(desc.Annotations, \"io.containerd.import.ref-source\")\n        _, err = imageStore.Store(ctx, desc)\n    }\n    return err\n}","preventionTips":["Only write \"digest\" or \"tag\" into io.containerd.import.ref-source","Validate annotations before submitting transfer/import requests","Keep producing tools and containerd versions in sync"],"tags":["transfer","image","invalid-argument","annotations"],"backgroundTag":"ref-source-not-supported","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}