{"record":{"id":"54fa746e5040f84f","repo":"kubernetes/kops","slug":"unexpected-error-fetching-tags-for-resource-v-54fa74","errorCode":null,"errorMessage":"unexpected error fetching tags for resource: %v","messagePattern":"unexpected error fetching tags for resource: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":1390,"sourceCode":"\tif len(extra) > 0 {\n\t\tklog.V(4).Infof(\"Removing tags from %q: %v\", resourceID, missing)\n\t\terr := deleteTags(c, resourceID, extra)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *awsCloudImplementation) AddAWSTags(id string, expected map[string]string) error {\n\treturn addAWSTags(c, id, expected)\n}\n\nfunc addAWSTags(c AWSCloud, id string, expected map[string]string) error {\n\tactual, err := c.GetTags(id)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unexpected error fetching tags for resource: %v\", err)\n\t}\n\n\tmissing := map[string]string{}\n\tfor k, v := range expected {\n\t\tactualValue, found := actual[k]\n\t\tif found && actualValue == v {\n\t\t\tcontinue\n\t\t}\n\t\tmissing[k] = v\n\t}\n\n\tif len(missing) != 0 {\n\t\tklog.V(4).Infof(\"adding tags to %q: %v\", id, missing)\n\n\t\terr := c.CreateTags(id, missing)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error adding tags to resource %q: %v\", id, err)\n\t\t}","sourceCodeStart":1372,"sourceCodeEnd":1408,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L1372-L1408","documentation":"addAWSTags could not read the current tags of the resource (via GetTags, which itself retries eventual-consistency errors), so it cannot compute which tags are missing. The wrapped %v carries the underlying DescribeTags failure.","triggerScenarios":"DescribeTags called with an invalid/non-existent resource ID, throttling from many concurrent tag fetches, or IAM missing ec2:DescribeTags, while validating that expected tags are present.","commonSituations":"Applying tags to a resource still being created; throttled account under large cluster fan-out; misconfigured region so the resource is not found in the target region.","solutions":["Confirm the resource ID exists in the target region with `aws ec2 describe-tags`.","Inspect the wrapped error for Throttling and reduce concurrency or add backoff.","Verify IAM policy includes ec2:DescribeTags.","Re-run kops after a short delay if the resource was just created."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify the resource is visible to tag APIs before addAWSTags\nif _, err := c.GetTags(id); err != nil {\n    time.Sleep(10 * time.Second) // allow eventual consistency\n}","typeGuard":null,"tryCatchPattern":"err := addAWSTags(c, id, expected)\nif err != nil {\n    var throttle smithy.APIError\n    if errors.As(err, &throttle) && strings.Contains(throttle.ErrorCode(), \"Throttling\") {\n        time.Sleep(backoff)\n        return addAWSTags(c, id, expected)\n    }\n    return err\n}","preventionTips":["Bound concurrency of tag operations to avoid throttling","Confirm region before calling GetTags","Wait for newly created resources before validating tags","Log the wrapped GetTags error detail for diagnosis"],"tags":["aws","ec2","tags","describe-tags"],"backgroundTag":"aws-api-error","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"}