hyperledger/fabric · error
failed validating alive message
Error message
failed validating alive message
What it means
The AliveMessage parsed but failed validateAliveMessage: the message is not of type AliveMessage, its timestamp is too old (anti-entropy staleness), or envelope credentials don't match. The client wraps it and aborts processing the membership result for the channel.
Source
Thrown at discovery/client/client.go:431
var peers []*Peer
for org, peersOfCurrentOrg := range membersRes.PeersByOrg {
for _, peer := range peersOfCurrentOrg.Peers {
aliveMsg, err := gprotoext.EnvelopeToGossipMessage(peer.MembershipInfo)
if err != nil {
return nil, errors.Wrap(err, "failed unmarshalling alive message")
}
var stateInfoMsg *gprotoext.SignedGossipMessage
if isStateInfoExpected(qt) {
stateInfoMsg, err = gprotoext.EnvelopeToGossipMessage(peer.StateInfo)
if err != nil {
return nil, errors.Wrap(err, "failed unmarshalling stateInfo message")
}
if err := validateStateInfoMessage(stateInfoMsg); err != nil {
return nil, errors.Wrap(err, "failed validating stateInfo message")
}
}
if err := validateAliveMessage(aliveMsg); err != nil {
return nil, errors.Wrap(err, "failed validating alive message")
}
peers = append(peers, &Peer{
MSPID: org,
Identity: peer.Identity,
AliveMessage: aliveMsg,
StateInfoMessage: stateInfoMsg,
})
}
}
return peers, nil
}
func isStateInfoExpected(qt protoext.QueryType) bool {
return qt != protoext.LocalMembershipQueryType
}
func (resp response) mapEndorsers(
channel2index map[string]int,View on GitHub (pinned to 2736b63f8f)
Solutions
- Synchronize clocks across peers and client hosts (NTP).
- Restart stale peers so gossip re-announces fresh alive messages.
- Check for network partitions that left peer membership stale.
- Align Fabric versions between client and peers.
- Retry discovery after the peer's membership refreshes.
Example fix
// before: ignoring clock sync // hosts with drifting clocks cause validateAliveMessage failures // after: ensure NTP before running discovery // sudo timedatectl set-ntp true && timedatectl status res, err := client.SendRequest(ctx, req)
Defensive patterns
Strategy: validation
Validate before calling
func aliveMsgIsFresh(msg *gprotoext.SignedGossipMessage, maxSkew time.Duration) bool {
if msg == nil || !msg.IsAliveMsg() { return false }
ts := msg.GetTimestamp()
return ts != nil && time.Since(time.Unix(ts.Seconds, int64(ts.Nanos))) < maxSkew
} Type guard
func asAliveMessage(msg *gprotoext.SignedGossipMessage) (*gossip.GossipMessage_AliveMsg, bool) {
if msg == nil { return nil, false }
am, ok := msg.GetGossipMessage().Content.(*gossip.GossipMessage_AliveMsg)
return am.AliveMsg, ok
} Try / catch
if err != nil {
if strings.Contains(err.Error(), "failed validating alive message") {
return refreshMembershipAndRetry(ctx) // likely stale/clock skew
}
return err
} Prevention
- Run NTP on all Fabric hosts to avoid stale-timestamp rejection
- Restart peers with stale gossip membership
- Investigate network partitions promptly
- Keep client/server Fabric versions consistent
When it happens
Trigger: Peer membership queries where a peer's AliveMessage payload is the wrong gossip type or carries an expired timestamp beyond the allowed clock skew window.
Common situations: Significant clock skew between peers and client (alive timestamps stale); peers whose gossip membership is stale after network partitions; proto version mismatches.
Related errors
- failed validating stateInfo message
- chaincode query must have at least one chaincode interest
- chaincode interest is nil
- chaincode interest must contain at least one chaincode
- chaincode name in interest cannot be empty
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/d72b62fe6d5bdb53.
Report an issue: GitHub.