{"record":{"id":"c0b8604e8dd941e5","repo":"hyperledger/fabric","slug":"membership-is-empty","errorCode":null,"errorMessage":"membership is empty","messagePattern":"membership is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/client/client.go","lineNumber":581,"sourceCode":"\tlayouts           []map[string]int\n}\n\n// NewClient creates a new Client instance\nfunc NewClient(createConnection Dialer, s Signer, signerCacheSize uint) *Client {\n\treturn &Client{\n\t\tcreateConnection: createConnection,\n\t\tsignRequest:      NewMemoizeSigner(s, signerCacheSize).Sign,\n\t}\n}\n\nfunc validateAliveMessage(message *gprotoext.SignedGossipMessage) error {\n\tam := message.GetAliveMsg()\n\tif am == nil {\n\t\treturn errors.New(\"message isn't an alive message\")\n\t}\n\tm := am.Membership\n\tif m == nil {\n\t\treturn errors.New(\"membership is empty\")\n\t}\n\tif am.Timestamp == nil {\n\t\treturn errors.New(\"timestamp is nil\")\n\t}\n\treturn nil\n}\n\nfunc validateStateInfoMessage(message *gprotoext.SignedGossipMessage) error {\n\tsi := message.GetStateInfo()\n\tif si == nil {\n\t\treturn errors.New(\"message isn't a stateInfo message\")\n\t}\n\tif si.Timestamp == nil {\n\t\treturn errors.New(\"timestamp is nil\")\n\t}\n\tif si.Properties == nil {\n\t\treturn errors.New(\"properties is nil\")\n\t}","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/client/client.go#L563-L599","documentation":"validateAliveMessage found an AliveMessage whose Membership field is nil. An AliveMsg must carry MembershipInfo (peer name, endpoint, PKI id, identity) for the discovery client to use it; without it the peer record is unusable, so validation fails and the error is wrapped by the endorser flow.","triggerScenarios":"A gossip AliveMessage in a discovery response has its Membership ( AliveMsg.Membership ) nil — typically a partially constructed or truncated membership message.","commonSituations":"Peer gossip emitting synthetic alive messages without full membership data; corrupted protobuf wire data; inter-version incompatibility dropping membership fields.","solutions":["Check the target peer's gossip logs for membership construction errors","Restart the peer to rebuild its membership view","Verify channel membership and that the peer's local MSP identity is valid so full membership is gossiped","Upgrade/downgrade peers to matching Fabric versions","Retry discovery against another peer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func hasMembership(m *gprotoext.SignedGossipMessage) bool {\n    am := m.GetAliveMsg()\n    return am != nil && am.Membership != nil && am.Membership.Endpoint != \"\"\n}","typeGuard":"func isCompleteAliveMsg(m *gprotoext.SignedGossipMessage) bool {\n    am := m.GetAliveMsg()\n    return am != nil && am.Membership != nil\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"membership is empty\") {\n    return fmt.Errorf(\"discovery peer gossip incomplete: %w\", err)\n}","preventionTips":["Verify peer local MSP identity is valid so full membership is gossiped","Monitor gossip membership counts per peer","Restart peers that broadcast incomplete membership"],"tags":["hyperledger-fabric","gossip","membership","discovery-service"],"backgroundTag":"gossip-message-type-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"}