# AttachVolume.Attach failed for volume "pvc-xxx" : rpc error: code = DeadlineExceeded desc = context deadline exceeded

- **ID:** `kubernetes/volume-attach-timeout-csi`
- **Domain:** kubernetes
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

CSI driver timed out while attaching a persistent volume to a node, often due to cloud provider API throttling or network issues between the CSI controller and storage backend.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kubernetes 1.24 | active | — | — |
| Kubernetes 1.27 | active | — | — |
| AWS EBS CSI Driver 1.12 | active | — | — |
| GCE PD CSI Driver 1.8 | active | — | — |

## Workarounds

1. **Check CSI driver logs for specific errors: `kubectl logs -n kube-system <csi-controller-pod> csi-provisioner` and look for throttling or backend errors.** (85% success)
   ```
   Check CSI driver logs for specific errors: `kubectl logs -n kube-system <csi-controller-pod> csi-provisioner` and look for throttling or backend errors.
   ```
2. **Increase the CSI driver's attach timeout by setting environment variable `ATTACH_TIMEOUT=5m` in the CSI controller deployment, then restart the pods.** (75% success)
   ```
   Increase the CSI driver's attach timeout by setting environment variable `ATTACH_TIMEOUT=5m` in the CSI controller deployment, then restart the pods.
   ```
3. **Verify cloud provider API quotas (e.g., AWS EC2 API call rate limits) and request a quota increase if needed: `aws ec2 describe-account-attributes`.** (80% success)
   ```
   Verify cloud provider API quotas (e.g., AWS EC2 API call rate limits) and request a quota increase if needed: `aws ec2 describe-account-attributes`.
   ```

## Dead Ends

- **** — Restarting the CSI controller pod without checking cloud provider quotas or API rate limits will not resolve the underlying throttling issue. (70% fail)
- **** — Increasing CSI driver timeout without addressing storage backend latency only delays the failure. (50% fail)
- **** — Deleting and recreating the PVC/PV pair may be blocked by finalizers and does not fix the attach timeout root cause. (60% fail)
