# rpc error: code = AlreadyExists desc = duplicate registration of service pb.OrderService

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

## Root Cause

RegisterOrderServiceServer was called twice on the same grpc.Server, or two server instances share a registry. gRPC panics on duplicate service registration.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/grpc v1.46+ | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   s := grpc.NewServer()
pb.RegisterOrderServiceServer(s, svc)
// do not register again elsewhere
   ```
2. **** (85% success)
   ```
   var once sync.Once
once.Do(func() { pb.RegisterOrderServiceServer(s, svc) })
   ```

## Dead Ends

- **** — Recovering hides the bug; the second registration still fails and the server state is inconsistent. (80% fail)
- **** — Multiple servers on one listener conflict; only one can bind the port, and requests route unpredictably. (75% fail)
