signalapp/Signal-Server · error · FieldValidationException
message expected to be present
Error message
message expected to be present
What it means
PresentFieldValidator.validateMessageValue throws FieldValidationException when a proto message field annotated as required-present is null. Signal's gRPC layer uses this to reject requests missing an embedded message sub-field.
Solutions
- Set the required message field via its setter (e.g. .setServiceIdentifier(...)) before building the request
- Client-side null-check nested messages before sending
- Compare against the proto definition to enumerate which message fields are annotated as required
Example fix
// before
Request.newBuilder().build(); // nested message never set
// after
Request.newBuilder()
.setServiceIdentifier(ServiceId.newBuilder().setAci(aciUuid).build())
.build(); Defensive patterns
Strategy: validation
Validate before calling
if (request.getServiceIdentifier() == null) throw new IllegalArgumentException("service identifier message is required"); Type guard
boolean hasMessage(Request r) { return r.hasServiceIdentifier(); } Try / catch
try { stub.call(request); } catch (StatusRuntimeException e) { if (e.getStatus().getCode() == Status.Code.INVALID_ARGUMENT) { /* handle missing message field */ } } Prevention
- Use hasXxx() checks on proto message fields before sending
- Build nested messages in dedicated factory methods so they are never omitted
- Review proto annotations listing required-present fields
When it happens
Trigger: Calling a Signal gRPC endpoint without setting a required nested message field (e.g. missing ServiceIdentifier, missing DeviceSpecifier), so the validator receives a null Message.
Common situations: Clients forgetting to set a nested message builder; proto3 code assuming unset message fields default to an instance rather than null; copy-pasted request builders missing one sub-message.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- string expected to be non-empty
- repeated field is expected to be non-empty
- INVALID_ARGUMENT
- value is not valid base64 url
- value is not in E164 format
AI-assisted analysis of signalapp/Signal-Server@100ab61c82 (2026-09-09).
Data as JSON: /api/errors/da1077b98089a808.
Report an issue: GitHub.
Appendix: source
Thrown at service/src/main/java/org/whispersystems/textsecuregcm/grpc/validators/PresentFieldValidator.java:29
public class PresentFieldValidator extends FieldValidator<Boolean> {
public PresentFieldValidator() {
super("present",
Set.of(Descriptors.FieldDescriptor.Type.MESSAGE),
MissingOptionalAction.FAIL,
true);
}
@Override
protected Boolean resolveExtensionValue(final Object extensionValue) throws FieldValidationException {
return requireFlagExtension(extensionValue);
}
@Override
protected void validateMessageValue(final Boolean extensionValue, final Message msg) throws FieldValidationException {
if (msg == null) {
throw new FieldValidationException("message expected to be present");
}
}
}
View on GitHub (pinned to 100ab61c82)