# rpc error: code = AlreadyExists desc = resource already exists: id=123

- **ID:** `go/grpc-already-exists-duplicate`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The client attempted to create a resource that already exists, often due to a duplicate request or race condition.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   // Client sends a unique idempotency key
// Server checks if key already processed
if exists, return existing resource
else create new
   ```
2. **** (85% success)
   ```
   resp, err := client.Create(ctx, req)
if status.Code(err) == codes.AlreadyExists {
    // Fetch existing resource
    getResp, err := client.Get(ctx, &GetRequest{Id: req.Id})
    // use getResp
}
   ```

## Dead Ends

- **** — This may violate business logic if the ID is meaningful; also doesn't address the root cause of duplicate requests. (80% fail)
- **** — The operation didn't create a new resource, leading to inconsistent state. (70% fail)
