Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route53 calls like UPSERT are not working after API refactoring #850

Closed
3 tasks done
begetan opened this issue Oct 23, 2020 · 4 comments · Fixed by #858
Closed
3 tasks done

Route53 calls like UPSERT are not working after API refactoring #850

begetan opened this issue Oct 23, 2020 · 4 comments · Fixed by #858
Assignees
Labels
bug This issue is a bug.

Comments

@begetan
Copy link

begetan commented Oct 23, 2020

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

Describe the bug
Route53 calls like UPSERT or DELETE are not working after refactoring

Version of AWS SDK for Go?
github.com/aws/aws-sdk-go-v2 v0.27.0

Version of Go (go version)?
go version go1.15.3 linux/amd64

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

import (
        ...
        "github.com/aws/aws-sdk-go-v2/service/route53"
	r53types "github.com/aws/aws-sdk-go-v2/service/route53/types"
)

func changeRecordSet(action r53types.ChangeAction, zoneID string, ip string, name string) {
	svc := route53.NewFromConfig(app.cfg)
	input := &route53.ChangeResourceRecordSetsInput{
		ChangeBatch: &r53types.ChangeBatch{
			Changes: []*r53types.Change{
				{
					Action: action,
					ResourceRecordSet: &r53types.ResourceRecordSet{
						Name: aws.String(name),
						ResourceRecords: []*r53types.ResourceRecord{
							{
								Value: aws.String(ip),
							},
						},
						TTL:  aws.Int64(60),
						Type: r53types.RRTypeA,
					},
				},
			},
			Comment: aws.String("Register instance"),
		},
		HostedZoneId: aws.String(zoneID),
	}

	result, err := svc.ChangeResourceRecordSets(app.ctx, input)
	if err != nil {
		log.Println(err.Error())
	}
}

Expected behavior
This code should create an A record with the name for the given ip

Actual behavior
It produces an error instead:

2020/10/23 09:47:46 operation error Route 53: ChangeResourceRecordSets, https response error StatusCode: 400, RequestID: 1fa90f4a-135b-46cd-bcdf-d721b3222c2f, InvalidInput: Invalid XML ; cvc-elt.1.a: Cannot find the declaration of element 'ChangeResourceRecordSetsRequest'.
@begetan begetan added the bug This issue is a bug. label Oct 23, 2020
@jasdel
Copy link
Contributor

jasdel commented Oct 23, 2020

Thanks for reporting this issue @begetan. The issue that you are seeing most likely is the same as #843 and was fixed in #846. This fix will be included in the SDK's next tagged release.

You can work around the issue in the mean time you can configure your application to use the latest version of the Amazon Route53 client setting the module dependency to v0.27.1-0.20201020231110-5550687176a7 in your application's go.mod file.

Or running go get directly on the HEAD commit of the repo.

go get github.com/aws/aws-sdk-go-v2/service/route53@5550687176a7

@jasdel jasdel added the duplicate This issue is a duplicate. label Oct 23, 2020
@rafajpet
Copy link

Hi. I have the same problem. Try workaround with version
go get github.com/aws/aws-sdk-go-v2/service/route53@5550687176a7
without success.

@begetan
Copy link
Author

begetan commented Oct 26, 2020

I still have the same problem with the recommended module version.

I am using a string without any slashes as for the old version:
zoneID := Z071828315DEKQK7F4AXK

operation error Route 53: ChangeResourceRecordSets, https response error StatusCode: 400, RequestID: e0fc5bb4-5d08-4685-bc0d-748a100877ee, InvalidInput: Invalid XML ; cvc-elt.1.a: Cannot find the declaration of element 'ChangeResourceRecordSetsRequest'.

This error looks like an xml malformed format somewhere in the library.

go.sum file:

github.com/aws/aws-sdk-go-v2/service/route53 v0.27.1-0.20201020231110-5550687176a7 h1:zX8aDpLoMGAnKq6uCZ7XFhHLR9obFUdqVI5yvSP03L4=
github.com/aws/aws-sdk-go-v2/service/route53 v0.27.1-0.20201020231110-5550687176a7/go.mod h1:V3E5HcDEBnMNliBSIr+blIjdFswiqzuHB+CJDZ2iDEs=

@skotambkar skotambkar self-assigned this Oct 27, 2020
@skotambkar skotambkar removed the duplicate This issue is a duplicate. label Oct 27, 2020
@skotambkar
Copy link
Contributor

Thanks for the follow up @begetan . We have identified the issue being the built request body not containing xml namespace value which is required by route53 operations. We are currently working on it and will put out a PR shortly to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants