{
  "id": "policy/gcp-resource-manager-api-not-enabled",
  "signature": "Error: Error creating resource: google_project_service: googleapi: Error 403: Cloud Resource Manager API has not been used in project 'my-project' before or it is disabled.",
  "signature_zh": "错误：创建资源时出错：google_project_service：googleapi：错误 403：Cloud Resource Manager API 之前未在项目 'my-project' 中使用或已禁用。",
  "regex": "Cloud Resource Manager API has not been used in project.*before or it is disabled",
  "domain": "policy",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The Google Cloud project does not have the Cloud Resource Manager API enabled, which is required to manage project-level resources like IAM policies and service accounts via Terraform or gcloud.",
  "root_cause_type": "generic",
  "root_cause_zh": "Google Cloud 项目未启用 Cloud Resource Manager API，这是通过 Terraform 或 gcloud 管理项目级资源（如 IAM 策略和服务账户）所必需的。",
  "versions": [
    {
      "version": "Google Cloud SDK 400+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform Google Provider 4.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Re-authenticate with gcloud auth login to refresh credentials",
      "why_fails": "The error is not about authentication but about the API not being enabled; re-login does not enable APIs.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a different service account or user account to run the command",
      "why_fails": "The API disablement is project-wide; all accounts in the project face the same issue until the API is enabled.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set the project ID in gcloud config and retry without enabling the API",
      "why_fails": "The API must be explicitly enabled; setting the project ID only changes the target project but does not enable the API.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Enable the Cloud Resource Manager API via gcloud: gcloud services enable cloudresourcemanager.googleapis.com --project=my-project",
      "success_rate": 0.95,
      "how": "Enable the Cloud Resource Manager API via gcloud: gcloud services enable cloudresourcemanager.googleapis.com --project=my-project",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable the API via the Google Cloud Console: go to APIs & Services > Library, search for 'Cloud Resource Manager API', and click Enable.",
      "success_rate": 0.9,
      "how": "Enable the API via the Google Cloud Console: go to APIs & Services > Library, search for 'Cloud Resource Manager API', and click Enable.",
      "condition": "",
      "sources": []
    },
    {
      "action": "In Terraform, add a google_project_service resource to enable the API before creating other resources: resource \"google_project_service\" \"crm\" { project = \"my-project\" service = \"cloudresourcemanager.googleapis.com\" }",
      "success_rate": 0.95,
      "how": "In Terraform, add a google_project_service resource to enable the API before creating other resources: resource \"google_project_service\" \"crm\" { project = \"my-project\" service = \"cloudresourcemanager.googleapis.com\" }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过 gcloud 启用 Cloud Resource Manager API：gcloud services enable cloudresourcemanager.googleapis.com --project=my-project",
    "通过 Google Cloud 控制台启用 API：转到 APIs & Services > Library，搜索 'Cloud Resource Manager API'，然后点击启用。",
    "在 Terraform 中，添加 google_project_service 资源以在创建其他资源之前启用 API：resource \"google_project_service\" \"crm\" { project = \"my-project\" service = \"cloudresourcemanager.googleapis.com\" }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/resource-manager/docs/creating-managing-projects",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-02-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}