Consul: dev mode agent error getting server health - rpc error getting client - context deadline exceeded

Created on 1 Aug 2018  路  2Comments  路  Source: hashicorp/consul

Overview of the Issue

Getting log spam seeming to indicate there's a problem with the RPC server address. I'm trying to bind to 0.0.0.0 but advertise the private IP using {{ GetPrivateIP }} as shown below.

    2018/08/01 01:30:35 [WARN] consul: error getting server health from "mac": rpc error getting client: failed to get conn: dial tcp 127.0.0.1:0->192.168.20.100:8300: connect: connection refused
    2018/08/01 01:30:36 [WARN] consul: error getting server health from "mac": context deadline exceeded

Reproduction Steps

Steps to reproduce this issue, eg:

  1. create local dev mode agent with following args (pulled from plist):
/opt/consul/local/bin/consul
agent
-dev
-client 0.0.0.0
-advertise {{ GetPrivateIP }}
-node mac
-node-id c69d9705-76d9-4804-a2ed-d30b452b769d
-datacenter local
-dns-port 8600
-http-port 8500
-serf-lan-port 8301
-serf-wan-port 8302
-server-port 8300
  1. start the agent

Consul info for Client/Server


Client/Server info

agent:
    check_monitors = 0
    check_ttls = 0
    checks = 0
    services = 2
build:
    prerelease =
    revision = e716d1b5
    version = 1.2.2
consul:
    bootstrap = false
    known_datacenters = 1
    leader = true
    leader_addr = 192.168.20.100:8300
    server = true
raft:
    applied_index = 229
    commit_index = 229
    fsm_pending = 0
    last_contact = 0
    last_log_index = 229
    last_log_term = 2
    last_snapshot_index = 0
    last_snapshot_term = 0
    latest_configuration = [{Suffrage:Voter ID:c69d9705-76d9-4804-a2ed-d30b452b769d Address:192.168.20.100: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 = 67
    max_procs = 8
    os = darwin
    version = go1.10.1
serf_lan:
    coordinate_resets = 0
    encrypted = false
    event_queue = 1
    event_time = 2
    failed = 0
    health_score = 0
    intent_queue = 0
    left = 0
    member_time = 1
    members = 1
    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

Operating system and Environment details

OS, Architecture, and any other information you can provide
about the environment.

OS X 10.13.6

Log Fragments

Include appropriate Client or Server log fragments.
If the log is longer than a few dozen lines, please
include the URL to the gist
of the log instead of posting it in the issue.

https://gist.github.com/eedwards-sk/6faf3e7506a0f86c02d6d6fc018f19eb

Most helpful comment

I believe I solved this.

Changed from using

-client 0.0.0.0
-advertise {{ GetPrivateIP }}

to

-bind 0.0.0.0
-client 0.0.0.0

and now I seem to be able to resolve from localhost and the lan IP

All 2 comments

I believe I solved this.

Changed from using

-client 0.0.0.0
-advertise {{ GetPrivateIP }}

to

-bind 0.0.0.0
-client 0.0.0.0

and now I seem to be able to resolve from localhost and the lan IP

version 1.8.4
had the same issue, and resolve it by using bind instead of advertise
# consul agent -dev -bind IP_ADDR

Was this page helpful?
0 / 5 - 0 ratings

Related issues

satheeshCharles picture satheeshCharles  路  3Comments

runswithd6s picture runswithd6s  路  3Comments

lmb picture lmb  路  4Comments

hooksie1 picture hooksie1  路  3Comments

darron picture darron  路  4Comments