hyperledger/fabric · error
no orderer endpoints retrieved for channel %s, pass orderer
Error message
no orderer endpoints retrieved for channel %s, pass orderer endpoint with -o flag instead
What it means
After discovering orderer endpoints from the channel configuration via an endorser client, Fabric expects at least one endpoint. An empty result means the channel's config does not expose usable orderer addresses, so the CLI asks the user to supply the orderer directly with the -o flag.
Source
Thrown at internal/peer/chaincode/common.go:421
signer, err := common.GetDefaultSignerFnc()
if err != nil {
return nil, errors.WithMessage(err, "error getting default signer")
}
var broadcastClient common.BroadcastClient
if isOrdererRequired {
if len(common.OrderingEndpoint) == 0 {
if len(endorserClients) == 0 {
return nil, errors.New("orderer is required, but no ordering endpoint or endorser client supplied")
}
endorserClient := endorserClients[0]
orderingEndpoints, err := common.GetOrdererEndpointOfChainFnc(channelID, signer, endorserClient, cryptoProvider)
if err != nil {
return nil, errors.WithMessagef(err, "error getting channel (%s) orderer endpoint", channelID)
}
if len(orderingEndpoints) == 0 {
return nil, errors.Errorf("no orderer endpoints retrieved for channel %s, pass orderer endpoint with -o flag instead", channelID)
}
logger.Infof("Retrieved channel (%s) orderer endpoint: %s", channelID, orderingEndpoints[0])
// override viper env
viper.Set("orderer.address", orderingEndpoints[0])
}
broadcastClient, err = common.GetBroadcastClientFnc()
if err != nil {
return nil, errors.WithMessage(err, "error getting broadcast client")
}
}
return &ChaincodeCmdFactory{
EndorserClients: endorserClients,
DeliverClients: deliverClients,
Signer: signer,
BroadcastClient: broadcastClient,
Certificate: certificate,
}, nilView on GitHub (pinned to 2736b63f8f)
Solutions
- Pass the orderer explicitly with `-o <host:port>` instead of relying on discovery
- Re-check channel configuration to include orderer endpoints (OrdererAddresses or raft consenters with correct addresses)
- Verify you are querying the correct channel and that the endorser peer is joined to it and has current config
Example fix
// before
peer chaincode invoke -C mychannel -n mycc -c '{...}' # relies on discovery
// after
peer chaincode invoke -o orderer.example.com:7050 --tls --cafile ca.pem -C mychannel -n mycc -c '{...}' Defensive patterns
Strategy: fallback
Validate before calling
endpoints, err := common.GetOrdererEndpointOfChainFnc(channelID, signer, endorserClient, cryptoProvider)
if err != nil || len(endpoints) == 0 {
// fall back to explicit -o flag value
if common.OrderingEndpoint == "" { return fmt.Errorf("no discovered orderer endpoints; pass -o") }
} Prevention
- Always supply -o for production scripts rather than relying on discovery
- Ensure channel configs include orderer endpoint addresses
- Verify the peer used for discovery is joined and current on channel config
When it happens
Trigger: Invoke/commit command relying on endorser-based orderer discovery (no -o flag) where GetOrdererEndpointOfChainFnc returns an empty list — typically because the channel config lacks orderer endpoints (e.g. etcd/raft config with no external endpoints, or a minimal/test channel config).
Common situations: Channels provisioned without orderer endpoint entries in config; custom channel creation tooling omitting OrdererAddresses/ConsenterConfiguration; network topologies where discovery data is stripped.
Related errors
- missing OrdererConfig in channel config
- cannot enable channel capabilities without orderer support f
- Must set some OrdererAddresses
- OrdererOrg config does not allow sub-groups
- subpolicy number %d type %T of policy %s is not convertible
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/3c25778fca6d03cb.
Report an issue: GitHub.