# rpc error: code = Canceled desc = context canceled

- **ID:** `go/grpc-context-canceled`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The caller's context was canceled (e.g., HTTP request aborted, parent context deadline hit, or explicit cancel()) before the RPC completed.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| go 1.21+ (context.WithoutCancel) | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Detach from the request context for background work:
ctx = context.WithoutCancel(ctx)
// or use context.Background() with an explicit timeout
   ```
2. **** (85% success)
   ```
   Distinguish cancellation from real failures:
if status.Code(err) == codes.Canceled {
    return // caller went away, do not log as error
}
   ```

## Dead Ends

- **** — An already-canceled context immediately fails every subsequent call. (99% fail)
- **** — The cancellation originates on the client side; server timeouts are irrelevant. (80% fail)
