{"record":{"id":"c10ceddc36275e5c","repo":"kubernetes/kops","slug":"error-coverting-messageretentionperiod-to-int-v","errorCode":null,"errorMessage":"error coverting MessageRetentionPeriod to int: %v","messagePattern":"error coverting MessageRetentionPeriod to int: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/sqs.go","lineNumber":92,"sourceCode":"\t\treturn nil, nil\n\t}\n\tif len(response.QueueUrls) != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple SQS queues matching queue name\")\n\t}\n\turl := response.QueueUrls[0]\n\n\tattributes, err := cloud.SQS().GetQueueAttributes(ctx, &sqs.GetQueueAttributesInput{\n\t\tAttributeNames: []sqstypes.QueueAttributeName{sqstypes.QueueAttributeNameMessageRetentionPeriod, sqstypes.QueueAttributeNamePolicy, sqstypes.QueueAttributeNameQueueArn},\n\t\tQueueUrl:       aws.String(url),\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting SQS queue attributes: %v\", err)\n\t}\n\tactualPolicy := attributes.Attributes[\"Policy\"]\n\tactualARN := attributes.Attributes[\"QueueArn\"]\n\tperiod, err := strconv.Atoi(attributes.Attributes[\"MessageRetentionPeriod\"])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error coverting MessageRetentionPeriod to int: %v\", err)\n\t}\n\n\ttags, err := cloud.SQS().ListQueueTags(ctx, &sqs.ListQueueTagsInput{\n\t\tQueueUrl: aws.String(url),\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing SQS queue tags: %v\", err)\n\t}\n\n\t// We parse both as JSON; if the json forms are equal we pretend the actual value is the expected value\n\tif q.Policy != nil {\n\t\texpectedPolicy, err := fi.ResourceAsString(q.Policy)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error reading expected Policy for SQS %q: %v\", aws.ToString(q.Name), err)\n\t\t}\n\t\texpectedJson := make(map[string]interface{})\n\t\terr = json.Unmarshal([]byte(expectedPolicy), &expectedJson)\n\t\tif err != nil {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/sqs.go#L74-L110","documentation":"strconv.Atoi failed on the queue's MessageRetentionPeriod attribute — AWS returned a value that is not an integer, so kOps cannot populate the SQS task's comparison field.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/sqs.go:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the queue's attributes in the AWS console for a corrupted MessageRetentionPeriod","Recreate or fix the queue's attributes so the period is a plain integer (seconds)"],"exampleFix":null,"handlingStrategy":"validation","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-12T07:17:12.445Z"}