Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial CRC-32C is not an integer #883

Closed
m-spyratos opened this issue Oct 15, 2019 · 9 comments · Fixed by #884
Closed

Initial CRC-32C is not an integer #883

m-spyratos opened this issue Oct 15, 2019 · 9 comments · Fixed by #884
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@m-spyratos
Copy link

Environment details

  • OS: MacOS Mojave 10.14.6
  • Node.js version: 10.16.3
  • npm version: 6.9.0
  • @google-cloud/storage version: 3.4.0
  • fast-crc32c version: 2.0.0

Steps to reproduce

  1. Install latest @google-cloud/storage (version above)
  2. Install latest fast-crc32c (version above)
  3. Try to upload a file to a bucket using file.save().

This is an example of my actual upload code:

await myBucket
    .file('myFile')
    .save(Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', 'base64'), {
        public: true
    });

Expected:

To save the file to provided bucket.

Actual:

Fails with Error: Initial CRC-32C is not an integer!
Same happens with setting resumable option: resumable: false.

@bcoe bcoe added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Oct 15, 2019
@jkwlui jkwlui assigned stephenplusplus and unassigned crwilcox and jkwlui Oct 15, 2019
@stephenplusplus
Copy link
Contributor

Thanks for reporting! Could you run a quick npm ls | grep "hash-stream-validation"?

@m-spyratos
Copy link
Author

Sure!

│ ├─┬ hash-stream-validation@0.2.1
│ │ ├── hash-stream-validation@0.2.1 deduped

@stephenplusplus
Copy link
Contributor

Thank you! That's one patch away from the latest version, 0.2.2. Would you do a rm -rf node_modules && npm install to see if you pick that up? If not, you should be able to just manually install it.

In any case, if you're able to try that version and the problem goes away, we can bump our dependency from this library as the final fix. 🤞

@m-spyratos
Copy link
Author

Ok I just noticed that firebase-admin uses hash-stream-validation and doesn't use the ^:

"hash-stream-validation": "0.2.1"

I guess this is what causes the issue?
Let me try quickly and I'll get back to you.

@m-spyratos
Copy link
Author

Upgraded firebase-admin to latest which doesn't even include a hash-stream-validation version. Now only @google-cloud/storage loads it, but still the version shows up as 0.2.1 for some reason.

@m-spyratos
Copy link
Author

I manually installed hash-stream-validation v0.2.2 and I can confirm now it works fine.
Bumping the dependency would be great!

@stephenplusplus
Copy link
Contributor

Well that's good news! PR sent: #884 -- I'll let you know when it ships to a release so you can remove your manual override.

@m-spyratos
Copy link
Author

Thank you @stephenplusplus !

@stephenplusplus
Copy link
Contributor

@m-spyratos @google-cloud/storage@4.0.0 is out with this fix!

@google-cloud-label-sync google-cloud-label-sync bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants