question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Cannot sign data without `client_email`" for getSignedUrl

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

24reactions
ollydixoncommented, Nov 27, 2021

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.

21reactions
barocsicommented, May 10, 2019

Is this possible to authenticate without a keyfile?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found