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
Storage non-resumable uploads fail when used with @google-cloud/common 0.12.1. The error message is:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Sorry, we cannot connect to Cloud Services without a project ID. You may specify one with an environment variable named "GCLOUD_PROJECT". See https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/authentication for a detailed guide on creating an authenticated connection.
The error message is misleading. The code mistakenly assumes any error thrown util.makeAuthenticatedRequestFactory -> makeAuthenticatedRequest -> onAuthenticated is because of a missing project ID.
The bug that causes the error was introduced by #1990. hasOwnProperty is called on an object that does not have that function. An alternative implementation would be to call Object.hasOwnProperty.call(value, opt) instead of value.hasOwnProperty(opt).
This bug is still active. google-cloud-node version:"0.7.0", default storage.bucket('my-bucket').upload('file.txt') does not upload .Must explicitly add resumable flag for upload storage.bucket('my-bucket').upload('file.txt', { resumable: true }) .
This code works for me with @google-cloud/storage@0.7.0:
varstorage=require('@google-cloud/storage')()varbucket=storage.bucket('stephen-has-a-new-bucket')bucket.upload('package.json',console.log)// no error
Can you make sure you rm -rf node_modules && npm install --save @google-cloud/storage@^0.7.0 and let me know if it persists? If you can, a reproducible test gist that I can clone, install, and run to see the crash would help.
Activity
stephenplusplus commentedon Mar 6, 2017
Thank you for catching this and debugging it! I just put through a fix: a1edaab -- does this look good?
andrewolobo commentedon Mar 13, 2017
This bug is still active. google-cloud-node version:"0.7.0", default storage.bucket('my-bucket').upload('file.txt') does not upload .Must explicitly add resumable flag for upload storage.bucket('my-bucket').upload('file.txt', { resumable: true }) .
stephenplusplus commentedon Mar 14, 2017
This code works for me with
@google-cloud/storage@0.7.0:Can you make sure you
rm -rf node_modules && npm install --save @google-cloud/storage@^0.7.0and let me know if it persists? If you can, a reproducible test gist that I can clone, install, and run to see the crash would help.build: update gapic generator to allow individual location mixin gene…
chore(main): release 6.4.2 (#2050)
chore(spanner): regenerate proto files (#2050)
chore: update NodeJS post-processor to use MOSS approved images and u…
core: (util) correct object recursion during projectId insertion
chore(deps): upgrade sinon to 21 (#2050)
feat: X509 cert authentication (#2055)
chore(main): release 6.4.2 (googleapis#2050)