{"record":{"id":"d83128d92efb5e6c","repo":"hyperledger/fabric","slug":"unknown-message-type-v","errorCode":null,"errorMessage":"Unknown message type: %v","messagePattern":"Unknown message type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/protoext/message.go","lineNumber":185,"sourceCode":"\t\t\treturn fmt.Errorf(\"Invalid PullMsgType: %s\", gossip.PullMsgType_name[int32(GetPullMsgType(m))])\n\t\t}\n\t}\n\n\tif IsStateInfoMsg(m) || IsStateInfoPullRequestMsg(m) || IsStateInfoSnapshot(m) || IsRemoteStateMessage(m) {\n\t\tif m.Tag != gossip.GossipMessage_CHAN_OR_ORG {\n\t\t\treturn fmt.Errorf(\"Tag should be %s\", gossip.GossipMessage_Tag_name[int32(gossip.GossipMessage_CHAN_OR_ORG)])\n\t\t}\n\t\treturn nil\n\t}\n\n\tif IsLeadershipMsg(m) {\n\t\tif m.Tag != gossip.GossipMessage_CHAN_AND_ORG {\n\t\t\treturn fmt.Errorf(\"Tag should be %s\", gossip.GossipMessage_Tag_name[int32(gossip.GossipMessage_CHAN_AND_ORG)])\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"Unknown message type: %v\", m)\n}\n","sourceCodeStart":167,"sourceCodeEnd":187,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/protoext/message.go#L167-L187","documentation":"Fallback error of IsTagLegal: the message matches none of the known content categories (data, pull, state transfer, leadership), so its tag cannot be validated and the whole message is reported as unknown.","triggerScenarios":"Calling IsTagLegal on a GossipMessage whose Content field is nil, empty, or a content type not covered by the IsXxxMsg predicates (e.g. an empty message, membership-less envelopes, or future/unrecognized content types).","commonSituations":"Messages created with proto.ZeroGossipMessage but never populated; payloads decoded from an incompatible fabric version introducing new message types; test scaffolding sending placeholder messages.","solutions":["Populate the GossipMessage Content with a supported type before validating","Drop or ignore empty/unknown gossip messages instead of forwarding them","Align fabric versions across peers so all message types are recognized"],"exampleFix":"// before\nmsg := proto.ZeroGossipMessage\nerr := protoext.IsTagLegal(signedMsg) // unknown type\n// after\nmsg.Content = &gossip.GossipMessage_DataMsg{Data: ...}\nerr := protoext.IsTagLegal(signedMsg)","handlingStrategy":"validation","validationCode":"if msg == nil || msg.Content == nil {\n    return errors.New(\"gossip message has no content; cannot validate tag\")\n}","typeGuard":"func hasKnownContent(m *gossip.GossipMessage) bool {\n    return m != nil && m.Content != nil && (protoext.IsDataMsg(m) || protoext.IsPullMsg(m) ||\n        protoext.IsStateInfoMsg(m) || protoext.IsStateInfoPullRequestMsg(m) ||\n        protoext.IsStateInfoSnapshot(m) || protoext.IsRemoteStateMessage(m) || protoext.IsLeadershipMsg(m))\n}","tryCatchPattern":null,"preventionTips":["Never send empty GossipMessage structs","Filter unknown message types at ingress before validation","Keep proto definitions in sync across fabric versions"],"tags":["gossip","hyperledger-fabric","validation"],"backgroundTag":"gossip-message-tag-mismatch","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}