{"record":{"id":"b6611f7af475ebcf","repo":"hyperledger/fabric","slug":"cannot-obtain-orderer-endpoint-no-signer-was-conf","errorCode":null,"errorMessage":"cannot obtain orderer endpoint, no signer was configured","messagePattern":"cannot obtain orderer endpoint, no signer was configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/client_connections.go","lineNumber":205,"sourceCode":"\nfunc (c *ClientConnections) setCertificate() error {\n\tcertificate, err := common.GetClientCertificate()\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to retrieve client cerificate\")\n\t}\n\n\tc.Certificate = certificate\n\n\treturn nil\n}\n\nfunc (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}","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/client_connections.go#L187-L223","documentation":"Some lifecycle commands need to discover an orderer endpoint (via the cscc system chaincode) when none is given on the command line. That discovery requires signing the request, so if viper's \"orderer.address\" is unset and c.Signer is nil, this error is returned.","triggerScenarios":"setOrdererClient runs with no orderer.address configured and a nil Signer — e.g. the client identity/signer was not initialized before NewClientConnections, typically when embedding the library or a misconfigured identity.","commonSituations":"Programmatic use of the lifecycle chaincode package without loading the user's MSP/signer; running the CLI without a valid membership identity so no signer could be created; no --ordererAddress and no orderer.address in config/env.","solutions":["Pass --ordererAddress (orderer.address) explicitly so discovery is unnecessary","Configure a valid signer/MSP identity (check CORE_PEER_LOCALMSPID, CORE_PEER_MSPCONFIGPATH) so c.Signer is populated","Ensure at least one endorser client exists too, since the next check requires it for discovery","If embedding the library, initialize the Signer before calling NewClientConnections"],"exampleFix":"// before\npeer lifecycle chaincode <cmd> ...   // no orderer address, no valid MSP\n// after\nexport CORE_PEER_MSPCONFIGPATH=$PWD/crypto-config/peerOrganizations/org1/users/Admin@org1/msp\npeer lifecycle chaincode <cmd> --ordererAddress orderer.example.com:7050 ...","handlingStrategy":"validation","validationCode":"if os.Getenv(\"ORDERER_ADDRESS\") == \"\" && viper.GetString(\"orderer.address\") == \"\" {\n  if mspConfigPath == \"\" { return errors.New(\"configure --ordererAddress or a valid MSP identity\") }\n}","typeGuard":"func canDiscoverOrderer(ordererAddress string, signer identity.Signer) bool { return ordererAddress != \"\" || signer != nil }","tryCatchPattern":"if err := run(cmd); err != nil && strings.Contains(err.Error(), \"no signer was configured\") { log.Fatal(\"set --ordererAddress or fix CORE_PEER_MSPCONFIGPATH so a signer exists\") }","preventionTips":["Set CORE_PEER_MSPCONFIGPATH/CORE_PEER_LOCALMSPID before running lifecycle commands","Pass --ordererAddress explicitly to skip cscc discovery","When embedding, construct and attach the Signer before NewClientConnections"],"tags":["fabric","orderer","signer"],"backgroundTag":"missing-signer-identity","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"}