You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"gzip: invalid header" comes from the gzip library when the headers are invalid/unexpected.
The "failed to decompress gzip response" string comes from this part of the SDK.
This pretty clearly indicates a mismatch between what the server is sending and how the SDK is attempting to parse the value. E.g. perhaps the server is sometimes responding without gzipping the response even though the SDK is always expecting it? maybe particular errors / small errors just don't get zipped by default?
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
I expected the SDK to be able to parse the response received from AWS/DDB regardless when accepting Gzip encoded data.
Current Behavior
Sometimes the gzip headers from AWS/DDB are invalid (most likely missing), and the SDK cannot handle the response because it unconditionally expects gzip encoding when EnableAcceptEncodingGzip is set to true.
Reproduction Steps
Unfortunately I do not know how to reliably reproduce this. I'm not sure when AWS/DDB might not be sending valid gzip headers. However, you must set EnableAcceptEncodingGzip to true.
Possible Solution
Supposing the headers are simply missing because the response is not compressed: In this file, gracefully handle gzip.ErrHeader and just read the bytes directly as non-compressed data.
Fix this on the DDB/Coral side so the response is always valid when gzip encoding is accepted.
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
We construct a client with
EnableAcceptEncodingGzip = true
and have occasionally been getting the following error:"gzip: invalid header" comes from the gzip library when the headers are invalid/unexpected.
The "failed to decompress gzip response" string comes from this part of the SDK.
This pretty clearly indicates a mismatch between what the server is sending and how the SDK is attempting to parse the value. E.g. perhaps the server is sometimes responding without gzipping the response even though the SDK is always expecting it? maybe particular errors / small errors just don't get zipped by default?
Regression Issue
Expected Behavior
I expected the SDK to be able to parse the response received from AWS/DDB regardless when accepting Gzip encoded data.
Current Behavior
Sometimes the gzip headers from AWS/DDB are invalid (most likely missing), and the SDK cannot handle the response because it unconditionally expects gzip encoding when
EnableAcceptEncodingGzip
is set to true.Reproduction Steps
Unfortunately I do not know how to reliably reproduce this. I'm not sure when AWS/DDB might not be sending valid gzip headers. However, you must set
EnableAcceptEncodingGzip to true
.Possible Solution
gzip.ErrHeader
and just read the bytes directly as non-compressed data.Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go1.23.1 darwin/arm64
Operating System and version
macOS 15.1.1
The text was updated successfully, but these errors were encountered: