{"record":{"id":"c58f7e5fcf825ad9","repo":"hyperledger/fabric","slug":"no-orderer-endpoints-retrieved-for-channel-s-pas-c58f7e","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/lifecycle/chaincode/client_connections.go","lineNumber":217,"sourceCode":"func (c *ClientConnections) setOrdererClient() error {\n\toe := viper.GetString(\"orderer.address\")\n\tif oe == \"\" {\n\t\t// if we're here we didn't get an orderer endpoint from the command line\n\t\t// so we'll attempt to get one from cscc - bless it\n\t\tif c.Signer == nil {\n\t\t\treturn errors.New(\"cannot obtain orderer endpoint, no signer was configured\")\n\t\t}\n\n\t\tif len(c.EndorserClients) == 0 {\n\t\t\treturn errors.New(\"cannot obtain orderer endpoint, empty endorser list\")\n\t\t}\n\n\t\torderingEndpoints, err := common.GetOrdererEndpointOfChainFnc(channelID, c.Signer, c.EndorserClients[0], c.CryptoProvider)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessagef(err, \"error getting channel (%s) orderer endpoint\", channelID)\n\t\t}\n\t\tif len(orderingEndpoints) == 0 {\n\t\t\treturn errors.Errorf(\"no orderer endpoints retrieved for channel %s, pass orderer endpoint with -o flag instead\", channelID)\n\t\t}\n\n\t\tlogger.Infof(\"Retrieved channel (%s) orderer endpoint: %s\", channelID, orderingEndpoints[0])\n\t\t// override viper env\n\t\tviper.Set(\"orderer.address\", orderingEndpoints[0])\n\t}\n\n\tbroadcastClient, err := common.GetBroadcastClient()\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to retrieve broadcast client\")\n\t}\n\n\tc.BroadcastClient = broadcastClient\n\n\treturn nil\n}\n","sourceCodeStart":199,"sourceCodeEnd":234,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/client_connections.go#L199-L234","documentation":"After successfully querying cscc for the channel's orderer endpoints, the returned list was empty — the channel configuration contains no orderer endpoints the peer can use. The client refuses to proceed and tells the user to provide the orderer explicitly with -o.","triggerScenarios":"setOrdererClient calls GetOrdererEndpointOfChainFnc and it returns an empty list of ordering endpoints for the given channelID.","commonSituations":"Channel config missing orderer endpoints or the peer cannot read them (ordering service removed/renamed in config); querying a channel that exists but has no orderer group; stale or wrong channel name passed with -C.","solutions":["Pass the orderer explicitly with -o/--orderer (e.g. -o orderer.example.com:7050).","Verify the channel name with -C matches a channel the peer is joined to and that its config block contains orderer endpoints.","Inspect the channel config (peer channel fetch config) to confirm orderer endpoints are present.","Re-add or correct the OrdererAddresses entry in the channel configuration if it is genuinely missing."],"exampleFix":"// before\npeer lifecycle chaincode approveformyorg -C mychannel --name mycc\n// after\npeer lifecycle chaincode approveformyorg -C mychannel --name mycc -o orderer.example.com:7050","handlingStrategy":"fallback","validationCode":"endpoints, err := common.GetOrdererEndpointOfChainFnc(channelID, signer, endorser, cryptoProvider)\nif err != nil || len(endpoints) == 0 {\n    // fall back to explicit orderer flag value\n    endpoints = []string{ordererFlag}\n}","typeGuard":"func hasOrdererEndpoints(eps []string) bool { return len(eps) > 0 }","tryCatchPattern":null,"preventionTips":["Verify channel config contains orderer endpoints (peer channel fetch config).","Keep the explicit -o flag in production scripts as a deterministic fallback.","Confirm the -C channel name is correct and the peer is joined to it."],"tags":["hyperledger-fabric","orderer-discovery","channel-config","peer-cli"],"backgroundTag":"no-orderer-endpoints","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"}