{"record":{"id":"8ea766dfbb9fda1c","repo":"kubernetes/kops","slug":"error-creating-sqs-queue-v","errorCode":null,"errorMessage":"error creating SQS queue: %v","messagePattern":"error creating SQS queue: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/sqs.go","lineNumber":227,"sourceCode":"func (q *SQS) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *SQS) error {\n\tctx := context.TODO()\n\tpolicy, err := fi.ResourceAsString(e.Policy)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error rendering RolePolicyDocument: %v\", err)\n\t}\n\n\tif a == nil {\n\t\trequest := &sqs.CreateQueueInput{\n\t\t\tAttributes: map[string]string{\n\t\t\t\t\"MessageRetentionPeriod\": strconv.Itoa(q.MessageRetentionPeriod),\n\t\t\t\t\"Policy\":                 policy,\n\t\t\t},\n\t\t\tQueueName: q.Name,\n\t\t\tTags:      q.Tags,\n\t\t}\n\t\tresponse, err := t.Cloud.SQS().CreateQueue(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating SQS queue: %v\", err)\n\t\t}\n\n\t\tattributes, err := t.Cloud.SQS().GetQueueAttributes(ctx, &sqs.GetQueueAttributesInput{\n\t\t\tAttributeNames: []sqstypes.QueueAttributeName{sqstypes.QueueAttributeNameQueueArn},\n\t\t\tQueueUrl:       response.QueueUrl,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error getting SQS queue attributes: %v\", err)\n\t\t}\n\n\t\te.ARN = aws.String(attributes.Attributes[\"QueueArn\"])\n\t}\n\n\treturn nil\n}\n\ntype terraformSQSQueue struct {\n\tName                    *string                  `cty:\"name\"`","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/sqs.go#L209-L245","documentation":"After rendering the policy, RenderAWS creates the SQS queue via sqs.CreateQueue when the task does not yet exist (a == nil). Any AWS API rejection is wrapped as \"error creating SQS queue\". This is a hard failure: the queue task cannot be reconciled without the queue existing.","triggerScenarios":"t.Cloud.SQS().CreateQueue returns an error: invalid queue name (bad characters, >80 chars), tag limits/throttling, UnauthorizedOperation, or queue already exists with different attributes when a==nil is mis-detected.","commonSituations":"Queue name containing invalid characters from cluster name; AWS API throttling during large cluster creation; IAM role for kOps missing sqs:CreateQueue permission; account-level queue quota exceeded.","solutions":["Read the wrapped AWS error code; fix the specific issue (permissions, name, quota).","Verify the kOps IAM policy grants sqs:CreateQueue and sqs:SetQueueAttributes.","Check queue name derived from cluster/instance-group names for invalid characters or length.","Retry on throttling (AWS request rate exceeded); kOps reruns will converge.","Check service quotas for queues per region if 'Maximum number of queues' errors appear."],"exampleFix":"// before (IAM policy)\n// no sqs permissions\n// after\n{\"Effect\":\"Allow\",\"Action\":[\"sqs:CreateQueue\",\"sqs:SetQueueAttributes\",\"sqs:GetQueueAttributes\",\"sqs:DeleteQueue\"],\"Resource\":\"*\"}","handlingStrategy":"retry","validationCode":"// pre-checks before apply\naws sqs list-queues --queue-name-prefix <name> # confirm name/quota situation\naws iam simulate-principal-policy --policy-source-arn <kopsRoleArn> --action-names sqs:CreateQueue","typeGuard":null,"tryCatchPattern":"if err := kopsApply(ctx); err != nil {\n    if strings.Contains(err.Error(), \"error creating SQS queue\") && strings.Contains(err.Error(), \"Throttling\") {\n        time.Sleep(backoff); return kopsApply(ctx) // bounded retries\n    }\n    return err\n}","preventionTips":["Grant sqs:CreateQueue/SetQueueAttributes to the kOps IAM role.","Keep queue names derived from cluster names short and alphanumeric.","Avoid concurrent applies against the same cluster.","Monitor AWS service health for SQS during large provisioning runs."],"tags":["aws","sqs","api-error","create"],"backgroundTag":"aws-api-call-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"}