{"record":{"id":"54c029460bd943ae","repo":"kubernetes/kops","slug":"error-remapping-manifest-s-v","errorCode":null,"errorMessage":"error remapping manifest %s: %v","messagePattern":"error remapping manifest (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/components/addonmanifests/remap.go","lineNumber":74,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"failed to annotate %q: %w\", name, err)\n\t\t}\n\n\t\terr = addServiceAccountRole(context, objects, serviceAccounts)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to add service account for %q: %w\", name, err)\n\t\t}\n\n\t\tb, err := objects.ToYAML()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmanifest = b\n\t}\n\n\t{\n\t\tremapped, err := assetBuilder.RemapManifest(manifest)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error remapping manifest %s: %v\", name, err)\n\t\t}\n\t\tmanifest = remapped\n\t}\n\n\treturn manifest, nil\n}\n\nfunc addServiceAccountRole(context *model.KopsModelContext, objects kubemanifest.ObjectList, serviceAccounts map[types.NamespacedName]iam.Subject) error {\n\tif !context.UseServiceAccountExternalPermissions() {\n\t\treturn nil\n\t}\n\n\tfor _, object := range objects {\n\t\tif !hasPodSpecTemplate(object) {\n\t\t\tcontinue\n\t\t}\n\t\tpodSpec := &corev1.PodSpec{}\n","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/components/addonmanifests/remap.go#L56-L92","documentation":"After labels and service-account injection, RemapAddonManifest passes the manifest bytes to assetBuilder.RemapManifest, which rewrites image references (and possibly mirrors them to the configured asset location). If that rewriting fails, the addon name and the underlying error are returned here.","triggerScenarios":"RemapAddonManifest call where AssetBuilder.RemapManifest fails — typically an image reference in the manifest cannot be parsed, or pushing/copying to a private registry (assets image replica) fails.","commonSituations":"kops configured with --set-cluster-asset / container registry mirroring and the registry is unreachable or credentials are missing; malformed image string in the addon manifest; network egress blocked in air-gapped environments.","solutions":["Read the wrapped %v error for the specific image or registry failure","Fix the malformed image reference in the addon manifest","Verify credentials and connectivity to the mirror registry (docker login / network policy)","Disable asset replication (remove --set-cluster-assets / mirroring config) if not needed"],"exampleFix":"// before: unreachable mirror configured\nKOPS_ASSETS: registry.internal.example/kops\n// after: correct reachable registry or empty\nKOPS_ASSETS: \"\"  # or reachable registry with valid credentials","handlingStrategy":"retry","validationCode":"// Validate image references are parseable before remapping:\nfor _, img := range extractImageReferences(manifest) {\n    if _, _, err := dockerRef.Parse(img); err != nil {\n        return fmt.Errorf(\"invalid image reference %q: %v\", img, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"remapped, err := assetBuilder.RemapManifest(manifest)\nif err != nil {\n    // retry transient registry errors before failing\n    if isTransientRegistryError(err) { remapped, err = retry(3, func() ([]byte, error) { return assetBuilder.RemapManifest(manifest) }) }\n    if err != nil { return nil, fmt.Errorf(\"error remapping manifest %s: %v\", name, err) }\n}","preventionTips":["Verify registry credentials and connectivity before running kops update","Pre-pull/replicate addon images to the mirror registry in air-gapped setups","Keep image references well-formed in custom manifests"],"tags":["kops","addon","assets","image-remap","registry"],"backgroundTag":"image-remap-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}