{
  "id": "cloud/gcp-pubsub-subscription-pull-ack-deadline-exceeded",
  "signature": "DEADLINE_EXCEEDED: The deadline expired before the operation could complete. gRPC stream closed with status code 4",
  "signature_zh": "DEADLINE_EXCEEDED：操作在截止时间前未能完成。gRPC 流以状态码 4 关闭",
  "regex": "DEADLINE_EXCEEDED.*deadline expired.*gRPC stream.*status code 4",
  "domain": "cloud",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Pub/Sub subscriber's ack deadline is too short for message processing, causing the gRPC streaming pull to close after repeated deadline violations.",
  "root_cause_type": "generic",
  "root_cause_zh": "Pub/Sub 订阅者的确认截止时间太短，无法完成消息处理，导致 gRPC 流式拉取在多次截止时间违规后关闭。",
  "versions": [
    {
      "version": "gcloud_cli",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pubsub_api",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "client_library",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding more subscribers doesn't fix the ack deadline; each message still has the same processing time limit.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Synchronous pull has its own timeout issues and doesn't inherently increase ack deadline.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the ack deadline for the subscription: `gcloud pubsub subscriptions update my-sub --ack-deadline=600` (10 minutes). Ensure your message processing completes within this window.",
      "success_rate": 0.9,
      "how": "Increase the ack deadline for the subscription: `gcloud pubsub subscriptions update my-sub --ack-deadline=600` (10 minutes). Ensure your message processing completes within this window.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement a manual ack extension loop in your subscriber: after receiving a message, call `subscriber.modifyAckDeadline(message, 60)` every 30 seconds until processing is done, then ack. Example: `from google.cloud import pubsub_v1; subscriber.modify_ack_deadline(subscription, [message.ack_id], 60)`",
      "success_rate": 0.95,
      "how": "Implement a manual ack extension loop in your subscriber: after receiving a message, call `subscriber.modifyAckDeadline(message, 60)` every 30 seconds until processing is done, then ack. Example: `from google.cloud import pubsub_v1; subscriber.modify_ack_deadline(subscription, [message.ack_id], 60)`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the ack deadline for the subscription: `gcloud pubsub subscriptions update my-sub --ack-deadline=600` (10 minutes). Ensure your message processing completes within this window.",
    "Implement a manual ack extension loop in your subscriber: after receiving a message, call `subscriber.modifyAckDeadline(message, 60)` every 30 seconds until processing is done, then ack. Example: `from google.cloud import pubsub_v1; subscriber.modify_ack_deadline(subscription, [message.ack_id], 60)`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/pubsub/docs/pull#streamingpull",
  "official_doc_section": null,
  "error_code": "DEADLINE_EXCEEDED",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-02-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}