"Cannot sign data without `client_email`" for getSignedUrl
See original GitHub issueI’m trying to get a signed url from a storage bucket, but am getting a signing error. I have permission to read from the bucket, and have been able to stream its contents fine.
Code:
...
const expires = new Date()
expires.setSeconds(expires.getSeconds() + 30)
const storage = new Storage({ projectId });
storage
.bucket(bucketName)
.file(`${directory}/${packageName}`)
.getSignedUrl({
expires,
action: 'read',
})
.then(url => {
res.send(url)
console.log(url)
})
.catch(console.log)
Error:
{ SigningError: Cannot sign data without `client_email`.
at /Users/pikelnys/Desktop/code/gcs-project/api/node_modules/@google-cloud/storage/src/file.js:1784:16
at Auth._signWithApi (/Users/pikelnys/Desktop/code/gcs-project/api/node_modules/google-auto-auth/index.js:331:7)
at getCredentials (/Users/pikelnys/Desktop/code/gcs-project/api/node_modules/google-auto-auth/index.js:316:14)
at googleAuthClient.getCredentials (/Users/pikelnys/Desktop/code/gcs-project/api/node_modules/google-auto-auth/index.js:194:9)
at /Users/pikelnys/Desktop/code/gcs-project/api/node_modules/google-auth-library/build/src/auth/googleauth.js:602:67
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) message: 'Cannot sign data without `client_email`.' }
Environment details
- OS: macOS 10.13.4
- Node.js version: 8.11.2
- npm version: 6.4.1
@google-cloud/storage
version: 1.7.0
Edit: I’m getting this in both a local environment (where I authenticate with gcloud auth application-default login
) and while the code is deployed to cloud functions.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Google cloud/firebase storage Error: Cannot sign data without ...
I was getting "Cannot sign data without client_email " error when running firebase emulators:start . I fixed it by setting up a service ......
Read more >SigningError: Cannot sign data without `client_email`
Solution. “SigningError: Cannot sign data without `client_email`” is published by Fredric Cliver.
Read more >Error: Cannot sign data without `client_email`. - Google Groups
I am running GAE Flexible environment that is set up to use the default service account which has the Editor Role.
Read more >Permissions issue when calling getSignedUrl from cloud ...
"Cannot sign data without client_email " for getSignedUrl. (I found a workaround in SO for the emulator error but it's really terrible and ......
Read more >Signed URLs | Cloud Storage - Google Cloud
Signed URLs contain authentication information in their query string, allowing users without credentials to perform specific actions on a resource.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Service account isn’t good for multi-stage environments and security. This should be reopened. You should be using the exposed environment that has the same values.
Is this possible to authenticate without a keyfile?