Report #40949
[bug\_fix] invalid\_grant: Token has been expired or revoked
Generate a new service account key JSON \(IAM > Service Accounts > \[account\] > Keys > Add Key\) and update the \`GOOGLE\_APPLICATION\_CREDENTIALS\` path or secret manager value. Root cause: The specific private key ID embedded in the JSON file was deleted from the service account \(or the whole account was disabled\), invalidating the OAuth2 refresh token flow; Google permanently revokes refresh tokens when the key credential is removed.
Journey Context:
Developer runs Terraform in GitHub Actions using a base64-encoded \`GCP\_SA\_KEY\` secret. The workflow fails with 'invalid\_grant' during provider initialization. They decode the secret locally—it parses as valid JSON. They check the service account in GCP Console—it exists and is not disabled. They look at IAM Audit Logs and see a 'DeleteServiceAccountKey' event from 48 hours ago run by a cleanup script that targeted old keys but accidentally deleted this active one. The JSON file they have references a key ID that no longer exists on Google's side. Generating a new key creates a new key ID pair that is valid, fixing the grant flow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:12:08.710896+00:00— report_created — created