# error: proto: required field "user_id" not set

- **ID:** `go/grpc-protobuf-required-field-missing`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A protobuf message with required fields (proto2 syntax) is missing a required field during unmarshaling.

## Version Compatibility

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

## Workarounds

1. **Migrate from proto2 to proto3 where all fields are optional.** (90% success)
   ```
   syntax = "proto3";
message UserRequest { string user_id = 1; }
   ```
2. **Ensure sender populates all required fields before sending.** (85% success)
   ```
   if msg.UserId == nil { return errors.New("user_id required") }
   ```

## Dead Ends

- **Make the field optional in proto2 without changing schema.** — Required is a proto2 concept; cannot be removed without schema change. (90% fail)
- **Set a default value for the field.** — Required fields must be explicitly set by sender. (95% fail)
