kubernetes/kops · error

error getting SQS queue attributes: %v

Error message

error getting SQS queue attributes: %v

What it means

GetQueueAttributes failed while reading MessageRetentionPeriod, Policy and QueueArn from the discovered SQS queue; the AWS API call errored (permissions, deleted queue, throttling).

Source

Thrown at upup/pkg/fi/cloudup/awstasks/sqs.go:86

		QueueNamePrefix: q.Name,
	})
	if err != nil {
		return nil, fmt.Errorf("error listing SQS queues: %v", err)
	}
	if response == nil || len(response.QueueUrls) == 0 {
		return nil, nil
	}
	if len(response.QueueUrls) != 1 {
		return nil, fmt.Errorf("found multiple SQS queues matching queue name")
	}
	url := response.QueueUrls[0]

	attributes, err := cloud.SQS().GetQueueAttributes(ctx, &sqs.GetQueueAttributesInput{
		AttributeNames: []sqstypes.QueueAttributeName{sqstypes.QueueAttributeNameMessageRetentionPeriod, sqstypes.QueueAttributeNamePolicy, sqstypes.QueueAttributeNameQueueArn},
		QueueUrl:       aws.String(url),
	})
	if err != nil {
		return nil, fmt.Errorf("error getting SQS queue attributes: %v", err)
	}
	actualPolicy := attributes.Attributes["Policy"]
	actualARN := attributes.Attributes["QueueArn"]
	period, err := strconv.Atoi(attributes.Attributes["MessageRetentionPeriod"])
	if err != nil {
		return nil, fmt.Errorf("error coverting MessageRetentionPeriod to int: %v", err)
	}

	tags, err := cloud.SQS().ListQueueTags(ctx, &sqs.ListQueueTagsInput{
		QueueUrl: aws.String(url),
	})
	if err != nil {
		return nil, fmt.Errorf("error listing SQS queue tags: %v", err)
	}

	// We parse both as JSON; if the json forms are equal we pretend the actual value is the expected value
	if q.Policy != nil {
		expectedPolicy, err := fi.ResourceAsString(q.Policy)

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check sqs:GetQueueAttributes permissions
  2. Verify the queue still exists and was not concurrently deleted
  3. Retry the apply
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/awstasks/sqs.go:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/4ec0cd2a9c13fad6. Report an issue: GitHub.