signalapp/Signal-Server · error · InvalidMessageException

Missing required request attributes!

Error message

Missing required request attributes!

What it means

A ProtobufWebSocketMessage parsed from a WebSocket frame of type REQUEST_MESSAGE must carry a request with both verb and path set. When either protobuf field is absent the constructor throws InvalidMessageException with this message, since an HTTP-like request without a verb or path cannot be dispatched.

Solutions

  1. Populate request.verb and request.path before sending the WebSocketMessage
  2. Fix the client-side builder to set all required request attributes
  3. Verify protobuf schema versions match between client and server

Example fix

// before
WebSocketMessage.newBuilder().setType(REQUEST_MESSAGE).setRequest(Request.newBuilder().setVerb("GET")).build()
// after
WebSocketMessage.newBuilder().setType(REQUEST_MESSAGE).setRequest(Request.newBuilder().setVerb("GET").setPath("/v1/messages")).build()
Defensive patterns

Strategy: validation

Validate before calling

boolean isCompleteRequest(SubProtocol.WebSocketMessage msg) {
    return msg.getType() == Type.REQUEST_MESSAGE
        && msg.getRequest().hasVerb() && msg.getRequest().hasPath();
}

Type guard

boolean hasRequestAttributes(SubProtocol.WebSocketMessage msg) {
    return msg.hasRequest() && msg.getRequest().hasVerb() && msg.getRequest().hasPath();
}

Try / catch

try { new ProtobufWebSocketMessage(buffer); } catch (InvalidMessageException e) { logger.warn("malformed request frame: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Constructing SubProtocol.WebSocketMessage with type REQUEST_MESSAGE but leaving request.verb or request.path unset, then serializing and parsing it via ProtobufWebSocketMessage(ByteBuffer).

Common situations: Client library bug omitting required fields; hand-crafted protobuf payloads in tests; schema/version drift where new clients skip fields older parsers require.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of signalapp/Signal-Server@100ab61c82 (2026-09-09). Data as JSON: /api/errors/0b0fb473d9fb4ffa. Report an issue: GitHub.

Appendix: source

Thrown at websocket-resources/src/main/java/org/whispersystems/websocket/messages/protobuf/ProtobufWebSocketMessage.java:25

import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import org.whispersystems.websocket.messages.InvalidMessageException;
import org.whispersystems.websocket.messages.WebSocketMessage;
import org.whispersystems.websocket.messages.WebSocketRequestMessage;
import org.whispersystems.websocket.messages.WebSocketResponseMessage;
import java.nio.ByteBuffer;

public class ProtobufWebSocketMessage implements WebSocketMessage {

  private final SubProtocol.WebSocketMessage message;

  ProtobufWebSocketMessage(ByteBuffer buffer) throws InvalidMessageException {
    try {
      this.message = SubProtocol.WebSocketMessage.parseFrom(ByteString.copyFrom(buffer));

      if (getType() == Type.REQUEST_MESSAGE) {
        if (!message.getRequest().hasVerb() || !message.getRequest().hasPath()) {
          throw new InvalidMessageException("Missing required request attributes!");
        }
      } else if (getType() == Type.RESPONSE_MESSAGE) {
        if (!message.getResponse().hasId() || !message.getResponse().hasStatus() || !message.getResponse().hasMessage()) {
          throw new InvalidMessageException("Missing required response attributes!");
        }
      }
    } catch (InvalidProtocolBufferException e) {
      throw new InvalidMessageException(e);
    }
  }

  ProtobufWebSocketMessage(SubProtocol.WebSocketMessage message) {
    this.message = message;
  }

  @Override
  public Type getType() {
    if (message.getType().getNumber() == SubProtocol.WebSocketMessage.Type.REQUEST_VALUE &&

View on GitHub (pinned to 100ab61c82)