{
  "id": "cloud/gcp-cloud-run-cold-start-http-timeout",
  "signature": "HTTP 504 Deadline Exceeded: upstream request timeout after 60s while waiting for Cloud Run container to start",
  "signature_zh": "HTTP 504 截止时间超时：等待 Cloud Run 容器启动时上游请求超时 60 秒",
  "regex": "HTTP 504 Deadline Exceeded.*upstream request timeout",
  "domain": "cloud",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Cloud Run cold start latency exceeded the 60-second HTTP load balancer timeout because the container image is large or the application initialization is slow.",
  "root_cause_type": "generic",
  "root_cause_zh": "Cloud Run 冷启动延迟超过了 60 秒的 HTTP 负载均衡器超时，原因是容器镜像过大或应用程序初始化缓慢。",
  "versions": [
    {
      "version": "Cloud Run managed platform (gcloud CLI 450.0.0)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Cloud Run for Anthos 1.28",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Google Cloud SDK 450.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Larger resources do not reduce cold start time; they only affect runtime performance. Cold start is dominated by image download and app startup.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Startup CPU boost only helps during the startup probe period, not the initial HTTP request timeout. The 504 occurs before the probe even begins.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce container image size by using a slim base image (e.g., 'alpine' instead of 'ubuntu') and removing build dependencies. For Node.js apps, run 'npm prune --production' before building the image.",
      "success_rate": 0.75,
      "how": "Reduce container image size by using a slim base image (e.g., 'alpine' instead of 'ubuntu') and removing build dependencies. For Node.js apps, run 'npm prune --production' before building the image.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable min-instances for Cloud Run to keep at least one instance warm: 'gcloud run services update SERVICE --min-instances=1'. This eliminates cold starts for most requests.",
      "success_rate": 0.95,
      "how": "Enable min-instances for Cloud Run to keep at least one instance warm: 'gcloud run services update SERVICE --min-instances=1'. This eliminates cold starts for most requests.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Reduce container image size by using a slim base image (e.g., 'alpine' instead of 'ubuntu') and removing build dependencies. For Node.js apps, run 'npm prune --production' before building the image.",
    "Enable min-instances for Cloud Run to keep at least one instance warm: 'gcloud run services update SERVICE --min-instances=1'. This eliminates cold starts for most requests."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/run/docs/troubleshooting#504-deadline-exceeded",
  "official_doc_section": null,
  "error_code": "504",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2023-09-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}