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).
Environment details
- OS: macOS, Linux
- Node.js version: 6.x
- npm version: 3.x
- google-cloud-node version: 0.47.0
Steps to reproduce
- require
google-cloud
storage.bucket('my-bucket').upload('file.txt', { resumable: false })
Storage non-resumable uploads fail when used with
@google-cloud/common0.12.1. The error message is:The error message is misleading. The code mistakenly assumes any error thrown
util.makeAuthenticatedRequestFactory -> makeAuthenticatedRequest -> onAuthenticatedis because of a missing project ID.The bug that causes the error was introduced by #1990.
hasOwnPropertyis called on an object that does not have that function. An alternative implementation would be to callObject.hasOwnProperty.call(value, opt)instead ofvalue.hasOwnProperty(opt).Environment details
Steps to reproduce
google-cloudstorage.bucket('my-bucket').upload('file.txt', { resumable: false })