Example service address rejected in consul 1.5.1
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Overview of the Issue
When I start an agent in the format of
```sh
consul connect proxy \
-register \
-service zookeeper-2181-10-126-0-144 \
-service-addr 127.0.0.1:2181 \
-listen 0.0.0.0:10000 \
-log-level TRACE
```
It receives a warning:
```
proxy: Failed to register Consul service: Unexpected response code: 400 (Invalid service address)
```
I am very literally following the example on [`consul connect proxy`](https://www.consul.io/docs/commands/connect/proxy.html) docs. I have attempted to not use the `-register` flag, but this just results in the remote `-upstream` being unable to locate the proxy, as well as the service not appearing in the `consul catalog services`.
#### Reproduction Steps
Steps to reproduce this issue, eg:
1. Create a 5 node cluster, with all members sharing the same gossip key, with connect enabled.
2. Validate the servers are synchronized with `consul info` and `consul catalog nodes`.
3. Start a proxy outlined in the manner above.
### Consul info for both Client and Server
Client info
```
agent:
check_monitors = 0
check_ttls = 0
checks = 0
services = 0
build:
prerelease =
revision = 40cec984
version = 1.5.1
consul:
acl = disabled
bootstrap = false
known_datacenters = 1
leader = false
leader_addr = 10.126.0.178:8300
server = true
raft:
applied_index = 242
commit_index = 242
fsm_pending = 0
last_contact = 23.634109ms
last_log_index = 242
last_log_term = 2
last_snapshot_index = 0
last_snapshot_term = 0
latest_configuration = [{Suffrage:Voter ID:34fad472-7150-7b4c-37be-d87cd79c32f8 Address:10.126.0.150:8300} {Suffrage:Voter ID:7c71b1d3-53d7-9a2f-de93$
f0a54e4cc6e3 Address:10.126.0.144:8300} {Suffrage:Voter ID:bc83ee85-ba45-0183-df54-542cff33e0ab Address:10.126.0.178:8300} {Suffrage:Voter ID:b782e7b3-e5e1-b$
14-ff79-15db607a6157 Address:10.126.0.145:8300} {Suffrage:Voter ID:d8df8d5c-2ff4-6962-e5c8-2531199c0be5 Address:10.126.0.146:8300}]
latest_configuration_index = 1
num_peers = 4
protocol_version = 3
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 2
runtime:
arch = amd64
cpu_count = 2
goroutines = 137
max_procs = 2
os = linux
version = go1.12.1
serf_lan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 2
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 10
members = 5
query_queue = 0
query_time = 1
serf_wan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 13
members = 5
query_queue = 0
query_time = 1
```
Server info
```
agent:
check_monitors = 0
check_ttls = 0
checks = 0
services = 0
build:
prerelease =
revision = 40cec984
version = 1.5.1
consul:
acl = disabled
bootstrap = false
known_datacenters = 1
leader = false
leader_addr = 10.126.0.178:8300
server = true
raft:
applied_index = 242
commit_index = 242
fsm_pending = 0
last_contact = 23.634109ms
last_log_index = 242
last_log_term = 2
last_snapshot_index = 0
last_snapshot_term = 0
latest_configuration = [{Suffrage:Voter ID:34fad472-7150-7b4c-37be-d87cd79c32f8 Address:10.126.0.150:8300} {Suffrage:Voter ID:7c71b1d3-53d7-9a2f-de93$
f0a54e4cc6e3 Address:10.126.0.144:8300} {Suffrage:Voter ID:bc83ee85-ba45-0183-df54-542cff33e0ab Address:10.126.0.178:8300} {Suffrage:Voter ID:b782e7b3-e5e1-b$
14-ff79-15db607a6157 Address:10.126.0.145:8300} {Suffrage:Voter ID:d8df8d5c-2ff4-6962-e5c8-2531199c0be5 Address:10.126.0.146:8300}]
latest_configuration_index = 1
num_peers = 4
protocol_version = 3
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 2
runtime:
arch = amd64
cpu_count = 2
goroutines = 137
max_procs = 2
os = linux
version = go1.12.1
serf_lan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 2
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 10
members = 5
query_queue = 0
query_time = 1
serf_wan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 13
members = 5
query_queue = 0
query_time = 1
```
Server Config
```
{
"addresses": {
"dns": "0.0.0.0",
"http": "127.0.0.1",
"https": "0.0.0.0",
"grpc": "0.0.0.0"
},
"bootstrap_expect": 5,
"ca_file": "/opt/consul/certs/ca_cert.pem",
"cert_file": "/opt/consul/certs/local_cert.pem",
"data_dir": "/opt/consul/data",
"discard_check_output": null,
"discovery_max_stale": null,
"enable_script_checks": false,
"enable_local_script_checks": false,
"encrypt": "72Tle7Mf5E72Zpq/cLz9+g==",
"encrypt_verify_incoming": true,
"encrypt_verify_outgoing": true,
"key_file": "/opt/consul/certs/local_key.pem",
"log_level": "DEBUG",
"log_file": "/opt/consul/log/consul.log",
"log_rotate_bytes": 1048576,
"pid_file": "/opt/consul/consul.pid",
"ports": {},
"retry_join": [
"10.126.0.146",
"10.126.0.150",
"10.126.0.144",
"10.126.0.145",
"10.126.0.178"
],
"server": true,
"start_join": [
"10.126.0.146",
"10.126.0.150",
"10.126.0.144",
"10.126.0.145",
"10.126.0.178"
],
"verify_incoming": true,
"verify_incoming_https": true,
"verify_incoming_rpc": true,
"verify_outgoing": true,
"connect": {
"ca_config": {
"private_key": null,
"root_cert": null,
"csr_max_per_second": null,
"csr_max_concurrent": null,
"leaf_cert_ttl": null
},
"ca_provider": null,
"enabled": true
}
}
```
### Operating system and Environment details
AMD64, CentOS7.X
Contributor guide
Assessment
This issue has not been assessed yet.