{
  "id": "go/build-cache-invalid",
  "signature": "go: error obtaining build cache: open /root/.cache/go-build/log.txt: permission denied",
  "signature_zh": "go: 获取构建缓存时出错: 无法打开 /root/.cache/go-build/log.txt: 权限被拒绝",
  "regex": "go:\\ error\\ obtaining\\ build\\ cache:\\ open\\ /root/\\.cache/go\\-build/log\\.txt:\\ permission\\ denied",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The build cache directory is owned by a different user or has incorrect permissions, preventing writing.",
  "root_cause_type": "generic",
  "root_cause_zh": "构建缓存目录被其他用户拥有或权限不正确，阻止了写入操作。",
  "versions": [
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Running 'go clean -cache' to clear cache.",
      "why_fails": "The command fails because it cannot access the cache to remove it.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting GOCACHE to a different path without creating it.",
      "why_fails": "Go won't automatically create the directory; it must exist with proper permissions.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Change ownership of the build cache directory to the current user.",
      "success_rate": 0.95,
      "how": "Run 'sudo chown -R $USER:$USER /root/.cache/go-build' (adjust path if needed).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set GOCACHE to a writable directory.",
      "success_rate": 0.9,
      "how": "Run 'export GOCACHE=$HOME/.cache/go-build' and ensure the directory exists: 'mkdir -p $GOCACHE'.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}