# rpc error: code = Unknown desc = runtime error: invalid memory address or nil pointer dereference

- **ID:** `go/grpc-unknown-non-status-error`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The server handler panicked. gRPC recovers the panic and returns Unknown, but the panic message leaks into the error description. The real cause is a nil pointer dereference in the handler.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0+ | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   func recovery(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
  defer func() {
    if r := recover(); r != nil {
      log.Printf("panic in %s: %v\n%s", info.FullMethod, r, debug.Stack())
    }
  }()
  return handler(ctx, req)
}
   ```
2. **** (95% success)
   ```
   if req == nil || req.User == nil {
  return nil, status.Error(codes.InvalidArgument, "user is required")
}
   ```

## Dead Ends

- **** — The server will panic again for the same input; retries just amplify load and log noise (90% fail)
- **** — The panic happened on the server; client-side recover cannot catch it (95% fail)
