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
{{ message }}
Repository navigation
The downloaded data did not match the data from the server #654
@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:
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?
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?
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:
shut off the auto-decoding for all downloads (don't think we want this),
ignore the hash mismatch if we see the file was gzip'd in the response headers,
branch off from the request download stream, and run the calculation on the native http.IncomingMessageresponse stream (which won't do the decoding)
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).
Activity
beshkenadze commentedon Jul 18, 2015
:(
jgeewax commentedon Jul 18, 2015
Any thougths @stephenplusplus ?
stephenplusplus commentedon Jul 19, 2015
@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:
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:
beshkenadze commentedon Jul 20, 2015
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?
jgeewax commentedon Jul 20, 2015
Not sure I understand the question @beshkenadze ...
To give some background (sorry if you already know this, just adding for context):
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-hashwhen youGETthe files from GCS?/cc @stephenplusplus
beshkenadze commentedon Jul 20, 2015
Now find the real file and will try to show an example.
stephenplusplus commentedon Jul 20, 2015
That's what this will do:
beshkenadze commentedon Jul 20, 2015
@stephenplusplus version ("version": "0.8.1") to old :)
stephenplusplus commentedon Jul 20, 2015
That branch (spp--654) is tracking master: https://github.com/stephenplusplus/gcloud-node/tree/spp--654
beshkenadze commentedon Jul 20, 2015
I used request-debug and got this:
stephenplusplus commentedon Jul 20, 2015
Nice :) Using my branch will show the hashes that are being built locally as well.
beshkenadze commentedon Jul 20, 2015
@stephenplusplus ;)
stephenplusplus commentedon Jul 20, 2015
Those don't match even a little bit! Like you pointed out @beshkenadze, I think we're running into issues because
requestautomatically 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:requestdownload stream, and run the calculation on the nativehttp.IncomingMessageresponsestream (which won't do the decoding)jgeewax commentedon Jul 20, 2015
37 remaining items
feat: Support listDocuments()/listCollections() via the Firestore Emu…
feat: introduce v4 signed url (#637)
feat: Add high precision Picosecond timestamp support for write calls (…
fix: add hashes to requirements.txt (#1544) (#654)
fix(docs): link to reference docs section on googleapis.dev (#654)
fix(deps): TypeScript 3.7.0 causes breaking change in typings (#654)
build: enable noImplicitAny in the tsconfig (#654)
chore(deps): update dependency @types/sinon to v10 (#654)
chore(deps): update dependency gts to v6 (#654)
chore: bump deps (#654)
feat: introduce v4 signed url (googleapis#637)
fix: cluster id store as undefined in createInstance request (#654)
fix: cluster id store as undefined in createInstance request (#654)
fix: cluster id store as undefined in createInstance request (#654)
fix: cluster id store as undefined in createInstance request (googlea…