{"record":{"id":"5481a9e6c1cf69de","repo":"slackhq/nebula","slug":"errunknownsubtype-5481a9","errorCode":"ErrUnknownSubtype","errorMessage":"%w: %d","messagePattern":"%w: %d","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"handshake/patterns.go","lineNumber":53,"sourceCode":"\t// XX: 3 messages\n\t//   msg1 (I->R): payload only\n\t//   msg2 (R->I): payload + cert\n\t//   msg3 (I->R): cert only\n\t//header.HandshakeXXPSK0: {\n\t//\tpattern: noise.HandshakeXX,\n\t//\tmsgs: []msgFlags{\n\t//\t\t{expectsPayload: true, expectsCert: false},\n\t//\t\t{expectsPayload: true, expectsCert: true},\n\t//\t\t{expectsPayload: false, expectsCert: true},\n\t//\t},\n\t//},\n}\n\nfunc subtypeInfoFor(subtype header.MessageSubType) (subtypeInfo, error) {\n\tif info, ok := subtypeInfos[subtype]; ok {\n\t\treturn info, nil\n\t}\n\treturn subtypeInfo{}, fmt.Errorf(\"%w: %d\", ErrUnknownSubtype, subtype)\n}\n","sourceCodeStart":35,"sourceCodeEnd":55,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/handshake/patterns.go#L35-L55","documentation":"Returned by subtypeInfoFor when a header.MessageSubType has no registered entry in subtypeInfos. Each handshake message subtype must have a known pattern/role mapping; an unknown numeric subtype cannot be processed.","triggerScenarios":"Calling NewMachine (or the anonymous caller) with a MessageSubType value that is not in the subtypeInfos map — e.g. a subtype constant from a newer nebula version not known to this build.","commonSituations":"Mixed-version clusters where a newer node sends a handshake subtype the older node doesn't recognize; typo'd or custom subtype passed programmatically.","solutions":["Upgrade the node so its subtypeInfos includes the subtype used by peers","Use only supported header.MessageSubType constants when constructing machines","Check peers' nebula versions for protocol skew"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if _, ok := subtypeInfos[subType]; !ok {\n    return fmt.Errorf(\"unsupported handshake subtype %d on this node version\", subType)\n}","typeGuard":"func knownSubtype(s header.MessageSubType) bool {\n    _, ok := subtypeInfos[s]\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Pin all nodes to the same nebula major/minor version","Only construct machines with header.MessageSubType constants defined in this build","Test mixed-version clusters before rolling upgrades"],"tags":["handshake","protocol","version-skew"],"backgroundTag":"unknown-message-subtype","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}