{"record":{"id":"f7e2511c26d56be7","repo":"hyperledger/fabric","slug":"invalid-endpoint-for-chaincode-to-connect","errorCode":null,"errorMessage":"invalid endpoint for chaincode to connect","messagePattern":"invalid endpoint for chaincode to connect","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/node/start.go","lineNumber":1117,"sourceCode":"// address (these two are from viper) and peer address to compute chaincode endpoint.\n// There could be following cases of computing chaincode endpoint:\n// Case A: if chaincodeAddrKey is set, use it if not \"0.0.0.0\" (or \"::\")\n// Case B: else if chaincodeListenAddressKey is set and not \"0.0.0.0\" or (\"::\"), use it\n// Case C: else use peer address if not \"0.0.0.0\" (or \"::\")\n// Case D: else return error\nfunc computeChaincodeEndpoint(chaincodeAddress string, chaincodeListenAddress string, peerHostname string) (ccEndpoint string, err error) {\n\tlogger.Infof(\"Entering computeChaincodeEndpoint with peerHostname: %s\", peerHostname)\n\t// Case A: the chaincodeAddrKey is set\n\tif chaincodeAddress != \"\" {\n\t\thost, _, err := net.SplitHostPort(chaincodeAddress)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"Fail to split chaincodeAddress: %s\", err)\n\t\t\treturn \"\", err\n\t\t}\n\t\tccIP := net.ParseIP(host)\n\t\tif ccIP != nil && ccIP.IsUnspecified() {\n\t\t\tlogger.Errorf(\"ChaincodeAddress' IP cannot be %s in non-dev mode\", ccIP)\n\t\t\treturn \"\", errors.New(\"invalid endpoint for chaincode to connect\")\n\t\t}\n\t\tlogger.Infof(\"Exit with ccEndpoint: %s\", chaincodeAddress)\n\t\treturn chaincodeAddress, nil\n\t}\n\n\t// Case B: chaincodeListenAddrKey is set\n\tif chaincodeListenAddress != \"\" {\n\t\tccEndpoint = chaincodeListenAddress\n\t\thost, port, err := net.SplitHostPort(ccEndpoint)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"ChaincodeAddress is nil and fail to split chaincodeListenAddress: %s\", err)\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tccListenerIP := net.ParseIP(host)\n\t\t// ignoring other values such as Multicast address etc ...as the server\n\t\t// wouldn't start up with this address anyway\n\t\tif ccListenerIP != nil && ccListenerIP.IsUnspecified() {","sourceCodeStart":1099,"sourceCodeEnd":1135,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/node/start.go#L1099-L1135","documentation":"computeChaincodeEndpoint Case D: neither chaincodeAddress nor chaincodeListenAddress nor the peer address yields a usable advertiseable address — all are unset or bound to the wildcard 0.0.0.0/::, so the peer cannot tell chaincode containers how to reach it.","triggerScenarios":"Thrown at internal/peer/node/start.go:1117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set peer.address to a non-wildcard routable hostname/IP","Or configure peer.chaincodeAddress to an explicit external address","Or set peer.chaincodeListenAddress to a specific non-wildcard address","Ensure the chosen address is reachable from chaincode containers (e.g., host.docker.internal on Docker Desktop)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}