{
  "id": "cloud/gcp-service-account-key-rotation-failed",
  "signature": "Error: service account key has expired or rotation failed",
  "signature_zh": "错误：服务账号密钥已过期或轮换失败",
  "regex": "Error: service account key has expired|rotation failed",
  "domain": "cloud",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "GCP service account key rotation policy failed due to missing permissions or stale key metadata in IAM.",
  "root_cause_type": "generic",
  "root_cause_zh": "GCP服务账号密钥轮换策略因权限不足或IAM中的密钥元数据过时而失败。",
  "versions": [
    {
      "version": "gcloud 450.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "GCP IAM API v1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Deleting without updating the service account's IAM policy can break existing integrations; rotation policy still references old key.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling a service account does not rotate keys; it only suspends access until re-enabled, leaving expired keys intact.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Extending the rotation period delays the problem but does not fix the underlying failure to rotate; keys still expire eventually.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use gcloud to manually rotate the key: `gcloud iam service-accounts keys rotate --service-account=SA_EMAIL --old-key-from-file=old_key.json --new-key-from-file=new_key.json`",
      "success_rate": 0.85,
      "how": "Use gcloud to manually rotate the key: `gcloud iam service-accounts keys rotate --service-account=SA_EMAIL --old-key-from-file=old_key.json --new-key-from-file=new_key.json`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Grant the `iam.serviceAccountKeys.create` and `iam.serviceAccountKeys.delete` roles to the service account, then trigger rotation via Cloud Scheduler",
      "success_rate": 0.9,
      "how": "Grant the `iam.serviceAccountKeys.create` and `iam.serviceAccountKeys.delete` roles to the service account, then trigger rotation via Cloud Scheduler",
      "condition": "",
      "sources": []
    },
    {
      "action": "Temporarily disable automated rotation and use a static key with a long expiry, then re-enable rotation after debugging",
      "success_rate": 0.75,
      "how": "Temporarily disable automated rotation and use a static key with a long expiry, then re-enable rotation after debugging",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use gcloud to manually rotate the key: `gcloud iam service-accounts keys rotate --service-account=SA_EMAIL --old-key-from-file=old_key.json --new-key-from-file=new_key.json`",
    "Grant the `iam.serviceAccountKeys.create` and `iam.serviceAccountKeys.delete` roles to the service account, then trigger rotation via Cloud Scheduler",
    "Temporarily disable automated rotation and use a static key with a long expiry, then re-enable rotation after debugging"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/iam/docs/creating-managing-service-account-keys#rotating",
  "official_doc_section": null,
  "error_code": "IAM-403",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "partial",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}