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
Unmarshal Response s3/GetObjectTagging failed, attempt 11/25, error SerializationError: failed to decode REST XML response #4709
Comments
Hi @mattduguid ,
The response shape is based on the service API and should look like this: <?xml version="1.0" encoding="UTF-8"?>
<Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<TagSet>
<Tag>
<Key>tag1</Key>
<Value>val1</Value>
</Tag>
<Tag>
<Key>tag2</Key>
<Value>val2</Value>
</Tag>
</TagSet>
</Tagging> Since you didnt share any code, and are using two separate third party tools, I can only make gusses as to what is actually happening. As for "S3-compatible API" goes, we don't know that for sure. You can enable logging and inspect the raw http response yourself and see why the xml is malformed by doing the following: s3Client := s3.New(sess, aws.NewConfig().WithLogLevel(aws.LogDebugWithHTTPBody)) My guess is something like the following is happening: <?xml version="1.0" encoding="UTF-8"?>
<Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<TagSet>
<Tag>
<Key>1&&&&&&</Key> error occurs here
<Value>val1</Value>
</Tag>
<Tag>
<Key>tag2</Key>
<Value>val2</Value>
</Tag>
</TagSet>
</Tagging> Please let us know what you find. |
Hi @RanVaknin we also think that will be the fix eg: "to not include the file contents in the http response body" We are using the public aws terraform provider so this is not our code, im wondering if i have logged this in the wrong channel and might be better placed here https://github.com/hashicorp/terraform-provider-aws/issues will spin up issue there and close this one, thanks |
closing and moving to hashicorp/terraform-provider-aws#29207 |
|
I see what you are saying 👍 Thanks, |
Describe the bug
We have an odd issue which is blocking us from moving forward, when we attempt to upload a "wpad.dat" (proxy config file) to a cloudflare r2 bucket (https://www.cloudflare.com/en-gb/products/r2/) which uses an "S3-compatible API".
In the terraform debug and in the cloudflare webUI the http post of the "wpad.dat" file to the cloudflare r2 bucket succeeds, but it looks like the http response to the terraform provider contains all or part of the content of the "wpad.dat" file containing a character which breaks the response. It attempts 25 times before we either have to cancel the pipeline or it times out.
If we use a another test file with only the text "helloworld" in it this works perfectly every time.
Expected Behavior
Process to complete for "wpdat.dat" file just like it does with our "helloworld" file.
Current Behavior
This is a portion of the debug showing the break, I cannot share the "wpad.dat" publicly due to sensitive contents but the error does relate to portions of its contents eg: & (no semicolon), etc.,
Reproduction Steps
This is the terraform code,
Possible Solution
Maybe dont include contents of the file in the http response?
Additional Information/Context
Similar outcomes in this issue with the http response #4577 but different things leading to it
SDK version used
aws_v4.20.1_x5
Environment details (Version of Go (
go version
)? OS name and version, etc.)terraform v1.3.7
The text was updated successfully, but these errors were encountered: