dotnet/aspnetcore · error

Invalid payload for Ack message.

Error message

Invalid payload for Ack message.

What it means

Thrown by _createAckMessage when the decoded properties array has fewer than 1 element — i.e. the type itself is missing. Ack messages ([MessageType.Ack, sequenceId]) participate in the reliable/reconnect protocol, so this guard defends against a degenerate frame. Like the Ping guard, it is effectively a near-unreachable defensive check because the type was already read to dispatch here.

Source

Thrown at src/SignalR/clients/ts/signalr-protocol-msgpack/src/MessagePackHubProtocol.ts:267

                result = properties[4];
                break;
        }

        const completionMessage: CompletionMessage = {
            error,
            headers,
            invocationId: properties[2],
            result,
            type: MessageType.Completion,
        };

        return completionMessage;
    }

    private _createAckMessage(properties: any[]): HubMessage {
        // check minimum length to allow protocol to add items to the end of objects in future releases
        if (properties.length < 1) {
            throw new Error("Invalid payload for Ack message.");
        }

        return {
            sequenceId: properties[1],
            type: MessageType.Ack,
        } as HubMessage;
    }

    private _createSequenceMessage(properties: any[]): HubMessage {
        // check minimum length to allow protocol to add items to the end of objects in future releases
        if (properties.length < 1) {
            throw new Error("Invalid payload for Sequence message.");
        }

        return {
            sequenceId: properties[1],
            type: MessageType.Sequence,
        } as HubMessage;

View on GitHub (pinned to 294cab2f9b)

Solutions

  1. Treat as unrecoverable: log and reconnect.
  2. Ensure reliable messaging (Ack/Sequence) is supported on both ends at the same protocol version.
  3. Verify @msgpack/msgpack version is the supported one and not overridden.
  4. Capture frame bytes for diagnosis.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const messages = protocol.parseMessages(buffer, logger);
} catch (e) {
  if (/Ack message/.test(e.message)) {
    logger.log(LogLevel.Error, 'Degenerate Ack frame; reconnecting.');
    await connection.start();
  } else throw e;
}

Prevention

When it happens

Trigger: A frame whose first element matched MessageType.Ack but whose array length is reported as 0 by the decoder — only possible with a misbehaving decoder or corrupted buffer; custom/patched msgpack.

Common situations: Not normally reachable; appears with corrupted reliable-protocol buffers or an incompatible decoder; rare in production.

Related errors


AI-assisted analysis of dotnet/aspnetcore@294cab2f9b (2026-08-06). Data as JSON: /api/errors/6bd479f866abd9d0. Report an issue: GitHub.