GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — The downloaded data did not match the data from the server · Issue #654 · googleapis/google-cloud-node

The downloaded data did not match the data from the server #654

New issue
Copy link
New issue
Copy link
Closed
#745
Closed
The downloaded data did not match the data from the server#654
#745
Copy link
Assignees
stephenplusplus
Labels
api: storageIssues related to the Cloud Storage API.

Description

@beshkenadze
beshkenadze
opened on Jun 10, 2015
Issue body actions

Hey,
Any files that I get from the bucket "pubsite_prod_rev_", gets error code: CONTENT_DOWNLOAD_MISMATCH.

bucket.file("reviews/reviews_com.sample.android_201409.csv").download({
  destination: './reviews.cvs'
},
function(err, content){
  console.log(err.code);//CONTENT_DOWNLOAD_MISMATCH
});

Activity

Next
  1. jgeewax
    added
    api: storageIssues related to the Cloud Storage API.
    on Jun 10, 2015
  2. beshkenadze commented on Jul 18, 2015

    @beshkenadze
    beshkenadze
    on Jul 18, 2015
    Author
    More actions

    :(

  3. jgeewax commented on Jul 18, 2015

    @jgeewax
    jgeewax
    on Jul 18, 2015
    Contributor
    More actions

    Any thougths @stephenplusplus ?

  4. stephenplusplus commented on Jul 19, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 19, 2015
    Contributor
    More actions

    @beshkenadze sorry that it's taken so long to get on this. It's hard to say what could be causing this or if it's related to #651.

    The error is being returned because either an MD5 or CRC32c validation check isn't passing. In other words, the data you've received isn't matching the data that's stored in the bucket. You can workaround this by disabling validation:

    bucket.file("reviews/reviews_com.sample.android_201409.csv").download({
      destination: './reviews.cvs',
      validation: false
    },
    function(err, content){
      // No more mismatch error (hopefully)
    });

    If you want to do some debugging, I put up a branch you can swap out your gcloud dependency for. It will just do a little console.log-ing to help see what's going on:

    $ npm install --save stephenplusplus/gcloud-node#spp--654
    Reacted by Ilya Radchenko, DavidQueruel, Daniel Lewis BSc (Hons) and Sondre Sørbye
    Reacted by Arnas, Daniel Lewis BSc (Hons), Dev.Tutd and Ivan Coene
  5. beshkenadze commented on Jul 20, 2015

    @beshkenadze
    beshkenadze
    on Jul 20, 2015
    Author
    More actions

    Hey @stephenplusplus,
    How is getting of the hash from a local file?
    Play Сloud gives files compressed in GZ format.
    Possible hashes are calculated from the extracted file?

  6. jgeewax commented on Jul 20, 2015

    @jgeewax
    jgeewax
    on Jul 20, 2015
    Contributor
    More actions

    Not sure I understand the question @beshkenadze ...

    To give some background (sorry if you already know this, just adding for context):

    • Play is uploading files to a bucket that they own
    • Play then shares access to the bucket with your Google account (not your project's service accounts)
    • When you download a file, gcloud-node does some validation to make sure that the data wasn't tampered with along the way (see https://github.com/GoogleCloudPlatform/gcloud-node/blob/d4d3d06b466834fd8a19771e75ff5cd9f89013fa/lib/storage/file.js#L491)
    • If the validation fails (ie, MD5 or CRC32 don't match what the file should have), we raise the error you're seeing (see https://github.com/GoogleCloudPlatform/gcloud-node/blob/d4d3d06b466834fd8a19771e75ff5cd9f89013fa/lib/storage/file.js#L548)

    I don't see anything that would indicate that we're looking at the uncompressed file, as we're treating the data as nothing more than bytes and ignoring the file type all together.

    It could be possible that Play (when uploading the data) is somehow bypassing the part where they set the CRC32 and MD5 hash for the file (which would cause this error to happen on all Play-uploaded files). Could you tell us what you get back in the headers that start with x-goog-hash when you GET the files from GCS?

    /cc @stephenplusplus

  7. beshkenadze commented on Jul 20, 2015

    @beshkenadze
    beshkenadze
    on Jul 20, 2015
    Author
    More actions

    Now find the real file and will try to show an example.

  8. stephenplusplus commented on Jul 20, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 20, 2015
    Contributor
    More actions

    Could you tell us what you get back in the headers that start with x-goog-hash when you GET the files from GCS?

    That's what this will do:

    $ npm install --save stephenplusplus/gcloud-node#spp--654
  9. beshkenadze commented on Jul 20, 2015

    @beshkenadze
    beshkenadze
    on Jul 20, 2015
    Author
    More actions

    @stephenplusplus version ("version": "0.8.1") to old :)

  10. stephenplusplus commented on Jul 20, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 20, 2015
    Contributor
    More actions

    That branch (spp--654) is tracking master: https://github.com/stephenplusplus/gcloud-node/tree/spp--654

  11. beshkenadze commented on Jul 20, 2015

    @beshkenadze
    beshkenadze
    on Jul 20, 2015
    Author
    More actions

    I used request-debug and got this:

    {
      response: {
        debugId: 1,
        headers: {
          'x-guploader-uploadid': 'XXXX',
          expires: 'Mon, 20 Jul 2015 13:40:35 GMT',
          date: 'Mon, 20 Jul 2015 13:40:35 GMT',
          'cache-control': 'private, max-age=0',
          'last-modified': 'Sun, 19 Jul 2015 18:53:59 GMT',
          etag: 'W/"XXXX"',
          'x-goog-generation': '1437332039288000',
          'x-goog-metageneration': '1',
          'x-goog-stored-content-encoding': 'gzip',
          'x-goog-stored-content-length': '5939',
          'content-type': 'text/csv; charset=utf-16le',
          'x-goog-hash': 'crc32c=66rJzQ==, md5=2T/NKanU9vTItoiF7+tMAA==',
          'x-goog-storage-class': 'STANDARD',
          vary: 'Accept-Encoding',
          'content-length': '24148',
          server: 'UploadServer',
          'alternate-protocol': '443:quic,p=1',
          connection: 'close'
        },
        statusCode: 200
      }
    }
  12. stephenplusplus commented on Jul 20, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 20, 2015
    Contributor
    More actions

    Nice :) Using my branch will show the hashes that are being built locally as well.

  13. beshkenadze commented on Jul 20, 2015

    @beshkenadze
    beshkenadze
    on Jul 20, 2015
    Author
    More actions

    @stephenplusplus ;)

    Headers: { 'x-guploader-uploadid': 'XXXX',
      expires: 'Mon, 20 Jul 2015 13:46:35 GMT',
      date: 'Mon, 20 Jul 2015 13:46:35 GMT',
      'cache-control': 'private, max-age=0',
      'last-modified': 'Sun, 19 Jul 2015 18:53:59 GMT',
      etag: 'W/"XXXX"',
      'x-goog-generation': '1437332039288000',
      'x-goog-metageneration': '1',
      'x-goog-stored-content-encoding': 'gzip',
      'x-goog-stored-content-length': '5939',
      'content-type': 'text/csv; charset=utf-16le',
      'x-goog-hash': 'crc32c=66rJzQ==, md5=2T/NKanU9vTItoiF7+tMAA==',
      'x-goog-storage-class': 'STANDARD',
      vary: 'Accept-Encoding',
      'content-length': '24148',
      server: 'UploadServer',
      'alternate-protocol': '443:quic,p=1',
      connection: 'close' }
    
    Local CRC32c Hash: Fw==
    Local MD5 Hash: Hwt6cw9joXTy4EOtQqh0pg==
    crypto.js:126
      return this._handle.digest(outputEncoding);
                          ^
    Error: Not initialized
        at Error (native)
  14. stephenplusplus commented on Jul 20, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 20, 2015
    Contributor
    More actions

    Those don't match even a little bit! Like you pointed out @beshkenadze, I think we're running into issues because request automatically decodes the file as it's being downloaded, resulting in different hashes. I can't think of a great solution immediately for how we can work around this, other than:

    1. shut off the auto-decoding for all downloads (don't think we want this),
    2. ignore the hash mismatch if we see the file was gzip'd in the response headers,
    3. branch off from the request download stream, and run the calculation on the native http.IncomingMessage response stream (which won't do the decoding)
  15. jgeewax commented on Jul 20, 2015

    @jgeewax
    jgeewax
    on Jul 20, 2015 via email
    Contributor
    More actions
    Can we run a quick test of uploading a zipped file, and seeing that the verification fails ? I'd feel much more confident if this was happening on a non-magic bucket (the one in question here is actually owned by Google Play, so it might be doing something wonky).
  16. 37 remaining items

  17. sofisl
    added 2 commits that reference this issue on Feb 24, 2026

    feat: Support listDocuments()/listCollections() via the Firestore Emu…

    2b598a4

    feat: introduce v4 signed url (#637)

    5923ddf
  18. GautamSharda
    added 2 commits that reference this issue on Feb 25, 2026

    feat: Add high precision Picosecond timestamp support for write calls (…

    4add7d8

    fix: add hashes to requirements.txt (#1544) (#654)

    f9d30c4
  19. sofisl
    added a commit that references this issue on Feb 26, 2026

    fix(docs): link to reference docs section on googleapis.dev (#654)

    7f678a5
  20. GautamSharda
    added 3 commits that reference this issue on Mar 5, 2026

    fix(deps): TypeScript 3.7.0 causes breaking change in typings (#654)

    ad4167d

    build: enable noImplicitAny in the tsconfig (#654)

    095d978

    chore(deps): update dependency @types/sinon to v10 (#654)

    21e22c0
  21. sofisl
    added 2 commits that reference this issue on Mar 17, 2026

    chore(deps): update dependency gts to v6 (#654)

    159d0df

    chore: bump deps (#654)

    2728191
  22. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    feat: introduce v4 signed url (googleapis#637)

    424f657
  23. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    fix: cluster id store as undefined in createInstance request (#654)

    da11eb9

    fix: cluster id store as undefined in createInstance request (#654)

    d345f22
  24. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    fix: cluster id store as undefined in createInstance request (#654)

    c963bb1
  25. thiyaguk09
    added a commit that references this issue on May 5, 2026

    fix: cluster id store as undefined in createInstance request (googlea…

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

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.