{"record":{"id":"1d19ce4ef8523e24","repo":"kubernetes/kops","slug":"image-name-specification-not-recognized-q","errorCode":null,"errorMessage":"image name specification not recognized: %q","messagePattern":"image name specification not recognized: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":1740,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trequest.ImageIds = []string{image}\n\t} else {\n\t\t// Either <imagename> or <owner>/<imagename>\n\t\ttokens := strings.SplitN(name, \"/\", 2)\n\t\tif len(tokens) == 1 {\n\t\t\t// self is a well-known value in the DescribeImages call\n\t\t\trequest.Owners = []string{\"self\"}\n\t\t\trequest.Filters = append(request.Filters, NewEC2Filter(\"name\", name))\n\t\t} else if len(tokens) == 2 {\n\t\t\towner := ResolveImageOwnerAlias(tokens[0])\n\n\t\t\trequest.Owners = []string{owner}\n\t\t\trequest.Filters = append(request.Filters, NewEC2Filter(\"name\", tokens[1]))\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"image name specification not recognized: %q\", name)\n\t\t}\n\t}\n\n\tvar image *ec2types.Image\n\tpaginator := ec2.NewDescribeImagesPaginator(ec2Client, request)\n\tfor paginator.HasMorePages() {\n\t\tpage, err := paginator.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing images: %v\", err)\n\t\t}\n\n\t\tfor _, v := range page.Images {\n\t\t\tif image == nil {\n\t\t\t\timage = &v\n\t\t\t} else {\n\t\t\t\titime, _ := time.Parse(time.RFC3339, *image.CreationDate)\n\t\t\t\tvtime, _ := time.Parse(time.RFC3339, *v.CreationDate)\n\t\t\t\tif vtime.After(itime) {","sourceCodeStart":1722,"sourceCodeEnd":1758,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L1722-L1758","documentation":"Returned by resolveImage (aws_cloud.go:1740) when the image name argument cannot be parsed into a known spec format. kops accepts an AMI ID, an owner-alias/name pair, or a bare name; anything else is rejected before any EC2 call.","triggerScenarios":"The `name` string splits into an unexpected number of tokens — e.g. more than one `/` separator, or a form with 3+ tokens that matches neither `account-id/name` nor the single-name pattern.","commonSituations":"Users pass a full AMI path like `099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*` (3 slash-separated segments) where kops only supports `owner/name` or a plain name; extra whitespace or a trailing slash also breaks parsing.","solutions":["Use one of the supported forms: a bare image name, `owner/name` (2 tokens), or an explicit ami-ID","Convert the 3-part public AMI path into `owner/name`, e.g. `099720109477/ubuntu-jammy-22.04-amd64-server-*`","Or resolve the path to a concrete AMI ID with `aws ec2 describe-images --owners 099720109477 --filters Name=name,Values=...` and set that AMI ID in the spec","Check for typos, spaces, or duplicate slashes in the kops `kubernetesVersion`/AMI configuration"],"exampleFix":"// before\nKOPS_STATE_STORE=... kops create cluster --image 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*\n// after\nkops create cluster --image 099720109477/ubuntu-jammy-22.04-amd64-server-*","handlingStrategy":"validation","validationCode":"// Validate the image spec token count before handing it to kops\nparts := strings.Split(name, \"/\")\nif len(parts) != 1 && len(parts) != 2 {\n\treturn fmt.Errorf(\"unsupported image spec %q: use NAME, OWNER/NAME, or an ami ID\", name)\n}","typeGuard":"func isSupportedImageSpec(name string) bool {\n\tparts := strings.Split(name, \"/\")\n\treturn len(parts) == 1 || len(parts) == 2\n}","tryCatchPattern":null,"preventionTips":["Convert 3+ segment public AMI paths into OWNER/NAME form or a concrete AMI ID","Trim whitespace and collapse duplicate slashes in configured image names","Prefer explicit AMI IDs for reproducible cluster builds"],"tags":["aws","ec2","ami","input-validation"],"backgroundTag":"invalid-image-specifier","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}