-
Notifications
You must be signed in to change notification settings - Fork 19
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
System.IO.InvalidDataException on TransactWrite #259
Comments
@firenero, maybe you can take a look on the error? |
@alexey62soft Seems like something is wrong with gzip decompression during DDB error processing. As you noticed, we use automatic decompression so getting an error there is unusual. But since setting AutomaticDecompressions to None there is definitely something wrong with compression. There are several things we can do to troubleshoot it:
|
@firenero First of all, thank you for your response, and sorry for the delay!
I used the query operation that has the response with "Content-Length: 29896 bytes" when "AutomaticDecompression = DecompressionMethods.None". With "AutomaticDecompression = DecompressionMethods.GZip", I still received a successful response with "Content-Length: 1143 bytes" and "Content-Encoding: gzip". No errors - everything was processed correctly.
I realized that issue just a couple of days ago, but can't prove the issue itself appears recently. Anyway I can notice consistent behavior - it always failed on error responses with large "Content-Length" - I used the "ReturnValuesOnConditionCheckFailure.AllOld" setting for transaction items in the code.
Yes, I was able to reproduce that locally using different configurations. I assume the reason of the error - AWS API request compression support. In particular, AWS DynamoDB API does not compress error responses (we are having same Content-Length) but provides different checksum (CRC32). AutomaticDecompression - DecompressionMethods.NoneResponse.RequestMessage.Headers:
Response.Headers:
Response.Content.Type: System.Net.Http.HttpConnectionResponseContent Response.Content.Headers:
Response.Stream: System.Net.Http.HttpConnection.ContentLengthReadStream Result: Processing is fine. The library was able to process the BadRequest error response. AutomaticDecompression = DecompressionMethods.GZipResponse.Request.Headers:
Response.Headers:
Response.Content.Type: System.Net.Http.DecompressionHandler.GZipDecompressedContent Response.Content.Headers:
Response.Content.OriginalContent.Headers:
Response.Stream: System.IO.Compression.GZipStream Result: Processing was failed with System.IO.InvalidDataException provided in the issue description. The library was NOT able to process the BadRequest error response. AutomaticDecompression = DecompressionMethods.None, but Accept-Encoding = gzip (manually provided on the request in EfficientDynamoDb.Internal.HttpApi)Response.RequestMessage.Headers:
Response.Headers:
Response.Content.Type: System.Net.Http.HttpConnectionResponseContent Response.Content.Headers:
Response.Stream: System.Net.Http.HttpConnection.ContentLengthReadStream Result: Processing is fine. The library processed the BadRequest error response without additional decompression. |
Hello everyone!
I'm using EfficienDynamoDb v0.9.16 (runtime - .NET 6) like that:
And recently I started receive the following error is DynamoDB responds with error:
Can you help me understand the reason for the error? Is that associated with the library itself?
Update: setting DecompressionMethods.None here resolves the problem.
The text was updated successfully, but these errors were encountered: