Skip to content

Failing MD5 checksum with latest Storage release #4227

Closed
@shumin

Description

Hey, not sure this directly related to this merged PR but after upgrading to latest storage release (1.5.0) all the download is keep failing and just throwing MD5 checksum exception.

My upload code:

blob = self.bucket.blob(filename)

with io.BytesIO() as f:
    with gzip.GzipFile(fileobj=f, mode='wb', compresslevel=9) as fgz:
        fgz.write(json.dumps(data).encode())
    blob.upload_from_file(f, size=f.tell(), rewind=True, content_type='application/json')

blob.cache_control = 'public, max-age=3600'
blob.content_encoding = 'gzip'
blob.patch()
blob.make_public()

Download code:

blob = self.bucket.get_blob(filename)
data = blob.download_as_string()

It all works with previous version but now throws exception in download_as_string() with message like this:

The X-Goog-Hash header indicated an MD5 checksum of:
  60oRCFTCzLBifVMH18gi4A==

but the actual MD5 checksum of the downloaded contents was:
  OrNQk+VCLH29Nlsbwn4BIA==

Is there anything can be done to resolve this issue?

Thanks

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions