Skip to content

sqs.Client.TagQueue returns an error but still succeessfully tags a resource #1047

@artyom

Description

@artyom

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug

Attempts to tag an SQS queue with sqs.Client.TagQueue call fails with the following error:

operation error SQS: TagQueue, https response error StatusCode: 200, RequestID: 551b5c11-ecbd-55de-8d46-046a7bfc9c2d, deserialization failed, failed to decode response body, TagQueueResult node not found

API call actually succeeds, as provided tags appear on a resource.

Version of AWS SDK for Go?

0.31.0

Version of Go (go version)?

go version go1.16beta1 darwin/arm64

To Reproduce (observed behavior)

Steps to reproduce the behavior (please share code or minimal repo)

go.mod contents:

module sdk-bug

go 1.16

require (
	github.com/aws/aws-sdk-go-v2 v0.31.0
	github.com/aws/aws-sdk-go-v2/config v0.4.0
	github.com/aws/aws-sdk-go-v2/service/sqs v0.31.0
)

main.go contents:

package main

import (
	"context"
	"errors"
	"flag"
	"log"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/sqs"
)

func main() {
	log.SetFlags(0)
	flag.Parse()
	if err := run(context.Background(), flag.Arg(0)); err != nil {
		log.Fatal(err)
	}
}

func run(ctx context.Context, queueURL string) error {
	if queueURL == "" {
		return errors.New("provide a queue url to tag")
	}
	log.Println("SDK version:", aws.SDKVersion)
	cfg, err := config.LoadDefaultConfig(ctx)
	if err != nil {
		return err
	}
	svc := sqs.NewFromConfig(cfg)
	_, err = svc.TagQueue(ctx, &sqs.TagQueueInput{
		QueueUrl: &queueURL,
		Tags:     map[string]string{"Environment": "staging"},
	})
	return err
}

Build and run this program providing an SQS queue URL as a first positional argument.

Expected behavior

Program prints SDK version on stderr and finishes with 0 exit status. Resource is tagged.

Actual behavior

Program prints SDK version on stderr and finishes with non-zero exit status, printing an error:

operation error SQS: TagQueue, https response error StatusCode: 200, RequestID: 551b5c11-ecbd-55de-8d46-046a7bfc9c2d, deserialization failed, failed to decode response body, TagQueueResult node not found

Resource is tagged.

Additional context

Similar error happens with rds.Client.AddTagsToResource calls.

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions