{"record":{"id":"a2fbaa4e1e82ea22","repo":"nats-io/nats-server","slug":"processleafheadermsgargs-parse-error-s","errorCode":null,"errorMessage":"processLeafHeaderMsgArgs Parse Error: '%s'","messagePattern":"processLeafHeaderMsgArgs Parse Error: '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/leafnode.go","lineNumber":3167,"sourceCode":"\t\tcase ' ', '\\t', '\\r', '\\n':\n\t\t\tif start >= 0 {\n\t\t\t\targs = append(args, arg[start:i])\n\t\t\t\tstart = -1\n\t\t\t}\n\t\tdefault:\n\t\t\tif start < 0 {\n\t\t\t\tstart = i\n\t\t\t}\n\t\t}\n\t}\n\tif start >= 0 {\n\t\targs = append(args, arg[start:])\n\t}\n\n\tc.pa.arg = arg\n\tswitch len(args) {\n\tcase 0, 1, 2:\n\t\treturn fmt.Errorf(\"processLeafHeaderMsgArgs Parse Error: '%s'\", args)\n\tcase 3:\n\t\tc.pa.reply = nil\n\t\tc.pa.queues = nil\n\t\tc.pa.hdb = args[1]\n\t\tc.pa.hdr = parseSize(args[1])\n\t\tc.pa.szb = args[2]\n\t\tc.pa.size = parseSize(args[2])\n\tcase 4:\n\t\tc.pa.reply = args[1]\n\t\tc.pa.queues = nil\n\t\tc.pa.hdb = args[2]\n\t\tc.pa.hdr = parseSize(args[2])\n\t\tc.pa.szb = args[3]\n\t\tc.pa.size = parseSize(args[3])\n\tdefault:\n\t\t// args[1] is our reply indicator. Should be + or | normally.\n\t\tif len(args[1]) != 1 {\n\t\t\treturn fmt.Errorf(\"processLeafHeaderMsgArgs Bad or Missing Reply Indicator: '%s'\", args[1])","sourceCodeStart":3149,"sourceCodeEnd":3185,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/leafnode.go#L3149-L3185","documentation":"Leaf-node protocol parse guard: a message-with-headers protocol line split into fewer than 3 argument tokens, which cannot contain the required header-size and total-size fields.","triggerScenarios":"Thrown at server/leafnode.go:3167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify protocol compatibility between leaf peers","Check for a proxy mangling the protocol","Capture the offending line with trace logging and fix the emitter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}