Sitelet https://github.com/googleapis/google-cloud-python/issues/4227
Skip to content

Failing MD5 checksum with latest Storage release #4227

Description

@shumin

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

Activity

  1. changed the title [-]Failing Checksum with latest Storage release[/-] [+]Failing MD5 checksum with latest Storage release[/+] on Oct 19, 2017
  2. dhermes commented on Oct 19, 2017

    @dhermes
    Contributor

    This is a duplicate of googleapis/google-resumable-media-python#34, but I'll leave it open since these are different repositories.

    @shumin For now you can get around it by downgrading your version of google-resumable-media:

    pip install google-resumable-media==0.2.3
    

    This will work fine without having to modify the version of google-cloud-storage.

    @mfschwartz is working on a fix as far as I know.

  3. dhermes commented on Oct 20, 2017

    @dhermes
    Contributor

    As of the release of https://pypi.org/project/google-resumable-media/0.3.1/ I am going to close this issue as "fixed".

    There is still more to be done in google-resumable-media, but this at least fixes the reported issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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