Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect configuration allows for the proxy configuration to bind to 0.0.0.0 #4301

Closed
moritzheiber opened this issue Jun 27, 2018 · 3 comments
Milestone

Comments

@moritzheiber
Copy link

Overview of the Issue

When running Consul Connect using a managed proxy, the bind address for the proxy is set to what's advertised to the cluster members as the address to reach the agent with:

bind = 10.120.0.254

will have the proxy bound to 10.120.0.254.

However, when -bind is not used, but rather -client and -advertise, the proxy listen address defaults to 0.0.0.0, which will never be reachable by any health check or client request.

After discussing this with @banks he mentioned that it would be better to default to 127.0.0.1 instead, or the first usable private IP(v4|v6) address, as done with the other bind assignment statements.

Reproduction Steps

Steps to reproduce this issue, eg:

  1. Run a cluster with a single server and agent
  2. Bind the agent's client interface to 0.0.0.0, -advertise to the cluster with the first IP(v4|v6) address
  3. Create a service with connect enabled, e.g.
service {
  id = "service1"
  name = "service"
  address = "<service-ip>"
  port = <service-port>
  check {
    tcp = "<service-ip>:<service-port>"
    interval = "10s"
    timeout = "5s"
  }

  connect {
    proxy {}
  }
}
  1. Observe the health check for the service failing since it tries to reach the proxy at `0.0.0.0:

Consul info for both Client and Server

Client info
{
  "Config": {
    "Datacenter": "dc1",
    "NodeName": "client",
    "NodeID": "28b33ac3-516b-c607-5134-e5b75c443019",
    "Revision": "28141971",
    "Server": false,
    "Version": "1.2.0"
  },
  "DebugConfig": {
    "ACLAgentMasterToken": "hidden",
    "ACLAgentToken": "hidden",
    "ACLDatacenter": "",
    "ACLDefaultPolicy": "allow",
    "ACLDisabledTTL": "2m0s",
    "ACLDownPolicy": "extend-cache",
    "ACLEnableKeyListPolicy": false,
    "ACLEnforceVersion8": true,
    "ACLMasterToken": "hidden",
    "ACLReplicationToken": "hidden",
    "ACLTTL": "30s",
    "ACLToken": "hidden",
    "AEInterval": "1m0s",
    "AdvertiseAddrLAN": "10.120.0.3",
    "AdvertiseAddrWAN": "10.120.0.3",
    "AutopilotCleanupDeadServers": true,
    "AutopilotDisableUpgradeMigration": false,
    "AutopilotLastContactThreshold": "200ms",
    "AutopilotMaxTrailingLogs": 250,
    "AutopilotRedundancyZoneTag": "",
    "AutopilotServerStabilizationTime": "10s",
    "AutopilotUpgradeVersionTag": "",
    "BindAddr": "10.120.0.3",
    "Bootstrap": false,
    "BootstrapExpect": 0,
    "CAFile": "",
    "CAPath": "",
    "CertFile": "",
    "CheckDeregisterIntervalMin": "1m0s",
    "CheckReapInterval": "30s",
    "CheckUpdateInterval": "5m0s",
    "Checks": [],
    "ClientAddrs": [
      "10.122.0.254"
    ],
    "ConnectCAConfig": {},
    "ConnectCAProvider": "",
    "ConnectEnabled": true,
    "ConnectProxyAllowManagedAPIRegistration": false,
    "ConnectProxyAllowManagedRoot": false,
    "ConnectProxyBindMaxPort": 20255,
    "ConnectProxyBindMinPort": 20000,
    "ConnectProxyDefaultConfig": {},
    "ConnectProxyDefaultDaemonCommand": [],
    "ConnectProxyDefaultExecMode": "",
    "ConnectProxyDefaultScriptCommand": [],
    "ConnectTestDisableManagedProxies": false,
    "ConsulCoordinateUpdateBatchSize": 128,
    "ConsulCoordinateUpdateMaxBatches": 5,
    "ConsulCoordinateUpdatePeriod": "5s",
    "ConsulRaftElectionTimeout": "5s",
    "ConsulRaftHeartbeatTimeout": "5s",
    "ConsulRaftLeaderLeaseTimeout": "2.5s",
    "ConsulSerfLANGossipInterval": "200ms",
    "ConsulSerfLANProbeInterval": "1s",
    "ConsulSerfLANProbeTimeout": "500ms",
    "ConsulSerfLANSuspicionMult": 4,
    "ConsulSerfWANGossipInterval": "500ms",
    "ConsulSerfWANProbeInterval": "5s",
    "ConsulSerfWANProbeTimeout": "3s",
    "ConsulSerfWANSuspicionMult": 6,
    "ConsulServerHealthInterval": "2s",
    "DNSARecordLimit": 0,
    "DNSAddrs": [
      "tcp://10.122.0.254:53",
      "udp://10.122.0.254:53"
    ],
    "DNSAllowStale": true,
    "DNSDisableCompression": false,
    "DNSDomain": "consul.",
    "DNSEnableTruncate": false,
    "DNSMaxStale": "87600h0m0s",
    "DNSNodeMetaTXT": true,
    "DNSNodeTTL": "0s",
    "DNSOnlyPassing": false,
    "DNSPort": 53,
    "DNSRecursorTimeout": "2s",
    "DNSRecursors": [],
    "DNSServiceTTL": {},
    "DNSUDPAnswerLimit": 3,
    "DataDir": "/tmp/state",
    "Datacenter": "dc1",
    "DevMode": false,
    "DisableAnonymousSignature": false,
    "DisableCoordinates": false,
    "DisableHostNodeID": true,
    "DisableKeyringFile": false,
    "DisableRemoteExec": true,
    "DisableUpdateCheck": true,
    "DiscardCheckOutput": false,
    "DiscoveryMaxStale": "0s",
    "EnableACLReplication": false,
    "EnableAgentTLSForChecks": false,
    "EnableDebug": false,
    "EnableScriptChecks": false,
    "EnableSyslog": false,
    "EnableUI": false,
    "EncryptKey": "hidden",
    "EncryptVerifyIncoming": true,
    "EncryptVerifyOutgoing": true,
    "HTTPAddrs": [
      "tcp://10.122.0.254:8500"
    ],
    "HTTPBlockEndpoints": [],
    "HTTPPort": 8500,
    "HTTPResponseHeaders": {},
    "HTTPSAddrs": [],
    "HTTPSPort": -1,
    "KeyFile": "hidden",
    "LeaveDrainTime": "5s",
    "LeaveOnTerm": true,
    "LogLevel": "debug",
    "NodeID": "28b33ac3-516b-c607-5134-e5b75c443019",
    "NodeMeta": {},
    "NodeName": "client",
    "NonVotingServer": false,
    "PidFile": "",
    "RPCAdvertiseAddr": "tcp://10.120.0.3:8300",
    "RPCBindAddr": "tcp://10.120.0.3:8300",
    "RPCHoldTimeout": "7s",
    "RPCMaxBurst": 1000,
    "RPCProtocol": 2,
    "RPCRateLimit": -1,
    "RaftProtocol": 0,
    "RaftSnapshotInterval": "0s",
    "RaftSnapshotThreshold": 0,
    "ReconnectTimeoutLAN": "0s",
    "ReconnectTimeoutWAN": "0s",
    "RejoinAfterLeave": false,
    "RetryJoinIntervalLAN": "30s",
    "RetryJoinIntervalWAN": "30s",
    "RetryJoinLAN": [],
    "RetryJoinMaxAttemptsLAN": 0,
    "RetryJoinMaxAttemptsWAN": 0,
    "RetryJoinWAN": [],
    "Revision": "28141971",
    "SegmentLimit": 64,
    "SegmentName": "",
    "SegmentNameLimit": 64,
    "Segments": [],
    "SerfAdvertiseAddrLAN": "tcp://10.120.0.3:8301",
    "SerfAdvertiseAddrWAN": "tcp://10.120.0.3:8302",
    "SerfBindAddrLAN": "tcp://10.120.0.3:8301",
    "SerfBindAddrWAN": "tcp://10.120.0.3:8302",
    "SerfPortLAN": 8301,
    "SerfPortWAN": 8302,
    "ServerMode": false,
    "ServerName": "",
    "ServerPort": 8300,
    "Services": [],
    "SessionTTLMin": "0s",
    "SkipLeaveOnInt": false,
    "StartJoinAddrsLAN": [
      "server"
    ],
    "StartJoinAddrsWAN": [],
    "SyncCoordinateIntervalMin": "15s",
    "SyncCoordinateRateTarget": 64,
    "SyslogFacility": "LOCAL0",
    "TLSCipherSuites": [],
    "TLSMinVersion": "tls10",
    "TLSPreferServerCipherSuites": false,
    "TaggedAddresses": {
      "lan": "10.120.0.3",
      "wan": "10.120.0.3"
    },
    "Telemetry": {
      "AllowedPrefixes": [],
      "BlockedPrefixes": [],
      "CirconusAPIApp": "",
      "CirconusAPIToken": "hidden",
      "CirconusAPIURL": "",
      "CirconusBrokerID": "",
      "CirconusBrokerSelectTag": "",
      "CirconusCheckDisplayName": "",
      "CirconusCheckForceMetricActivation": "",
      "CirconusCheckID": "",
      "CirconusCheckInstanceID": "",
      "CirconusCheckSearchTag": "",
      "CirconusCheckTags": "",
      "CirconusSubmissionInterval": "",
      "CirconusSubmissionURL": "",
      "DisableHostname": false,
      "DogstatsdAddr": "",
      "DogstatsdTags": [],
      "FilterDefault": true,
      "MetricsPrefix": "consul",
      "PrometheusRetentionTime": "0s",
      "StatsdAddr": "",
      "StatsiteAddr": ""
    },
    "TranslateWANAddrs": false,
    "UIDir": "",
    "UnixSocketGroup": "",
    "UnixSocketMode": "",
    "UnixSocketUser": "",
    "VerifyIncoming": false,
    "VerifyIncomingHTTPS": false,
    "VerifyIncomingRPC": false,
    "VerifyOutgoing": false,
    "VerifyServerHostname": false,
    "Version": "1.2.0",
    "VersionPrerelease": "",
    "Watches": []
  },
  "Coord": {
    "Vec": [
      0.0008324939442918672,
      -0.00028306426755068443,
      0.0007554164691745695,
      0.0007911856257548772,
      -0.0009268348307279085,
      -0.0007047659235969269,
      0.0007786183440006148,
      0.0006193891410228073
    ],
    "Error": 0.1055598069115172,
    "Adjustment": 6.158745296109508e-05,
    "Height": 7.990631334555574e-05
  },
  "Member": {
    "Name": "client",
    "Addr": "10.120.0.3",
    "Port": 8301,
    "Tags": {
      "build": "1.2.0:28141971",
      "dc": "dc1",
      "id": "28b33ac3-516b-c607-5134-e5b75c443019",
      "role": "node",
      "segment": "",
      "vsn": "2",
      "vsn_max": "3",
      "vsn_min": "2"
    },
    "Status": 1,
    "ProtocolMin": 1,
    "ProtocolMax": 5,
    "ProtocolCur": 2,
    "DelegateMin": 2,
    "DelegateMax": 5,
    "DelegateCur": 4
  },
  "Stats": {
    "agent": {
      "check_monitors": "0",
      "check_ttls": "0",
      "checks": "0",
      "services": "0"
    },
    "build": {
      "prerelease": "",
      "revision": "28141971",
      "version": "1.2.0"
    },
    "consul": {
      "known_servers": "1",
      "server": "false"
    },
    "runtime": {
      "arch": "amd64",
      "cpu_count": "8",
      "goroutines": "42",
      "max_procs": "8",
      "os": "linux",
      "version": "go1.10.1"
    },
    "serf_lan": {
      "coordinate_resets": "0",
      "encrypted": "false",
      "event_queue": "0",
      "event_time": "2",
      "failed": "0",
      "health_score": "0",
      "intent_queue": "0",
      "left": "0",
      "member_time": "3",
      "members": "3",
      "query_queue": "0",
      "query_time": "1"
    }
  },
  "Meta": {
    "consul-network-segment": ""
  }
}
Server info
{
  "Config": {
    "Datacenter": "dc1",
    "NodeName": "9141ba346022",
    "NodeID": "f89f3872-2383-1ab6-8b9d-508a981627b9",
    "Revision": "28141971",
    "Server": true,
    "Version": "1.2.0"
  },
  "DebugConfig": {
    "ACLAgentMasterToken": "hidden",
    "ACLAgentToken": "hidden",
    "ACLDatacenter": "",
    "ACLDefaultPolicy": "allow",
    "ACLDisabledTTL": "2m0s",
    "ACLDownPolicy": "extend-cache",
    "ACLEnableKeyListPolicy": false,
    "ACLEnforceVersion8": true,
    "ACLMasterToken": "hidden",
    "ACLReplicationToken": "hidden",
    "ACLTTL": "30s",
    "ACLToken": "hidden",
    "AEInterval": "1m0s",
    "AdvertiseAddrLAN": "10.120.0.2",
    "AdvertiseAddrWAN": "10.120.0.2",
    "AutopilotCleanupDeadServers": true,
    "AutopilotDisableUpgradeMigration": false,
    "AutopilotLastContactThreshold": "200ms",
    "AutopilotMaxTrailingLogs": 250,
    "AutopilotRedundancyZoneTag": "",
    "AutopilotServerStabilizationTime": "10s",
    "AutopilotUpgradeVersionTag": "",
    "BindAddr": "0.0.0.0",
    "Bootstrap": true,
    "BootstrapExpect": 0,
    "CAFile": "",
    "CAPath": "",
    "CertFile": "",
    "CheckDeregisterIntervalMin": "1m0s",
    "CheckReapInterval": "30s",
    "CheckUpdateInterval": "5m0s",
    "Checks": [],
    "ClientAddrs": [
      "0.0.0.0"
    ],
    "ConnectCAConfig": {},
    "ConnectCAProvider": "",
    "ConnectEnabled": true,
    "ConnectProxyAllowManagedAPIRegistration": false,
    "ConnectProxyAllowManagedRoot": false,
    "ConnectProxyBindMaxPort": 20255,
    "ConnectProxyBindMinPort": 20000,
    "ConnectProxyDefaultConfig": {},
    "ConnectProxyDefaultDaemonCommand": [],
    "ConnectProxyDefaultExecMode": "",
    "ConnectProxyDefaultScriptCommand": [],
    "ConnectTestDisableManagedProxies": false,
    "ConsulCoordinateUpdateBatchSize": 128,
    "ConsulCoordinateUpdateMaxBatches": 5,
    "ConsulCoordinateUpdatePeriod": "5s",
    "ConsulRaftElectionTimeout": "5s",
    "ConsulRaftHeartbeatTimeout": "5s",
    "ConsulRaftLeaderLeaseTimeout": "2.5s",
    "ConsulSerfLANGossipInterval": "200ms",
    "ConsulSerfLANProbeInterval": "1s",
    "ConsulSerfLANProbeTimeout": "500ms",
    "ConsulSerfLANSuspicionMult": 4,
    "ConsulSerfWANGossipInterval": "500ms",
    "ConsulSerfWANProbeInterval": "5s",
    "ConsulSerfWANProbeTimeout": "3s",
    "ConsulSerfWANSuspicionMult": 6,
    "ConsulServerHealthInterval": "2s",
    "DNSARecordLimit": 0,
    "DNSAddrs": [
      "tcp://0.0.0.0:8600",
      "udp://0.0.0.0:8600"
    ],
    "DNSAllowStale": true,
    "DNSDisableCompression": false,
    "DNSDomain": "consul.",
    "DNSEnableTruncate": false,
    "DNSMaxStale": "87600h0m0s",
    "DNSNodeMetaTXT": true,
    "DNSNodeTTL": "0s",
    "DNSOnlyPassing": false,
    "DNSPort": 8600,
    "DNSRecursorTimeout": "2s",
    "DNSRecursors": [],
    "DNSServiceTTL": {},
    "DNSUDPAnswerLimit": 3,
    "DataDir": "/tmp/state",
    "Datacenter": "dc1",
    "DevMode": false,
    "DisableAnonymousSignature": false,
    "DisableCoordinates": false,
    "DisableHostNodeID": true,
    "DisableKeyringFile": false,
    "DisableRemoteExec": true,
    "DisableUpdateCheck": true,
    "DiscardCheckOutput": false,
    "DiscoveryMaxStale": "0s",
    "EnableACLReplication": false,
    "EnableAgentTLSForChecks": false,
    "EnableDebug": false,
    "EnableScriptChecks": false,
    "EnableSyslog": false,
    "EnableUI": true,
    "EncryptKey": "hidden",
    "EncryptVerifyIncoming": true,
    "EncryptVerifyOutgoing": true,
    "HTTPAddrs": [
      "tcp://0.0.0.0:8500"
    ],
    "HTTPBlockEndpoints": [],
    "HTTPPort": 8500,
    "HTTPResponseHeaders": {},
    "HTTPSAddrs": [],
    "HTTPSPort": -1,
    "KeyFile": "hidden",
    "LeaveDrainTime": "5s",
    "LeaveOnTerm": false,
    "LogLevel": "debug",
    "NodeID": "f89f3872-2383-1ab6-8b9d-508a981627b9",
    "NodeMeta": {},
    "NodeName": "9141ba346022",
    "NonVotingServer": false,
    "PidFile": "",
    "RPCAdvertiseAddr": "tcp://10.120.0.2:8300",
    "RPCBindAddr": "tcp://0.0.0.0:8300",
    "RPCHoldTimeout": "7s",
    "RPCMaxBurst": 1000,
    "RPCProtocol": 2,
    "RPCRateLimit": -1,
    "RaftProtocol": 0,
    "RaftSnapshotInterval": "0s",
    "RaftSnapshotThreshold": 0,
    "ReconnectTimeoutLAN": "0s",
    "ReconnectTimeoutWAN": "0s",
    "RejoinAfterLeave": false,
    "RetryJoinIntervalLAN": "30s",
    "RetryJoinIntervalWAN": "30s",
    "RetryJoinLAN": [],
    "RetryJoinMaxAttemptsLAN": 0,
    "RetryJoinMaxAttemptsWAN": 0,
    "RetryJoinWAN": [],
    "Revision": "28141971",
    "SegmentLimit": 64,
    "SegmentName": "",
    "SegmentNameLimit": 64,
    "Segments": [],
    "SerfAdvertiseAddrLAN": "tcp://10.120.0.2:8301",
    "SerfAdvertiseAddrWAN": "tcp://10.120.0.2:8302",
    "SerfBindAddrLAN": "tcp://0.0.0.0:8301",
    "SerfBindAddrWAN": "tcp://0.0.0.0:8302",
    "SerfPortLAN": 8301,
    "SerfPortWAN": 8302,
    "ServerMode": true,
    "ServerName": "",
    "ServerPort": 8300,
    "Services": [],
    "SessionTTLMin": "0s",
    "SkipLeaveOnInt": true,
    "StartJoinAddrsLAN": [],
    "StartJoinAddrsWAN": [],
    "SyncCoordinateIntervalMin": "15s",
    "SyncCoordinateRateTarget": 64,
    "SyslogFacility": "LOCAL0",
    "TLSCipherSuites": [],
    "TLSMinVersion": "tls10",
    "TLSPreferServerCipherSuites": false,
    "TaggedAddresses": {
      "lan": "10.120.0.2",
      "wan": "10.120.0.2"
    },
    "Telemetry": {
      "AllowedPrefixes": [],
      "BlockedPrefixes": [],
      "CirconusAPIApp": "",
      "CirconusAPIToken": "hidden",
      "CirconusAPIURL": "",
      "CirconusBrokerID": "",
      "CirconusBrokerSelectTag": "",
      "CirconusCheckDisplayName": "",
      "CirconusCheckForceMetricActivation": "",
      "CirconusCheckID": "",
      "CirconusCheckInstanceID": "",
      "CirconusCheckSearchTag": "",
      "CirconusCheckTags": "",
      "CirconusSubmissionInterval": "",
      "CirconusSubmissionURL": "",
      "DisableHostname": false,
      "DogstatsdAddr": "",
      "DogstatsdTags": [],
      "FilterDefault": true,
      "MetricsPrefix": "consul",
      "PrometheusRetentionTime": "0s",
      "StatsdAddr": "",
      "StatsiteAddr": ""
    },
    "TranslateWANAddrs": false,
    "UIDir": "",
    "UnixSocketGroup": "",
    "UnixSocketMode": "",
    "UnixSocketUser": "",
    "VerifyIncoming": false,
    "VerifyIncomingHTTPS": false,
    "VerifyIncomingRPC": false,
    "VerifyOutgoing": false,
    "VerifyServerHostname": false,
    "Version": "1.2.0",
    "VersionPrerelease": "",
    "Watches": []
  },
  "Coord": {
    "Vec": [
      0.0009014778824266313,
      -0.00030652015931686863,
      0.0008180134448602458,
      0.0008567465831551515,
      -0.0010036362505524829,
      -0.0007631657822214093,
      0.0008431379237426745,
      0.0006707143215508339
    ],
    "Error": 0.09250218613292863,
    "Adjustment": -1.0277818734608966e-05,
    "Height": 0.0003106500250558137
  },
  "Member": {
    "Name": "9141ba346022",
    "Addr": "10.120.0.2",
    "Port": 8301,
    "Tags": {
      "bootstrap": "1",
      "build": "1.2.0:28141971",
      "dc": "dc1",
      "id": "f89f3872-2383-1ab6-8b9d-508a981627b9",
      "port": "8300",
      "raft_vsn": "3",
      "role": "consul",
      "segment": "",
      "vsn": "2",
      "vsn_max": "3",
      "vsn_min": "2",
      "wan_join_port": "8302"
    },
    "Status": 1,
    "ProtocolMin": 1,
    "ProtocolMax": 5,
    "ProtocolCur": 2,
    "DelegateMin": 2,
    "DelegateMax": 5,
    "DelegateCur": 4
  },
  "Stats": {
    "agent": {
      "check_monitors": "0",
      "check_ttls": "0",
      "checks": "0",
      "services": "0"
    },
    "build": {
      "prerelease": "",
      "revision": "28141971",
      "version": "1.2.0"
    },
    "consul": {
      "bootstrap": "true",
      "known_datacenters": "1",
      "leader": "true",
      "leader_addr": "10.120.0.2:8300",
      "server": "true"
    },
    "raft": {
      "applied_index": "147",
      "commit_index": "147",
      "fsm_pending": "0",
      "last_contact": "0",
      "last_log_index": "147",
      "last_log_term": "2",
      "last_snapshot_index": "0",
      "last_snapshot_term": "0",
      "latest_configuration": "[{Suffrage:Voter ID:f89f3872-2383-1ab6-8b9d-508a981627b9 Address:10.120.0.2:8300}]",
      "latest_configuration_index": "1",
      "num_peers": "0",
      "protocol_version": "3",
      "protocol_version_max": "3",
      "protocol_version_min": "0",
      "snapshot_version_max": "1",
      "snapshot_version_min": "0",
      "state": "Leader",
      "term": "2"
    },
    "runtime": {
      "arch": "amd64",
      "cpu_count": "8",
      "goroutines": "85",
      "max_procs": "8",
      "os": "linux",
      "version": "go1.10.1"
    },
    "serf_lan": {
      "coordinate_resets": "0",
      "encrypted": "false",
      "event_queue": "0",
      "event_time": "2",
      "failed": "0",
      "health_score": "0",
      "intent_queue": "0",
      "left": "0",
      "member_time": "3",
      "members": "3",
      "query_queue": "0",
      "query_time": "1"
    },
    "serf_wan": {
      "coordinate_resets": "0",
      "encrypted": "false",
      "event_queue": "0",
      "event_time": "1",
      "failed": "0",
      "health_score": "0",
      "intent_queue": "0",
      "left": "0",
      "member_time": "1",
      "members": "1",
      "query_queue": "0",
      "query_time": "1"
    }
  },
  "Meta": {
    "consul-network-segment": ""
  }
}

Operating system and Environment details

Running inside a container using Alpine Linux 3.7 and the latest binaries from releases.hashicorp.com.

Log Fragments

db-agent_1      |     2018/06/27 11:51:03 [INFO] agent: Synced service "postgres"
db-agent_1      |     2018/06/27 11:51:03 [DEBUG] agent: Service "postgres-proxy" in sync
db-agent_1      |     2018/06/27 11:51:03 [DEBUG] agent: Check "service:postgres" in sync
db-agent_1      |     2018/06/27 11:51:03 [DEBUG] agent: Check "service:postgres-proxy" in sync
db-agent_1      |     2018/06/27 11:51:03 [DEBUG] agent: Node info in sync
db-agent_1      |     2018/06/27 11:51:08 [DEBUG] agent: Check "service:postgres" is passing
db-agent_1      |     2018/06/27 11:51:12 [DEBUG] memberlist: Initiating push/pull sync with: 10.120.0.2:8301
db-agent_1      |     2018/06/27 11:51:13 [WARN] agent: Check "service:postgres-proxy" socket connection failed: dial tcp 0.0.0.0:20067: connect: connection refused
@yanghuijava
Copy link

I also encountered the same problem, the configuration is almost the same as yours. Have you solved it?

@banks
Copy link
Member

banks commented Jul 12, 2018

Not fixed yet but there is a work-around: if you manually specify the proxy-bind address you can make it what you want. This is only an issue if you rely on it default to the agent's bind address and that happens to be 0.0.0.0.

So to fix it register a proxy like:

service {
  // ...
  connect {
    proxy {
      config {
        bind_address = "10.1.1.1"
      }
    }
  }
}

Note that it's not possible until we fix this to have proxy bind to 0.0.0.0 as it's health check will fail. The fix is trivial though and should be out within a few weeks.

@banks banks added this to the Upcoming milestone Jul 12, 2018
@moritzheiber
Copy link
Author

Thanks Paul!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants