# rpc error: code = InvalidArgument desc = field 'name' must not be empty

- **ID:** `go/grpc-invalid-argument-field-validation`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The client sent a request with invalid or missing required fields, often due to missing validation.

## Version Compatibility

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

## Workarounds

1. **Validate all required fields before making the RPC call.** (90% success)
   ```
   if req.Name == "" {
    return fmt.Errorf("name is required")
}
if req.Age < 0 {
    return fmt.Errorf("age must be non-negative")
}
resp, err := client.SomeRPC(ctx, req)
   ```
2. **Use protobuf validation annotations and generate validation code.** (85% success)
   ```
   In .proto: message MyRequest { string name = 1 [(validate.rules).string.min_len = 1]; }
Then call: if err := req.Validate(); err != nil { return err }
   ```

## Dead Ends

- **Send the request with empty fields again.** — The server will reject it for the same reason. (100% fail)
- **Ignore the error and proceed with partial data.** — The RPC failed, so no data was processed. (95% fail)
