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

Cannot create R53 entries anymore #1550

Closed
andrewmeissner opened this issue Sep 26, 2017 · 11 comments
Closed

Cannot create R53 entries anymore #1550

andrewmeissner opened this issue Sep 26, 2017 · 11 comments
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue.

Comments

@andrewmeissner
Copy link

andrewmeissner commented Sep 26, 2017

Please fill out the sections below to help us address your issue.

Version of AWS SDK for Go?

1.11.0

Version of Go (go version)?

go1.9 darwin/amd64

What issue did you see?

When trying to upsert a route53, I get the following error:
MalformedInput: ChangeBatch is not valid, expected ChangeResourceRecordSetsRequest

This error seems to have just started happenining within the past few hours.

Steps to reproduce

update the aws-sdk, and run the same code to generate a route53 entry

If you have have an runnable example, please include it.

package main

import (
	"fmt"
	"os"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/route53"
)

func main() {
	awsKeyID := os.Getenv("AWS_ACCESS_KEY_ID")
	awsSecretKey := os.Getenv("AWS_SECRET_ACCESS_KEY")
	creds := credentials.NewStaticCredentials(awsKeyID, awsSecretKey, "")
	awsConfig := aws.Config{Region: aws.String("us-west-2"), Credentials: creds}
	r53Svc := route53.New(session.New(&awsConfig))

	input := &route53.ChangeResourceRecordSetsInput{
		HostedZoneId: aws.String("myHostedZoneID"),
		ChangeBatch: &route53.ChangeBatch{
			Comment: aws.String("Just a little test"),
			Changes: []*route53.Change{
				{
					Action: aws.String(route53.ChangeActionUpsert),
					ResourceRecordSet: &route53.ResourceRecordSet{
						Name: aws.String("mytest.mydomain.com"),
						Type: aws.String(route53.RRTypeA),
						TTL:  aws.Int64(300),
						ResourceRecords: []*route53.ResourceRecord{
							{
								Value: aws.String("myIPAddress"),
							},
						},
					},
				},
			},
		},
	}

	result, err := r53Svc.ChangeResourceRecordSets(input)

	if err != nil {
		panic(err)
	}

	fmt.Println(result)
}
@andrewmeissner
Copy link
Author

Is this in anyway related to the latest release? This exact code was working perfectly last week / yesterday

@jasdel
Copy link
Contributor

jasdel commented Sep 26, 2017

Thanks for reaching out to us I'll take a look at this. Would you be able to enable logging with aws.LogDebugWithHTTPBody this will help identify if this issue is related to the change today.

you can do this with

awsConfig := aws.Config{
    Region: aws.String("us-west-2"),
    Credentials: creds,
    LogLevel: aws.LogLevel(aws.LogDebugWithHTTPBody),
}

@andrewmeissner
Copy link
Author

2017/09/26 15:23:36 DEBUG: Request route53/ChangeResourceRecordSets Details:
---[ REQUEST POST-SIGN ]-----------------------------
POST /2013-04-01/hostedzone/myHostedZoneID/rrset/ HTTP/1.1
Host: route53.amazonaws.com
User-Agent: aws-sdk-go/1.11.0 (go1.9; darwin; amd64)
Content-Length: 315
Authorization: AWS4-HMAC-SHA256 Credential=<redacted>/20170926/us-east-1/route53/aws4_request, SignedHeaders=content-length;host;x-amz-date, Signature=6a697e39c1c8901892239a612d4cebe5f17b6fa2e8d1eac430f8caea4fd31a21
X-Amz-Date: 20170926T212336Z
Accept-Encoding: gzip

<ChangeBatch><Changes><Change><Action>UPSERT</Action><ResourceRecordSet><Name>mytest.mydomain.com</Name><ResourceRecords><ResourceRecord><Value>myIPAddress</Value></ResourceRecord></ResourceRecords><TTL>300</TTL><Type>A</Type></ResourceRecordSet></Change></Changes><Comment>Just a little test</Comment></ChangeBatch>
-----------------------------------------------------
2017/09/26 15:23:37 DEBUG: Response route53/ChangeResourceRecordSets Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 400 Bad Request
Connection: close
Content-Length: 312
Content-Type: text/xml
Date: Tue, 26 Sep 2017 21:23:37 GMT
X-Amzn-Requestid: f588cc2d-a300-11e7-8b4d-07e5ef427368


