{"record":{"id":"0f94290d983a5a3b","repo":"hyperledger/fabric","slug":"peer-address-isn-t-in-host-port-format-s","errorCode":null,"errorMessage":"peer.address isn't in host:port format: %s","messagePattern":"peer\\.address isn't in host:port format: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/peer/config.go","lineNumber":345,"sourceCode":"\tc.StatsdWriteInterval = viper.GetDuration(\"metrics.statsd.writeInterval\")\n\tc.StatsdPrefix = viper.GetString(\"metrics.statsd.prefix\")\n\n\tc.DockerCert = config.GetPath(\"vm.docker.tls.cert.file\")\n\tc.DockerKey = config.GetPath(\"vm.docker.tls.key.file\")\n\tc.DockerCA = config.GetPath(\"vm.docker.tls.ca.file\")\n\n\treturn nil\n}\n\n// getLocalAddress returns the address:port the local peer is operating on.  Affected by env:peer.addressAutoDetect\nfunc getLocalAddress() (string, error) {\n\tpeerAddress := viper.GetString(\"peer.address\")\n\tif peerAddress == \"\" {\n\t\treturn \"\", errors.New(\"peer.address isn't set\")\n\t}\n\thost, port, err := net.SplitHostPort(peerAddress)\n\tif err != nil {\n\t\treturn \"\", errors.Errorf(\"peer.address isn't in host:port format: %s\", peerAddress)\n\t}\n\n\tlocalIP, err := getLocalIP()\n\tif err != nil {\n\t\tpeerLogger.Errorf(\"local IP address not auto-detectable: %s\", err)\n\t\treturn \"\", err\n\t}\n\tautoDetectedIPAndPort := net.JoinHostPort(localIP, port)\n\tpeerLogger.Info(\"Auto-detected peer address:\", autoDetectedIPAndPort)\n\t// If host is the IPv4 address \"0.0.0.0\" or the IPv6 address \"::\",\n\t// then fallback to auto-detected address\n\tif ip := net.ParseIP(host); ip != nil && ip.IsUnspecified() {\n\t\tpeerLogger.Info(\"Host is\", host, \", falling back to auto-detected address:\", autoDetectedIPAndPort)\n\t\treturn autoDetectedIPAndPort, nil\n\t}\n\n\tif viper.GetBool(\"peer.addressAutoDetect\") {\n\t\tpeerLogger.Info(\"Auto-detect flag is set, returning\", autoDetectedIPAndPort)","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/peer/config.go#L327-L363","documentation":"getLocalAddress found peer.address set but not in host:port form (auto-detect could not split it into host and port), so the peer cannot derive its advertised address. Triggered when peer.addressAutoKnow is disabled and the configured string lacks a port.","triggerScenarios":"Thrown at core/peer/config.go:345 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set peer.address to a valid host:port (e.g. 0.0.0.0:7051) in core.yaml","Or enable peer.addressAutoDetect to derive the address automatically"],"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"}