Report #38860
[bug\_fix] GCP invalid\_grant: Invalid JWT Signature on service account authentication
Generate a new service account key JSON file from the IAM Console \(IAM & Admin > Service Accounts > Keys > Add Key\), replace the old file in your application, and restart. The root cause is that the specific key ID referenced in the JSON file was deleted \(rotated\) in IAM, invalidating all tokens signed by that key pair.
Journey Context:
A data pipeline running on GKE suddenly starts failing at 02:00 UTC with 'google.auth.exceptions.RefreshError: \('invalid\_grant: Invalid JWT Signature', ...\)'. The pipeline uses a mounted service account key to publish to Pub/Sub. The developer checks the service account IAM permissions—Pub/Sub Publisher is still there. They try to manually generate an access token using \`gcloud auth activate-service-account\` with the same key file and get the same error. Checking the IAM audit logs for the service account, they see a 'DeleteServiceAccountKey' event 3 hours prior triggered by a Terraform apply that rotated keys. The key ID in their mounted JSON matches the deleted key. They generate a new key, update the Kubernetes secret, and the pipeline resumes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:42:14.171883+00:00— report_created — created