{
  "id": "aws/ec2-ebs-volume-stuck-attaching",
  "signature": "An error occurred (VolumeInUse) when calling the AttachVolume operation: Volume is already attached to an instance",
  "signature_zh": "调用 AttachVolume 操作时发生错误 (VolumeInUse)：卷已附加到实例",
  "regex": "VolumeInUse.*AttachVolume.*already attached",
  "domain": "aws",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "An EBS volume is being attached to an EC2 instance but is already attached to another instance, or the volume is in a 'stuck' state due to incomplete detachment.",
  "root_cause_type": "generic",
  "root_cause_zh": "EBS 卷正在附加到 EC2 实例，但已附加到另一个实例，或者由于分离不完整而处于“卡住”状态。",
  "versions": [
    {
      "version": "EC2 2016-11-15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS CLI 2.16.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Amazon Linux 2023",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Force detach the volume from the current instance without proper checks.",
      "why_fails": "Force detach can cause data corruption or leave the volume in an inconsistent state, and may require manual cleanup.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restart the EC2 instance to which the volume is attached.",
      "why_fails": "Restarting doesn't detach the volume; it remains attached to the same instance.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Attach the volume to a different device name on the same instance.",
      "why_fails": "The error says it's already attached; you cannot attach the same volume twice to the same instance.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Detach the volume from the current instance using the detach-volume command, wait for the 'available' state, then attach to the desired instance.",
      "success_rate": 0.8,
      "how": "Detach the volume from the current instance using the detach-volume command, wait for the 'available' state, then attach to the desired instance.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the volume is stuck in 'attaching' state, stop the instance it is attached to, then force detach using the AWS Console or CLI with the --force flag, then reattach.",
      "success_rate": 0.75,
      "how": "If the volume is stuck in 'attaching' state, stop the instance it is attached to, then force detach using the AWS Console or CLI with the --force flag, then reattach.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 detach-volume 命令从当前实例分离卷，等待状态变为 'available'，然后附加到所需实例。",
    "如果卷卡在 'attaching' 状态，请停止其附加到的实例，然后使用 AWS 控制台或 CLI 的 --force 标志强制分离，然后重新附加。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html",
  "official_doc_section": null,
  "error_code": "VolumeInUse",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}