mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 13:45:52 +03:00
[GH-ISSUE #1226] bug: invalid CRC computed #178
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hairyhenderson on GitHub (Jun 26, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1226
In previous versions of the GCS storage client (
cloud.google.com/go/storage, up to v1.29.0), there was a parsing bug that caused the client to skip CRC validation.However, in v1.30.0, a fix for that bug was released, and since then I've received this error while reading:
My hunch is the CRC calculation in
fsouza/fake-gcs-serveris incorrect (compared to how GCS does it); when the feature was added (https://github.com/fsouza/fake-gcs-server/pull/307), this comment in the description stands out:I think this wasn't a problem then, since the header wasn't used, but now that
cloud.google.com/go/storagehas fixed that bug this is now a problem!/cc @antonydenyer @fsouza
@hairyhenderson commented on GitHub (Jun 26, 2023):
I've done a bit more digging and it looks like the issue is due to compression - I'm gzip-compressing the object on upload, and when downloading the object Decompressive transcoding is occurring.
When trying to determine if the server uncompressed the content, the client expects there to be a
X-Goog-Stored-Content-Encodingheader set togzip, without aContent-Encodingheader set togzip:https://github.com/googleapis/google-cloud-go/blob/main/storage/reader.go#L135
It appears that
fake-gcs-serveris decompressing the content, but it is not setting theX-Goog-Stored-Content-Encodingheader. I think that's the root of this bug. I'll see if I can find a fix.