{"record":{"id":"d72b62fe6d5bdb53","repo":"hyperledger/fabric","slug":"failed-validating-alive-message","errorCode":null,"errorMessage":"failed validating alive message","messagePattern":"failed validating alive message","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/client/client.go","lineNumber":431,"sourceCode":"\tvar peers []*Peer\n\tfor org, peersOfCurrentOrg := range membersRes.PeersByOrg {\n\t\tfor _, peer := range peersOfCurrentOrg.Peers {\n\t\t\taliveMsg, err := gprotoext.EnvelopeToGossipMessage(peer.MembershipInfo)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"failed unmarshalling alive message\")\n\t\t\t}\n\t\t\tvar stateInfoMsg *gprotoext.SignedGossipMessage\n\t\t\tif isStateInfoExpected(qt) {\n\t\t\t\tstateInfoMsg, err = gprotoext.EnvelopeToGossipMessage(peer.StateInfo)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"failed unmarshalling stateInfo message\")\n\t\t\t\t}\n\t\t\t\tif err := validateStateInfoMessage(stateInfoMsg); err != nil {\n\t\t\t\t\treturn nil, errors.Wrap(err, \"failed validating stateInfo message\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := validateAliveMessage(aliveMsg); err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"failed validating alive message\")\n\t\t\t}\n\t\t\tpeers = append(peers, &Peer{\n\t\t\t\tMSPID:            org,\n\t\t\t\tIdentity:         peer.Identity,\n\t\t\t\tAliveMessage:     aliveMsg,\n\t\t\t\tStateInfoMessage: stateInfoMsg,\n\t\t\t})\n\t\t}\n\t}\n\treturn peers, nil\n}\n\nfunc isStateInfoExpected(qt protoext.QueryType) bool {\n\treturn qt != protoext.LocalMembershipQueryType\n}\n\nfunc (resp response) mapEndorsers(\n\tchannel2index map[string]int,","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/client/client.go#L413-L449","documentation":"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.","triggerScenarios":"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.","commonSituations":"Significant clock skew between peers and client (alive timestamps stale); peers whose gossip membership is stale after network partitions; proto version mismatches.","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."],"exampleFix":"// before: ignoring clock sync\n// hosts with drifting clocks cause validateAliveMessage failures\n// after: ensure NTP before running discovery\n// sudo timedatectl set-ntp true && timedatectl status\nres, err := client.SendRequest(ctx, req)","handlingStrategy":"validation","validationCode":"func aliveMsgIsFresh(msg *gprotoext.SignedGossipMessage, maxSkew time.Duration) bool {\n  if msg == nil || !msg.IsAliveMsg() { return false }\n  ts := msg.GetTimestamp()\n  return ts != nil && time.Since(time.Unix(ts.Seconds, int64(ts.Nanos))) < maxSkew\n}","typeGuard":"func asAliveMessage(msg *gprotoext.SignedGossipMessage) (*gossip.GossipMessage_AliveMsg, bool) {\n  if msg == nil { return nil, false }\n  am, ok := msg.GetGossipMessage().Content.(*gossip.GossipMessage_AliveMsg)\n  return am.AliveMsg, ok\n}","tryCatchPattern":"if err != nil {\n  if strings.Contains(err.Error(), \"failed validating alive message\") {\n    return refreshMembershipAndRetry(ctx) // likely stale/clock skew\n  }\n  return err\n}","preventionTips":["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"],"tags":["fabric","discovery","alive-message","validation","clock-skew"],"backgroundTag":"message-validation-failed","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"}