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

[Bug]: Unmarshal Response s3/GetObjectTagging failed, attempt 11/25, error SerializationError: failed to decode REST XML response #29207

Open
mattduguid opened this issue Feb 2, 2023 · 1 comment
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service. upstream Addresses functionality related to the cloud provider.

Comments

@mattduguid
Copy link

mattduguid commented Feb 2, 2023

Terraform Core Version

1.3.7

AWS Provider Version

aws_v4.20.1_x5

Affected Resource(s)

aws_s3_bucket
aws_s3_object

Expected Behavior

Our "wpad.dat" file should upload as our "helloworld.txt" file does.

Actual Behavior

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.

Relevant Error/Panic Output Snippet

N/A

Terraform Configuration Files

resource "aws_s3_bucket" "cf" {
  bucket = var.cloudflare_r2_bucket_name
}

resource "aws_s3_object" "cf" {
  bucket = var.cloudflare_r2_bucket_name
  key = var.cloudflare_r2_filename
  source = var.cloudflare_r2_filename
  etag = filemd5(var.cloudflare_r2_filename)
}

Steps to Reproduce

terraform apply using the wpad.dat will cause the problem.

Debug Output

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.,

2023-01-30T21:12:09.4704619Z 2023-01-30T21:12:09.467Z [DEBUG] provider.terraform-provider-aws_v4.20.1_x5: [aws-sdk-go] DEBUG: Unmarshal Response s3/GetObjectTagging failed, attempt 11/25, error SerializationError: failed to decode REST XML response
2023-01-30T21:12:09.4705833Z 	status code: 200, request id: 
2023-01-30T21:12:09.4706541Z caused by: XML syntax error on line 21: invalid character entity & (no semicolon): timestamp=2023-01-30T21:12:09.467Z
2023-01-30T21:13:18.2283423Z ##[error]The operation was canceled.
2023-01-30T21:13:18.2306387Z ##[section]Finishing: Terraform configuration

Panic Output

N/A

Important Factoids

We think the solution is to not include the contents of the file in the http response.

References

We had previously logged this here aws/aws-sdk-go#4709 and there are some similar feedbacks about the possible solution in the comments

Would you like to implement a fix?

No

@mattduguid mattduguid added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Feb 2, 2023
@github-actions
Copy link

github-actions bot commented Feb 2, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/s3 Issues and PRs that pertain to the s3 service. label Feb 2, 2023
@justinretzolk justinretzolk added upstream Addresses functionality related to the cloud provider. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

No branches or pull requests

2 participants