{"record":{"id":"3afce7141adbc5bb","repo":"kubernetes/kops","slug":"malformed-format-of-image-urn-s","errorCode":null,"errorMessage":"malformed format of image urn: %s","messagePattern":"malformed format of image urn: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/azuremodel/vmscaleset.go","lineNumber":251,"sourceCode":"\t\t\tDiskSizeGB:   to.Ptr(volumeSize),\n\t\t\tManagedDisk: &compute.VirtualMachineScaleSetManagedDiskParameters{\n\t\t\t\tStorageAccountType: &storageAccountType,\n\t\t\t},\n\t\t\tCaching: to.Ptr(compute.CachingTypesReadWrite),\n\t\t},\n\t}, nil\n}\n\nfunc parseImage(image string) (*compute.ImageReference, error) {\n\tif strings.HasPrefix(image, \"/subscriptions/\") {\n\t\treturn &compute.ImageReference{\n\t\t\tID: to.Ptr(image),\n\t\t}, nil\n\t}\n\n\tl := strings.Split(image, \":\")\n\tif len(l) != 4 {\n\t\treturn nil, fmt.Errorf(\"malformed format of image urn: %s\", image)\n\t}\n\treturn &compute.ImageReference{\n\t\tPublisher: to.Ptr(l[0]),\n\t\tOffer:     to.Ptr(l[1]),\n\t\tSKU:       to.Ptr(l[2]),\n\t\tVersion:   to.Ptr(l[3]),\n\t}, nil\n}\n","sourceCodeStart":233,"sourceCodeEnd":260,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/azuremodel/vmscaleset.go#L233-L260","documentation":"parseImage supports Azure images given either as a resource ID or as a URN of the form publisher:offer:sku:version. If the image string contains no ':' (treated as an ID path fallback) or splits into other than exactly 4 colon-separated parts, the model builder rejects it with this error.","triggerScenarios":"Setting spec.image on an Azure InstanceGroup to something like \"UbuntuServer\" or \"Canonical:UbuntuServer:18.04-LTS\" (3 parts) instead of a full 4-part URN or a valid image resource ID.","commonSituations":"Copying image names from AWS (ami-style names); omitting the version segment; using `kops create cluster --image` with a partial URN.","solutions":["Use a full URN with exactly 4 parts, e.g. `Canonical:UbuntuServer:18.04-LTS:latest`, in spec.image or --image.","Alternatively use the full Azure image resource ID (contains '/'), which takes the ID code path.","Get the correct URN via `az vm image list --output table`."],"exampleFix":"// before\nimage: Canonical:UbuntuServer:18.04-LTS\n// after\nimage: Canonical:UbuntuServer:18.04-LTS:latest","handlingStrategy":"validation","validationCode":"img := ig.Spec.Image\nif !strings.Contains(img, \"/\") {\n  parts := strings.Split(img, \":\")\n  if len(parts) != 4 {\n    return fmt.Errorf(\"image %q must be a resource ID or urn publisher:offer:sku:version\", img)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy image URNs directly from `az vm image list` output.","Always include all four URN segments, including version.","Prefer full image resource IDs to avoid URN formatting mistakes."],"tags":["azure","image","vmss","configuration"],"backgroundTag":"malformed-image-urn","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"}