nats-io/nats-server · error

processLeafHeaderMsgArgs Bad or Missing Reply Indicator: '%s

Error message

processLeafHeaderMsgArgs Bad or Missing Reply Indicator: '%s'

What it means

Leaf-node protocol parse guard: for long-form header messages the reply indicator token (args[1]) is not exactly one character ('+' or '|'), so the message shape is unrecognized.

Source

Thrown at server/leafnode.go:3185

		return fmt.Errorf("processLeafHeaderMsgArgs Parse Error: '%s'", args)
	case 3:
		c.pa.reply = nil
		c.pa.queues = nil
		c.pa.hdb = args[1]
		c.pa.hdr = parseSize(args[1])
		c.pa.szb = args[2]
		c.pa.size = parseSize(args[2])
	case 4:
		c.pa.reply = args[1]
		c.pa.queues = nil
		c.pa.hdb = args[2]
		c.pa.hdr = parseSize(args[2])
		c.pa.szb = args[3]
		c.pa.size = parseSize(args[3])
	default:
		// args[1] is our reply indicator. Should be + or | normally.
		if len(args[1]) != 1 {
			return fmt.Errorf("processLeafHeaderMsgArgs Bad or Missing Reply Indicator: '%s'", args[1])
		}
		switch args[1][0] {
		case '+':
			c.pa.reply = args[2]
		case '|':
			c.pa.reply = nil
		default:
			return fmt.Errorf("processLeafHeaderMsgArgs Bad or Missing Reply Indicator: '%s'", args[1])
		}
		// Grab header size.
		c.pa.hdb = args[len(args)-2]
		c.pa.hdr = parseSize(c.pa.hdb)

		// Grab size.
		c.pa.szb = args[len(args)-1]
		c.pa.size = parseSize(c.pa.szb)

		// Grab queue names.

View on GitHub (pinned to 3a66a489d2)

Solutions

  1. Ensure only '+' or '|' reply indicators are emitted
  2. Check for protocol corruption between leaf peers
  3. Upgrade mismatched server versions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/leafnode.go:3185 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02). Data as JSON: /api/errors/10f3d75c642a753f. Report an issue: GitHub.