{"record":{"id":"a596c6c4a2df7bba","repo":"hashicorp/nomad","slug":"unexpected-message-type-v","errorCode":null,"errorMessage":"unexpected message type: %#v","messagePattern":"unexpected message type: %#v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/drivers/execstreaming.go","lineNumber":62,"sourceCode":"\t\t\t\t\terrCh <- err\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else if msg.Stdin != nil && msg.Stdin.Close {\n\t\t\t\tinWriter.Close()\n\t\t\t} else if msg.TtySize != nil {\n\t\t\t\tselect {\n\t\t\t\tcase resize <- TerminalSize{\n\t\t\t\t\tHeight: int(msg.TtySize.Height),\n\t\t\t\t\tWidth:  int(msg.TtySize.Width),\n\t\t\t\t}:\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t// process terminated before resize is processed\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else if isHeartbeat(msg) {\n\t\t\t\t// do nothing\n\t\t\t} else {\n\t\t\t\terrCh <- fmt.Errorf(\"unexpected message type: %#v\", msg)\n\t\t\t}\n\t\t}\n\t}()\n\n\tvar sendLock sync.Mutex\n\tsend := func(v *ExecTaskStreamingResponseMsg) error {\n\t\tsendLock.Lock()\n\t\tdefer sendLock.Unlock()\n\n\t\treturn stream.Send(v)\n\t}\n\n\tvar outWg sync.WaitGroup\n\toutWg.Add(2)\n\t// handle Stdout\n\tgo func() {\n\t\tdefer outWg.Done()\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/drivers/execstreaming.go#L44-L80","documentation":"Exec streaming loop guard: a message arrived on the exec stream that is none of stdin-close, tty-resize, or heartbeat — an unknown/unset message type, indicating a protocol violation or version mismatch between client and driver.","triggerScenarios":"Thrown at plugins/drivers/execstreaming.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Match client and driver plugin versions so the exec protocol messages agree","Check the custom driver's streaming implementation sends only known message types"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}