-----------------------------------------------------
2017/09/26 15:23:37 <?xml version="1.0"?>
<ErrorResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"><Error><Type>Sender</Type><Code>MalformedInput</Code><Message>ChangeBatch is not valid, expected ChangeResourceRecordSetsRequest</Message></Error><RequestId>f588cc2d-a300-11e7-8b4d-07e5ef427368</RequestId></ErrorResponse>
panic: MalformedInput: ChangeBatch is not valid, expected ChangeResourceRecordSetsRequest
	status code: 400, request id: f588cc2d-a300-11e7-8b4d-07e5ef427368

goroutine 1 [running]:
main.main()
	/Users/ameissner/test.go:45 +0x9f6
exit status 2

@jasdel jasdel added bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Sep 26, 2017
@jasdel
Copy link
Contributor

jasdel commented Sep 26, 2017

Thanks for the update @andrewmeissner i've been able to reproduce this on my end, and and working to correct the bug.

@andrewmeissner
Copy link
Author

@jasdel thanks so much!

jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Sep 26, 2017
@jasdel
Copy link
Contributor

jasdel commented Sep 26, 2017

I've created #1551 reverting the new marshalers in the short term until this bug can be fixed. I'll create a new version and recall v1.11.0 once the PR is merged in.

@andrewmeissner
Copy link
Author

Thanks so much! Hope this bug isn't too problematic in bringing back the marshalers!

jasdel added a commit that referenced this issue Sep 26, 2017
* Revert "API Marshaler: Add generated marshalers for RESTJSON protocol (#1547)"

This reverts commit 1a10a10.

Reverts RESTJSON marshaler improvement due to bug in RESTXML

* Revert "API Marshaling: Add generated marshalers for RESTXML protocol (#1409)"

This reverts commit 37448a9.

Reverts RESTXML due to #1550
@awstools awstools mentioned this issue Sep 26, 2017
@jasdel
Copy link
Contributor

jasdel commented Sep 27, 2017

In a future release we'll that add back in the code generated API marshallers after more verification is done to make sure there are no additional edge cases the new marshallers are missing.

@jasdel
Copy link
Contributor

jasdel commented Sep 27, 2017

I have a fix locally that correct the Route 53 issue. It turns out this specific condition was not included in the SDKs protocol tests that I used to verify the changes. Causing the bug to get released.

Before releasing the marshallers again I think a utility is needed verify they marshaled output/request matches the current SDKs output. Protocol tests should also be updated.

jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Sep 27, 2017
This reverts commit 6a946b2.

Fixes the aws#1550 bug with RESTXML not correctly marshaling Amazon Route53 APIs
@jasdel
Copy link
Contributor

jasdel commented Sep 27, 2017

Thanks again @andrewmeissner for posting this issue. Since the RESTXML change as been reverted and Route 53 request are working correction I'm going to close this issue as fixed. I have PR #1554 that will reenable the generated marshalers that can be accepted once more verification is completed.

@jasdel jasdel closed this as completed Sep 27, 2017
jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Sep 28, 2017
This reverts commit 6a946b2.

Fixes the aws#1550 bug with RESTXML not correctly marshaling Amazon Route53 APIs
@andrewmeissner
Copy link
Author

@jasdel Thanks so much for getting me up and running again!

jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Nov 17, 2017
This reverts commit 6a946b2.

Fixes the aws#1550 bug with RESTXML not correctly marshaling Amazon Route53 APIs
jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Nov 27, 2017
This reverts commit 6a946b2.

Fixes the aws#1550 bug with RESTXML not correctly marshaling Amazon Route53 APIs
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. investigating This issue is being investigated and/or work is in progress to resolve the issue.
Projects
None yet
Development

No branches or pull requests

2 participants