You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i got below issues when i run consul agent
"
Failed to connect to agent: address https://10.180.10.40:8088: too many colons in address
"
Reproduction Steps
1, config consul with TLS, for example, ip is 192.168.1.10, port is 8080
"addresses": {
"https": "192.168.1.10"
},
"ports": {
"https": 8080
},
2, put a watch file under consul config dir, just a example, it's not the matter
{
"type": "key",
"key": "foo/bar/baz",
"handler_type": "script",
"args": ["/usr/bin/my-service-handler.sh", "-redis"]
}
3, run consul agent
then, we can see error logs as below
"
agent: Failed to run watch: Failed to connect to agent: address https://10.180.10.40:8088: too many colons in address
"
source code
when i check source code git log, i found agent/agent.go has added some code as below
Allow passing in a config to the watch plan to use when creating the API client
This allows watches from consul agent config (rather than consul watch command) to be able to utilize HTTPs
net.SplitHostPort will be invoked in SetupTLSConfig (api.go), this interface split hostport like 127.0.0.1:8080 into host 127.0.0.1 and port 8080
but if a prefix is added ( addr = "https://" + addr ) , the result of perform net.SplitHostPort("https://127.0.0.1:8080") will be an error of
"
too many colons in address
"
The text was updated successfully, but these errors were encountered:
Overview of the Issue
i got below issues when i run consul agent
"
Failed to connect to agent: address https://10.180.10.40:8088: too many colons in address
"
Reproduction Steps
1, config consul with TLS, for example, ip is 192.168.1.10, port is 8080
"addresses": {
"https": "192.168.1.10"
},
"ports": {
"https": 8080
},
2, put a watch file under consul config dir, just a example, it's not the matter
{
"type": "key",
"key": "foo/bar/baz",
"handler_type": "script",
"args": ["/usr/bin/my-service-handler.sh", "-redis"]
}
3, run consul agent
then, we can see error logs as below
"
agent: Failed to run watch: Failed to connect to agent: address https://10.180.10.40:8088: too many colons in address
"
source code
when i check source code git log, i found agent/agent.go has added some code as below
commit 8e0e239
Author: Matt Keeler mjkeeler7@gmail.com
Date: Thu May 31 17:07:36 2018 -0400
diff --git a/agent/agent.go b/agent/agent.go
index 20f5a1c..d6b3eab 100644
--- a/agent/agent.go
+++ b/agent/agent.go
@@ -646,14 +646,19 @@ func (a *Agent) reloadWatches(cfg *config.RuntimeConfig) error {
code analysis
net.SplitHostPort will be invoked in SetupTLSConfig (api.go), this interface split hostport like 127.0.0.1:8080 into host 127.0.0.1 and port 8080
but if a prefix is added ( addr = "https://" + addr ) , the result of perform net.SplitHostPort("https://127.0.0.1:8080") will be an error of
"
too many colons in address
"
The text was updated successfully, but these errors were encountered: