{"record":{"id":"03712c13c6a655b0","repo":"kubernetes/kops","slug":"unable-to-parse-role-arn-q","errorCode":null,"errorMessage":"unable to parse role arn %q","messagePattern":"unable to parse role arn %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/names.go","lineNumber":169,"sourceCode":"\tdefault:\n\t\tklog.Fatalf(\"unknown InstanceGroup Role: %q\", role)\n\t}\n\treturn truncate.TruncateString(rolename, truncate.TruncateStringOptions{MaxLength: iam.MaxLengthIAMRoleName, AlwaysAddHash: false})\n}\n\nvar roleNamRegExp = regexp.MustCompile(`([^/]+$)`)\n\n// FindCustomAuthNameFromArn parses the name of a instance profile from the arn\nfunc FindCustomAuthNameFromArn(arn string) (string, error) {\n\tif arn == \"\" {\n\t\treturn \"\", fmt.Errorf(\"unable to parse role arn as it is not set\")\n\t}\n\trs := roleNamRegExp.FindStringSubmatch(arn)\n\tif len(rs) >= 2 {\n\t\treturn rs[1], nil\n\t}\n\n\treturn \"\", fmt.Errorf(\"unable to parse role arn %q\", arn)\n}\n\nfunc (b *KopsModelContext) LinkToIAMInstanceProfile(ig *kops.InstanceGroup) (*awstasks.IAMInstanceProfile, error) {\n\tif ig.Spec.IAM != nil && ig.Spec.IAM.Profile != nil {\n\t\tname, err := FindCustomAuthNameFromArn(fi.ValueOf(ig.Spec.IAM.Profile))\n\t\treturn &awstasks.IAMInstanceProfile{Name: &name}, err\n\t}\n\tname := b.IAMName(ig.Spec.Role)\n\treturn &awstasks.IAMInstanceProfile{Name: &name}, nil\n}\n\n// SSHKeyName computes a unique SSH key name, combining the cluster name and the SSH public key fingerprint.\n// If an SSH key name is provided in the cluster configuration, it will use that instead.\nfunc (b *KopsModelContext) SSHKeyName() (string, error) {\n\t// use configured SSH key name if present\n\tsshKeyName := b.Cluster.Spec.SSHKeyName\n\tif sshKeyName != nil && *sshKeyName != \"\" {\n\t\treturn *sshKeyName, nil","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/names.go#L151-L187","documentation":"A non-empty ARN was supplied to FindCustomAuthNameFromArn, but the trailing-segment regex `([^/]+$)` found no match, meaning the string is not shaped like an ARN with a final path segment. The input at fault is the custom ARN configured for the instance profile.","triggerScenarios":"Thrown at pkg/model/names.go:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the configured ARN to a well-formed one ending in a role name (e.g. arn:aws:iam::123456789012:role/my-role)","Copy the ARN verbatim from the AWS IAM console to avoid truncation or whitespace"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}