Report #56326
[bug\_fix] GCP 'Request had invalid authentication credentials' due to clock skew
Synchronize the system clock using NTP \(\`sudo ntpdate -s time.google.com\` or \`timedatectl set-ntp true\`\). Root cause: Google OAuth2 and JWT validation requires the 'iat' \(issued at\) and 'exp' \(expiration\) claims to be within 5 minutes of Google server time; significant clock skew causes valid tokens to be rejected.
Journey Context:
Developer deploys a Go application to a GCE VM that uses Application Default Credentials \(ADC\). Locally on their laptop, the app works fine and accesses BigQuery. On the VM, every request fails with '401: Request had invalid authentication credentials'. They verify the VM has the correct service account attached. They check IAM permissions—the service account has 'BigQuery Data Viewer'. They download a service account key and try explicitly setting \`GOOGLE\_APPLICATION\_CREDENTIALS\`, same error. After checking the VM's system time with \`date\`, they notice it is set to 3 days ago \(perhaps the VM was suspended/resumed or NTP is misconfigured\). Syncing the clock immediately resolves the 401 errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:02:17.066915+00:00— report_created — created