{"record":{"id":"3c25778fca6d03cb","repo":"hyperledger/fabric","slug":"no-orderer-endpoints-retrieved-for-channel-s-pas","errorCode":null,"errorMessage":"no orderer endpoints retrieved for channel %s, pass orderer endpoint with -o flag instead","messagePattern":"no orderer endpoints retrieved for channel (.+?), pass orderer endpoint with -o flag instead","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/chaincode/common.go","lineNumber":421,"sourceCode":"\tsigner, err := common.GetDefaultSignerFnc()\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"error getting default signer\")\n\t}\n\n\tvar broadcastClient common.BroadcastClient\n\tif isOrdererRequired {\n\t\tif len(common.OrderingEndpoint) == 0 {\n\t\t\tif len(endorserClients) == 0 {\n\t\t\t\treturn nil, errors.New(\"orderer is required, but no ordering endpoint or endorser client supplied\")\n\t\t\t}\n\t\t\tendorserClient := endorserClients[0]\n\n\t\t\torderingEndpoints, err := common.GetOrdererEndpointOfChainFnc(channelID, signer, endorserClient, cryptoProvider)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.WithMessagef(err, \"error getting channel (%s) orderer endpoint\", channelID)\n\t\t\t}\n\t\t\tif len(orderingEndpoints) == 0 {\n\t\t\t\treturn nil, errors.Errorf(\"no orderer endpoints retrieved for channel %s, pass orderer endpoint with -o flag instead\", channelID)\n\t\t\t}\n\t\t\tlogger.Infof(\"Retrieved channel (%s) orderer endpoint: %s\", channelID, orderingEndpoints[0])\n\t\t\t// override viper env\n\t\t\tviper.Set(\"orderer.address\", orderingEndpoints[0])\n\t\t}\n\n\t\tbroadcastClient, err = common.GetBroadcastClientFnc()\n\t\tif err != nil {\n\t\t\treturn nil, errors.WithMessage(err, \"error getting broadcast client\")\n\t\t}\n\t}\n\treturn &ChaincodeCmdFactory{\n\t\tEndorserClients: endorserClients,\n\t\tDeliverClients:  deliverClients,\n\t\tSigner:          signer,\n\t\tBroadcastClient: broadcastClient,\n\t\tCertificate:     certificate,\n\t}, nil","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/chaincode/common.go#L403-L439","documentation":"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.","triggerScenarios":"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).","commonSituations":"Channels provisioned without orderer endpoint entries in config; custom channel creation tooling omitting OrdererAddresses/ConsenterConfiguration; network topologies where discovery data is stripped.","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"],"exampleFix":"// before\npeer chaincode invoke -C mychannel -n mycc -c '{...}'  # relies on discovery\n// after\npeer chaincode invoke -o orderer.example.com:7050 --tls --cafile ca.pem -C mychannel -n mycc -c '{...}'","handlingStrategy":"fallback","validationCode":"endpoints, err := common.GetOrdererEndpointOfChainFnc(channelID, signer, endorserClient, cryptoProvider)\nif err != nil || len(endpoints) == 0 {\n    // fall back to explicit -o flag value\n    if common.OrderingEndpoint == \"\" { return fmt.Errorf(\"no discovered orderer endpoints; pass -o\") }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["fabric","orderer","service-discovery","channel-config"],"backgroundTag":"no-orderer-endpoints-for-channel","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"}