{"record":{"id":"705ce78b89304da4","repo":"nats-io/nats-server","slug":"processroutedoriginclustermsgargs-header-size-larg","errorCode":null,"errorMessage":"processRoutedOriginClusterMsgArgs Header Size larger then TotalSize: '%s'","messagePattern":"processRoutedOriginClusterMsgArgs Header Size larger then TotalSize: '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/route.go","lineNumber":268,"sourceCode":"\t\t// Grab size.\n\t\tc.pa.szb = args[len(args)-1]\n\t\tc.pa.size = parseSize(c.pa.szb)\n\n\t\t// Grab queue names.\n\t\tif c.pa.reply != nil {\n\t\t\tc.pa.queues = args[5 : len(args)-2]\n\t\t} else {\n\t\t\tc.pa.queues = args[4 : len(args)-2]\n\t\t}\n\t}\n\tif c.pa.hdr < 0 {\n\t\treturn fmt.Errorf(\"processRoutedOriginClusterMsgArgs Bad or Missing Header Size: '%s'\", arg)\n\t}\n\tif c.pa.size < 0 {\n\t\treturn fmt.Errorf(\"processRoutedOriginClusterMsgArgs Bad or Missing Size: '%s'\", args)\n\t}\n\tif c.pa.hdr > c.pa.size {\n\t\treturn fmt.Errorf(\"processRoutedOriginClusterMsgArgs Header Size larger then TotalSize: '%s'\", arg)\n\t}\n\n\t// Common ones processed after check for arg length\n\tc.pa.origin = args[0]\n\tc.pa.account = args[1]\n\tc.pa.subject = args[2]\n\tif len(an) > 0 {\n\t\tc.pa.pacache = c.pa.subject\n\t} else {\n\t\tc.pa.pacache = arg[len(args[0])+1 : len(args[0])+len(args[1])+len(args[2])+2]\n\t}\n\treturn nil\n}\n\n// Process an inbound HMSG specification from the remote route.\nfunc (c *client) processRoutedHeaderMsgArgs(arg []byte) error {\n\t// Unroll splitArgs to avoid runtime/heap issues\n\targs := c.argsa[:0]","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/route.go#L250-L286","documentation":"Sanity check after parsing the routed origin-cluster message: the declared header size exceeds the declared total message size, which is impossible for a well-formed message (headers are a prefix of the payload). The full raw arg line is echoed; indicates corrupted size fields or misaligned parsing of the argument tokens.","triggerScenarios":"Thrown at server/route.go:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the echoed arg line to see the header vs total size values","Verify peers run compatible nats-server versions","Check for intermediaries corrupting route traffic"],"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"}