Repository navigation
gcloud writestreams no longer working when piping stdout from GraphicsMagick #889
Description
Activity
Thanks! I'll look into this right away.
I was able to use the same code and get the file to upload successfully.
finishwon't emit becauseerrordoes, and it's an error because somehow, the hash of the bytes that were sent upstream aren't matching what the API says it received.To get around this, you can turn off validation, or limit it to a specific type. Playing with these options might help debugging where the problem is happening.
To do that:
// Turn off all data integrity checks var wr = dst.createWriteStream({ validation: false }); // Use just md5 var wr = dst.createWriteStream({ validation: 'md5' }); // Use just crc32c var wr = dst.createWriteStream({ validation: 'crc32c' });
If you try this, please let me know which worked (if any), and confirm that the file that ended up in the bucket is properly formed.
this seems odd but->
validation: false (fails)
validation: true (succeeds)
validation: 'md5' (succeeds)
validation: 'crc32c' (succeeds)I think I caught the bug, though I'm not sure why it
failedsucceeded when you explicitly providedvalidation: true, as that's what is defaulted.Can you try out my patch branch to see if it works:
$ npm install --save stephenplusplus/gcloud-node#spp--storage-stream-fix
I can see why it would have failed when validation is set to false, but like you said the validation default is true when you don't specify... (and why would the stdout stream from GraphicsMagick make any difference?) ANYWAY... this fix works ;-)
Yeah, weird. Well, PR coming soon after I write some tests. Thanks for letting us know about this issue!
- added a commit that references this issue
on Jan 17, 2023 - added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Mar 11, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
GraphicsMagick lib:
http://aheckmann.github.io/gm/
ex:
works in release 20 and older(using complete event); breaks in release 21, finish doesn't seem to trigger, error is fired with->
{ [Error: The uploaded data did not match the data from the server. As a precaution, the file has been deleted. To be sure the content is the same, you should try uploading the file again.] code: 'FILE_NO_UPLOAD', errors: [ null ] }