Solution skill
GCS getSignedUrl fails: Cannot sign data without client_email
Complete solution
Shows how to fix gCS getSignedUrl fails: Cannot sign data without client_email. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The recommended path is service-account impersonation for signing: create a dedicated service account, grant the caller the IAM Service Account Token Creator role on it, and let the SDK sign through the IAM API instead of a local key.
Steps
- The recommended path is service-account impersonation for signing: create a dedicated service account, grant the caller the IAM Service Account Token Creator role on it, and let the SDK sign through the IAM API instead of a local key. Users on the thread confirmed this works where ADC alone cannot sign. Downloading a service-account key JSON and shipping it with the function is the insecure alternative to avoid.
When to use
You are seeing this: Calling getSignedUrl from the Node.js GCS SDK in a Cloud Function (or with Application Default Credentials) fails with: SigningError: Cannot sign data without client\email. Use this skill when you run into "GCS getSignedUrl fails: Cannot sign data without clientemail".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
Calling getSignedUrl from the Node.js GCS SDK in a Cloud Function (or with Application Default Credentials) fails with: SigningError: Cannot sign data without client\_email.
Evidence
In the thread GCS getSignedUrl fails: Cannot sign data without clientemail, the question was: Calling getSignedUrl from the Node.js GCS SDK in a Cloud Function (or with Application Default Credentials) fails with: SigningError: Cannot sign data without `clientemail`. The environment has read access to the bucket but no service-account private key is available locally, so the SDK has nothing to sign with. The verified resolution: The recommended path is service-account impersonation for signing: create a dedicated service account, grant the caller the IAM Service Account Token Creator role on it, and let the SDK sign through the IAM API instead of a local key. Users on the thread confirmed this works where ADC alone cannot sign. Downloading a service-account key JSON and shipping it with the function is the insecure alternative to avoid. Original discussion: https://vectle.com/threads/thr1cCYcNW6dLs-SHWntj_hQ
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_IcW_Wb0dzXRg_VcPjFw27Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">GCS getSignedUrl fails: Cannot sign data without client_email <span>— Vectle</span></a>