{"record":{"id":"003c26f4bc5fa4e9","repo":"hyperledger/fabric","slug":"message-isn-t-an-alive-message","errorCode":null,"errorMessage":"message isn't an alive message","messagePattern":"message isn't an alive message","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/client/client.go","lineNumber":577,"sourceCode":"}\n\ntype endorsementDescriptor struct {\n\tendorsersByGroups map[string][]*Peer\n\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\")","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/client/client.go#L559-L595","documentation":"validateAliveMessage rejects a SignedGossipMessage whose GetAliveMsg() is nil, meaning the envelope's payload decoded to something other than an AliveMessage. The discovery client uses AliveMessages to learn peer membership (endpoint, identity), so it fails the peer. The error is wrapped by the endorser flow as 'failed validating alive message'.","triggerScenarios":"A discovery response (from peersForChannel or the endorser flow) contains a peer record whose gossip message is a StateInfo, DataMsg, or empty payload instead of an AliveMsg.","commonSituations":"Peer gossip store corrupted or out of sync; querying a peer before it joined the channel; Fabric version mismatch where membership payloads differ; a peer returning internal state messages instead of membership snapshots.","solutions":["Inspect the response: log the SignedGossipMessage type of the offending peer record","Ensure the discovery target peer is a member of the requested channel and gossip is convergent (peer gossip logs show membership)","Restart gossip on the target peer so membership/alive messages are regenerated","Align Fabric versions across peers","Retry against a different peer"],"exampleFix":"// before\npeers, err := resp.ForChannel(\"mychannel\") // fails with wrapped validation error\n// after\nif err != nil {\n    if strings.Contains(err.Error(), \"message isn't an alive message\") {\n        logger.Warnf(\"discovery peer returned non-alive membership payload; retrying other peer\")\n    }\n    return nil, err\n}\npeers, err := resp.ForChannel(\"mychannel\")","handlingStrategy":"validation","validationCode":"func aliveMsgLooksValid(m *gprotoext.SignedGossipMessage) error {\n    if m == nil || m.GetAliveMsg() == nil { return errors.New(\"not an alive message\") }\n    if m.GetAliveMsg().Membership == nil { return errors.New(\"membership is empty\") }\n    if m.GetAliveMsg().Timestamp == nil { return errors.New(\"timestamp is nil\") }\n    return nil\n}","typeGuard":"func isAliveMsg(m *gprotoext.SignedGossipMessage) bool { return m != nil && m.GetAliveMsg() != nil }","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"message isn't an alive message\") {\n    logger.Warnf(\"discovery peer returned non-membership payload; selecting alternate peer\")\n    return fallbackDiscovery(ctx)\n}","preventionTips":["Ensure gossip is enabled and converged on queried peers","Keep Fabric versions consistent across the network","Restart peers whose membership view looks stale"],"tags":["hyperledger-fabric","gossip","alive-message","discovery-service","validation"],"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"}