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

service/ec2: ModifyNetworkInterfaceAttribute fails when Value: false but works when Value: true #1107

Closed
2 tasks done
tylux opened this issue Feb 3, 2021 · 5 comments · Fixed by #1195
Closed
2 tasks done
Labels
bug This issue is a bug.

Comments

@tylux
Copy link

tylux commented Feb 3, 2021

Confirm by changing [ ] to [x] below:

Describe the question

Using v1.1.0 of the sdk, I am unable to disable SourceDestCheck on ENIs with the following code

		input := &ec2.ModifyNetworkInterfaceAttributeInput{
			NetworkInterfaceId: aws.String(eni),
			SourceDestCheck: &types.AttributeBooleanValue{
				Value: false,
			},
		}

		_, err := client.ModifyNetworkInterfaceAttribute(context.Background(), input)

This returns...

operation error EC2: ModifyNetworkInterfaceAttribute, https response error StatusCode: 400, RequestID: 947bd2b9-...-8e276816081c, api error InvalidParameterCombination: No attributes specified.

However when I change Value to true (enable SourceDestCheck) the code works just fine and will enable SourceDestCheck if it isn't already enabled on the ENI

I feel like this is a bug but I could be wrong.

@tylux tylux added the guidance Question that needs advice or information. label Feb 3, 2021
@tylux
Copy link
Author

tylux commented Feb 3, 2021

I also tried downgrading to 0.31.0 and got same result

@skotambkar
Copy link
Contributor

Thanks for reaching out @tylux . To help us better understand the issue, could you provide us with the request wire log?

You can enable logging as follows:

response, err := client. ModifyNetworkInterfaceAttribute(context.Background(), input, func(o *ec2.Options) {
		    o.ClientLogMode = aws.LogRequestWithBody
})

@skotambkar skotambkar added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 4, 2021
@tylux
Copy link
Author

tylux commented Feb 4, 2021

Here it is

SDK 2021/02/04 14:42:08 DEBUG Request
POST / HTTP/1.1
Host: ec2.us-east-1.amazonaws.com
User-Agent: aws-sdk-go-v2/1.1.0
Content-Length: 98
Amz-Sdk-Invocation-Id: 3364613e-865c-4d6b-8b7a-9c634ca6e3f0
Amz-Sdk-Request: attempt=1; max=3
Authorization: AWS4-HMAC-SHA256 Credential=<redacted>, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-user-agent, Signature=<redacted>
Content-Type: application/x-www-form-urlencoded
X-Amz-Date: 20210204T144208Z
X-Amz-Security-Token: <redacted>
X-Amz-User-Agent: aws-sdk-go-v2/1.1.0 os/linux lang/go/1.15.7 md/GOOS/linux md/GOARCH/amd64
Accept-Encoding: gzip

Action=ModifyNetworkInterfaceAttribute&NetworkInterfaceId=eni-<redacted>&Version=2016-11-15
2021/02/04 14:42:08 Got an error
2021/02/04 14:42:08 operation error EC2: ModifyNetworkInterfaceAttribute, https response error StatusCode: 400, RequestID: 793b09da-302a-47dd-b293-df08c875ef57, api error InvalidParameterCombination: No attributes specified.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 5, 2021
@jasdel jasdel changed the title ModifyNetworkInterfaceAttribute fails when Value: false but works when Value: true service/ec2: ModifyNetworkInterfaceAttribute fails when Value: false but works when Value: true Mar 3, 2021
@jasdel jasdel added bug This issue is a bug. and removed guidance Question that needs advice or information. labels Mar 3, 2021
@jasdel
Copy link
Contributor

jasdel commented Mar 3, 2021

Thanks for reporting this issue. This is an issue with how the SDK is treating modeled modeled boolean members. I'm thinking this member should be decorated as required since the API is expecting the value to be present. But will reach out to the Amazon EC2 team for guidance on how this API model should be updated to handle this use case.

jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this issue Mar 10, 2021
Updates the Query Protocol serializer generation to always serialize
unboxed member values to the querystring. This prevents issues with
members values never being serialized to the request.

Fixes aws#1107
@github-actions
Copy link

github-actions bot commented May 6, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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
3 participants