consul icon indicating copy to clipboard operation
consul copied to clipboard

logs are full of "memberlist: Failed to receive remote state: EOF"

Open petemounce opened this issue 11 years ago • 26 comments

I am running consul 0.4.1 in EC2, on Amazon Linux ami-607bd917 (eu-west-1, t2.micro, naked; no yum updates), and my consul logs are full of [ERR] memberlist: Failed to receive remote state: EOF. Is this something I need to be concerned with? My cluster appears to bootstrap fine, and then kv, services and checks seem to work.

Log extract (IPs changed for privacy)

==> WARNING: Expect Mode enabled, expecting 3 servers
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
         Node name: 'ip-10-10-10-1'
        Datacenter: 'eu-west-1'
            Server: true (bootstrap: false)
       Client Addr: 127.0.0.1 (HTTP: 8500, DNS: 8600, RPC: 8400)
      Cluster Addr: 10.10.10.23 (LAN: 8301, WAN: 8302)
    Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false

==> Log data will now stream in as it occurs:

    2015/01/13 10:50:49 [INFO] serf: EventMemberJoin: ip-10-10-10-1 10.10.10.23
    2015/01/13 10:50:49 [INFO] serf: EventMemberJoin: ip-10-10-10-1.eu-west-1 10.10.10.23
    2015/01/13 10:50:49 [INFO] raft: Node at 10.10.10.23:8300 [Follower] entering Follower state
    2015/01/13 10:50:49 [INFO] consul: adding server ip-10-10-10-1 (Addr: 10.10.10.23:8300) (DC: eu-west-1)
    2015/01/13 10:50:49 [INFO] consul: adding server ip-10-10-10-1.eu-west-1 (Addr: 10.10.10.23:8300) (DC: eu-west-1)
    2015/01/13 10:50:49 [ERR] agent: failed to sync remote state: No cluster leader
    2015/01/13 10:50:51 [WARN] raft: EnableSingleNode disabled, and no known peers. Aborting election.
    2015/01/13 10:50:52 [ERR] memberlist: Failed to receive remote state: EOF
    2015/01/13 10:50:52 [ERR] memberlist: Failed to receive remote state: EOF
    2015/01/13 10:50:52 [ERR] memberlist: Failed to receive remote state: EOF
    2015/01/13 10:50:54 [INFO] agent.rpc: Accepted client: 127.0.0.1:50691
    2015/01/13 10:50:54 [INFO] agent: (LAN) joining: [10.10.10.23 10.10.0.24]

petemounce avatar Jan 13 '15 11:01 petemounce

If that happens often it is probably cause for concern. Generally it implies a networking problem, but it could also mean things like one side has gossip encryption enabled. If it is sporadic, it may be a transient issue that can be ignored.

armon avatar Jan 14 '15 18:01 armon

It's constant. No gossip encryption is set up yet.

Am in AWS, and will post security group rules later (on train now).

Do you use gitter.im...?

Sent from my phone. Please excuse typos and brevity, but never text speak. On 14 Jan 2015 18:45, "Armon Dadgar" [email protected] wrote:

If that happens often it is probably cause for concern. Generally it implies a networking problem, but it could also mean things like one side has gossip encryption enabled. If it is sporadic, it may be a transient issue that can be ignored.

— Reply to this email directly or view it on GitHub https://github.com/hashicorp/consul/issues/598#issuecomment-69968016.

petemounce avatar Jan 14 '15 19:01 petemounce

The security groups dictate

Custom UDP Rule, UDP, 8400, 10.0.0.0/8
Custom TCP Rule, TCP, 8400, 10.0.0.0/8
Custom UDP Rule, UDP, 8600, 10.0.0.0/8
Custom TCP Rule, TCP, 8500, sg-3f09905a (je-securitygroups-qa13-consulElasticLoadBalancerEc2Sg-QDR9727ZNEPM)
Custom UDP Rule, UDP, 8500, 10.0.0.0/8
Custom TCP Rule, TCP, 8300 - 8302, 10.0.0.0/8
Custom TCP Rule, TCP, 8600, 10.0.0.0/8
Custom UDP Rule, UDP, 8300 - 8302, 10.0.0.0/8
Custom TCP Rule, TCP, 8500, 10.0.0.0/8
All TCP, TCP, 0 - 65535, 10.0.0.0/8
SSH, TCP, 22, 10.10.0.0/16
DNS, UDP, 53, 10.0.0.0/8
Custom TCP Rule, TCP, 53, 10.0.0.0/8

All servers are in the 10.0.0.0/8 CIDR, as are the agents (although I see the messages regardless of when there are agents connected or not).

Tangent: am I correct to think that the agents need all the same ports opening as the servers, so that servers can make ingress to the agents, or is that unnecessary?

Tangent 2: is port 53 unnecessary (at least, if I fail to find a way to get windows DNS to use the agent for DNS)?

petemounce avatar Jan 14 '15 22:01 petemounce

I also see 2015/01/14 22:42:46 [ERR] memberlist: Push/Pull with basketapi_001 failed: dial tcp 10.233.0.236:8301: i/o timeout every 40s. basketapi_001 is an agent, not a server.

petemounce avatar Jan 14 '15 23:01 petemounce

I should have said - t2.micro instances, 64-bit.

petemounce avatar Jan 14 '15 23:01 petemounce

I see Custom UDP Rule, UDP, 8300 - 8302, 10.0.0.0/8 but you need that for TCP as well!

armon avatar Jan 15 '15 01:01 armon

Tcp is on line 6 in the list.

petemounce avatar Jan 15 '15 08:01 petemounce

I missed that. I'm short on ideas. My only guess is a network issue, but hard to investigate further. tcpdump may be of use.

armon avatar Jan 20 '15 22:01 armon

I'm having almost the same issue, on EC2, these are docker containers running in CoreOS, so they're currently all started the same way via Cloudfoundry, startup cmd

                "         ExecStart=/usr/bin/docker run --name consul -h %H -v /data/consul:/data \\\n",
                "              -p 8300:8300 \\\n",
                "              -p 8301:8301 \\\n",
                "              -p 8301:8301/udp \\\n",
                "              -p 8302:8302 \\\n",
                "              -p 8302:8302/udp \\\n",
                "              -p 8400:8400 \\\n",
                "              -p 8500:8500 \\\n",
                "              -p 53:53/udp \\\n",
                "              progrium/consul:latest -server -advertise $", { "Ref": "AdvertisedIPAddress" }, "_ipv4 -bootstrap-expect 3\n",

Consul sees all members from within a container, here I've run it one after another to show that the one node came back alive.

bash-4.3# consul members
Node                         Address           Status  Type    Build  Protocol
ip-10-183-0-21.ec2.internal  10.183.0.21:8301  alive   server  0.4.1  2
ip-10-183-0-22.ec2.internal  10.183.0.22:8301  failed  server  0.4.1  2
ip-10-183-2-91.ec2.internal  10.183.2.91:8301  alive   server  0.4.1  2
ip-10-183-2-92.ec2.internal  10.183.2.92:8301  alive   server  0.4.1  2
bash-4.3# consul members
Node                         Address           Status  Type    Build  Protocol
ip-10-183-0-22.ec2.internal  10.183.0.22:8301  alive   server  0.4.1  2
ip-10-183-2-91.ec2.internal  10.183.2.91:8301  alive   server  0.4.1  2
ip-10-183-2-92.ec2.internal  10.183.2.92:8301  alive   server  0.4.1  2
ip-10-183-0-21.ec2.internal  10.183.0.21:8301  alive   server  0.4.1  2

But still nodes seem to drop out and reappear constantly

 2015/01/21 21:54:36 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:54:41 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:54:41 [INFO] memberlist: Marking ip-10-183-0-22.ec2.internal as failed, suspect timeout reached
    2015/01/21 21:54:41 [INFO] serf: EventMemberFailed: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:54:41 [INFO] consul: removing server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:54:41 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' failed, marking health critical
    2015/01/21 21:54:42 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:54:58 [INFO] serf: attempting reconnect to ip-10-183-0-22.ec2.internal 10.183.0.22:8301
    2015/01/21 21:54:58 [INFO] serf: EventMemberJoin: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:54:58 [INFO] consul: adding server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:54:58 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' joined, marking health alive
    2015/01/21 21:55:00 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:03 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:06 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:08 [INFO] memberlist: Marking ip-10-183-0-22.ec2.internal as failed, suspect timeout reached
    2015/01/21 21:55:08 [INFO] serf: EventMemberFailed: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:08 [INFO] consul: removing server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:08 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' failed, marking health critical
    2015/01/21 21:55:19 [INFO] serf: EventMemberJoin: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:19 [INFO] consul: adding server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:19 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' joined, marking health alive
    2015/01/21 21:55:24 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:26 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:26 [INFO] serf: EventMemberFailed: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:26 [INFO] consul: removing server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:26 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' failed, marking health critical
    2015/01/21 21:55:28 [INFO] serf: attempting reconnect to ip-10-183-0-22.ec2.internal 10.183.0.22:8301
    2015/01/21 21:55:28 [INFO] serf: EventMemberJoin: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:28 [INFO] consul: adding server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:28 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' joined, marking health alive
    2015/01/21 21:55:30 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:33 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:35 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:39 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:39 [INFO] memberlist: Marking ip-10-183-0-22.ec2.internal as failed, suspect timeout reached
    2015/01/21 21:55:39 [INFO] serf: EventMemberFailed: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:39 [INFO] consul: removing server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:39 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' failed, marking health critical
    2015/01/21 21:55:40 [INFO] serf: EventMemberJoin: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:40 [INFO] consul: adding server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:40 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' joined, marking health alive
    2015/01/21 21:55:43 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:44 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:44 [INFO] agent.rpc: Accepted client: 127.0.0.1:42545
    2015/01/21 21:55:49 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:49 [INFO] memberlist: Marking ip-10-183-0-22.ec2.internal as failed, suspect timeout reached
    2015/01/21 21:55:49 [INFO] serf: EventMemberFailed: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:49 [INFO] consul: removing server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:49 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' failed, marking health critical
    2015/01/21 21:55:50 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:55:55 [INFO] serf: EventMemberJoin: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:55:55 [INFO] consul: adding server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:55:55 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' joined, marking health alive
    2015/01/21 21:56:00 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:56:01 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:56:04 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:56:09 [INFO] memberlist: Suspect ip-10-183-0-22.ec2.internal has failed, no acks received
    2015/01/21 21:56:09 [INFO] memberlist: Marking ip-10-183-0-22.ec2.internal as failed, suspect timeout reached
    2015/01/21 21:56:09 [INFO] serf: EventMemberFailed: ip-10-183-0-22.ec2.internal 10.183.0.22
    2015/01/21 21:56:09 [INFO] consul: removing server ip-10-183-0-22.ec2.internal (Addr: 10.183.0.22:8300) (DC: dc1)
    2015/01/21 21:56:09 [INFO] consul: member 'ip-10-183-0-22.ec2.internal' failed, marking health critical

Is setting all to -server an issue? if I'm only running 4 to start?

Again, I'm running CoreOS (etcd), then a Docker container (consul) - and right now 4 of those setups, so 4 CoreOS nodes, each with one Docker container on it. Cloudfoundry brings everything up, then I have a script that runs docker exec and does a curl within the container to get all the IPs from etcd on CoreOS to get things started. When I go to the container you can see everything started correctly and can see the other consul members.

philcryer avatar Jan 21 '15 22:01 philcryer

@philcryer Setting all to -server shouldn't be an issue with only 4. However, it still looks like a networking issue. Looks like UDP packets aren't being routed back properly.

armon avatar Jan 22 '15 01:01 armon

I've found another issue on github, so I'm convinced the issue is a UDP ACL issue on EC2. I've set consul to use the UDP ports...

diff --git a/templates/cloudformation-template-vpc-consul.json b/templates/cloudformation-template-vpc-consul.json
index 997a790..aa900e2 100644
--- a/templates/cloudformation-template-vpc-consul.json
+++ b/templates/cloudformation-template-vpc-consul.json
@@ -1781,12 +1781,15 @@
                 "      ExecStartPre=/usr/bin/docker pull progrium/consul:latest\n",
                 "      ExecStart=/usr/bin/docker run --name consul -h %H -v /data/consul:/data \\n",
                 "                             -p 8300:8300 \\n",
+                "                             -p 8300:8300/udp \\n",
                 "                             -p 8301:8301 \\n",
                 "                             -p 8301:8301/udp \\n",
                 "                             -p 8302:8302 \\n",
                 "                             -p 8302:8302/udp \\n",
                 "                             -p 8400:8400 \\n",
+                "                             -p 8400:8400/udp \\n",
                 "                             -p 8500:8500 \\n",
+                "                             -p 8500:8500/udp \\n",
                 "                             -p 53:53/udp \\n",
                 "                             progrium/consul:latest -server -advertise 127.0.0.1 -bootstrap-expect 3\n",
                 "      ExecStop=/usr/bin/docker stop consul\n"

philcryer avatar Jan 23 '15 16:01 philcryer

My AWS VPC network ACL looks like:

inbound
rule type protocol port range destination allow/deny
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW 
* ALL Traffic ALL ALL 0.0.0.0/0 DENY

outbound
rule type protocol port range destination allow/deny
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
* ALL Traffic ALL ALL 0.0.0.0/0 DENY

which looks like "allow all, in and out" to me.

petemounce avatar Jan 26 '15 14:01 petemounce

re: tcpdump - never used that. What would I be looking for?

petemounce avatar Jan 26 '15 14:01 petemounce

@petemounce Based on this log:

2015/01/13 10:50:52 [ERR] memberlist: Failed to receive remote state: EOF

It looks like the TCP connection (to port 8301) is being closed (EOF) while we are still expecting data. With tcpdump you should be able to watch the TCP traffic to/from port 8301 to see if you are getting any data at all, or if potentially the connection is being RST immediately etc.

I wish I could be of more use, but since I've never seen this, it's incredibly hard to triage the any number of network / configuration issues that could be at play.

armon avatar Jan 27 '15 01:01 armon

Take a look in the AWS Console to make sure the right ports are open (and protocols match tcp vs udp) we had it set one way in cloudformation, and it was failing, but we found on the AWS Conole that the ports were not open! So something in the json (while it validated) failed, but we weren't notified so assumed all was good.

philcryer avatar Jan 27 '15 02:01 philcryer

I had this same issue, having just set up two Consul instances for the first time. Both are running on EC2 instances in the same VPC, but because they are in different availability zones, they're in different subnets.

Without opening up any networking (except SSH), the Consul instances couldn't see each other. So far, so expected.

Then I created a security group like this for each instance (I'm using CloudFormation here):

"Consul" : {
    "Type" : "AWS::EC2::SecurityGroup",
    "Properties" : {
        "VpcId" : { "Ref": "VpcId" },
        "GroupDescription" : "Enable access to Consul services within the VPC",
        "SecurityGroupIngress" : [
            {"IpProtocol" : "tcp", "FromPort" : "8300", "ToPort" : "8302", "CidrIp" : { "Ref" : "VpcMainCidr" } },
            {"IpProtocol" : "udp", "FromPort" : "8301", "ToPort" : "8302", "CidrIp" : { "Ref" : "VpcMainCidr" } },
            {"IpProtocol" : "tcp", "FromPort" : "8400", "ToPort" : "8400", "CidrIp" : { "Ref" : "VpcMainCidr" } },
            {"IpProtocol" : "tcp", "FromPort" : "8500", "ToPort" : "8500", "CidrIp" : { "Ref" : "VpcMainCidr" } },
            {"IpProtocol" : "tcp", "FromPort" : "8600", "ToPort" : "8600", "CidrIp" : { "Ref" : "VpcMainCidr" } },
            {"IpProtocol" : "udp", "FromPort" : "8600", "ToPort" : "8600", "CidrIp" : { "Ref" : "VpcMainCidr" } }
        ]
    }
},

Now I could join the two servers together... but I had the same issue as @philcryer above: "Suspect ip-xxx has failed" etc.

So in the Network ACL, I added these rules:

"InboundConsulSerfPortsNetworkAclEntry" : {
    "Type" : "AWS::EC2::NetworkAclEntry",
    "Properties" : {
        "NetworkAclId" : { "Ref" : "NetworkAcl" },
        "RuleNumber" : "105",
        "Protocol" : "17",
        "RuleAction" : "allow",
        "Egress" : "false",
        "CidrBlock" : { "Ref" : "VpcMainCidr" },
        "PortRange" : { "From" : "8301", "To" : "8302" }
    }
},

"InboundConsulDnsPortNetworkAclEntry" : {
    "Type" : "AWS::EC2::NetworkAclEntry",
    "Properties" : {
        "NetworkAclId" : { "Ref" : "NetworkAcl" },
        "RuleNumber" : "106",
        "Protocol" : "17",
        "RuleAction" : "allow",
        "Egress" : "false",
        "CidrBlock" : { "Ref" : "VpcMainCidr" },
        "PortRange" : { "From" : "8600", "To" : "8600" }
    }
},

"OutboundConsulSerfPortsNetworkAclEntry" : {
    "Type" : "AWS::EC2::NetworkAclEntry",
    "Properties" : {
        "NetworkAclId" : { "Ref" : "NetworkAcl" },
        "RuleNumber" : "104",
        "Protocol" : "17",
        "RuleAction" : "allow",
        "Egress" : "true",
        "CidrBlock" : { "Ref" : "VpcMainCidr" },
        "PortRange" : {"From" : "8301", "To" : "8302"}
    }
},

"OutboundConsulDnsPortNetworkAclEntry" : {
    "Type" : "AWS::EC2::NetworkAclEntry",
    "Properties" : {
        "NetworkAclId" : { "Ref" : "NetworkAcl" },
        "RuleNumber" : "105",
        "Protocol" : "17",
        "RuleAction" : "allow",
        "Egress" : "true",
        "CidrBlock" : { "Ref" : "VpcMainCidr" },
        "PortRange" : {"From" : "8600", "To" : "8600"}
    }
},

Notes:

  • Change RuleNumber depending on your list
  • Change { "Ref" : "VpcMainCidr" } to whatever range of IP addresses you need
  • You definitely need both the inbound and outbound rules - I've tested with Serf but not tried DNS yet

The reason why it's needed is because AWS has two security layers - instance security groups and network ACLs. They both work a bit differently. See the Security in Your VPC. The network ACL applies to traffic between different subnets (e.g. for availability zones), not just in and out of the VPC.

As to why I could join the Consul instances together in the first place without even touching my Network ACL. It turns out I already had all the high TCP ports open both ways. As the Network ACL is stateless (no connection tracking), I think these are already needed:

"InboundResponsePortsNetworkAclEntry" : {
    "Type" : "AWS::EC2::NetworkAclEntry",
    "Properties" : {
        "NetworkAclId" : { "Ref" : "NetworkAcl" },
        "RuleNumber" : "104",
        "Protocol" : "6",
        "RuleAction" : "allow",
        "Egress" : "false",
        "CidrBlock" : "0.0.0.0/0",
        "PortRange" : {"From" : "1024", "To" : "65535"}
    }
},

"OutBoundResponsePortsNetworkAclEntry" : {
    "Type" : "AWS::EC2::NetworkAclEntry",
    "Properties" : {
        "NetworkAclId" : { "Ref" : "NetworkAcl" },
        "RuleNumber" : "103",
        "Protocol" : "6",
        "RuleAction" : "allow",
        "Egress" : "true",
        "CidrBlock" : "0.0.0.0/0",
        "PortRange" : {"From" : "1024", "To" : "65535"}
    }
},

In any case, I got them from the CloudFormation example templates (see the first VPC one near the bottom for example).

I hope that helps!

fazy avatar Mar 03 '15 20:03 fazy

I'm having the same issue, but I'm using the default ACL settings, which are 100% permissive. I get the problem on a single node when I run: sudo consul agent -server -bootstrap-expect 1 -data-dir /opt/consul/data

Type              Protocol    Port Range    Source
Custom TCP Rule   TCP         8300          sg-d9a9f8bd (consul)
Custom TCP Rule   TCP         8500          sg-d9a9f8bd (consul)
Custom TCP Rule   TCP         8600          sg-d9a9f8bd (consul)
Custom TCP Rule   TCP         8302          sg-d9a9f8bd (consul)
Custom UDP Rule   UDP         8302          sg-d9a9f8bd (consul)
Custom UDP Rule   UDP         8600          sg-d9a9f8bd (consul)
Custom TCP Rule   TCP         8301          sg-d9a9f8bd (consul)
Custom UDP Rule   UDP         8301          sg-d9a9f8bd (consul)
Custom TCP Rule   TCP         8400          sg-d9a9f8bd (consul)
All traffic       All         All           sg-d9a9f8bd (consul)

EDIT: I'm getting this error on consul 0.5.0, and I'm getting it on a single node, with a clean install.

ubuntu@ip-10-225-2-152:~$ sudo consul agent -server -data-dir /opt/consul/data/ -bootstrap-expect 1
==> WARNING: BootstrapExpect Mode is specified as 1; this is the same as Bootstrap mode.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
         Node name: 'ip-10-225-2-152'
        Datacenter: 'dc1'
            Server: true (bootstrap: true)
       Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)
      Cluster Addr: 10.225.2.152 (LAN: 8301, WAN: 8302)
    Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false
             Atlas: <disabled>
...
    2015/04/30 17:36:32 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:36:41 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:36:41 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:36:42 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:36:51 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:36:51 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:36:52 [ERR] memberlist: Failed to receive remote state: EOF
    2015/04/30 17:37:01 [ERR] memberlist: Failed to receive remote state: EOF

I get the same thing if I drop the -bootstrap-expect argument. Only difference is that I get yet more errors: 2015/04/30 17:40:00 [ERR] agent: failed to sync remote state: No cluster leader

aayore avatar Apr 29 '15 22:04 aayore

This still happens with 0.5.2, same security group setup.

Here is a log excerpt:

==> WARNING: Expect Mode enabled, expecting 3 servers
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting raft data migration...
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
         Node name: 'consul_001'
        Datacenter: 'eu-west-1'
            Server: true (bootstrap: false)
       Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)
      Cluster Addr: 10.233.2.168 (LAN: 8301, WAN: 8302)
    Gossip encrypt: true, RPC-TLS: true, TLS-Incoming: true
             Atlas: <disabled>

==> Log data will now stream in as it occurs:

    2015/06/30 23:00:57 [INFO] serf: EventMemberJoin: consul_001 10.233.2.168
    2015/06/30 23:00:57 [INFO] serf: EventMemberJoin: consul_001.eu-west-1 10.233.2.168
    2015/06/30 23:00:57 [INFO] raft: Node at 10.233.2.168:8300 [Follower] entering Follower state
    2015/06/30 23:00:57 [INFO] consul: adding server consul_001 (Addr: 10.233.2.168:8300) (DC: eu-west-1)
    2015/06/30 23:00:57 [INFO] consul: adding server consul_001.eu-west-1 (Addr: 10.233.2.168:8300) (DC: eu-west-1)
    2015/06/30 23:00:57 [ERR] agent: failed to sync remote state: No cluster leader
    2015/06/30 23:00:57 [INFO] agent.rpc: Accepted client: 127.0.0.1:57836
    2015/06/30 23:00:57 [INFO] agent: (LAN) joining: [10.233.0.127 10.233.1.138 10.233.2.168]
    2015/06/30 23:00:57 [INFO] agent: (LAN) joined: 1 Err: <nil>
    2015/06/30 23:00:57 [ERR] memberlist: failed to receive: EOF
    2015/06/30 23:00:58 [ERR] memberlist: failed to receive: EOF
    2015/06/30 23:00:58 [ERR] memberlist: failed to receive: EOF
    2015/06/30 23:00:58 [WARN] raft: EnableSingleNode disabled, and no known peers. Aborting election.
    2015/06/30 23:01:00 [INFO] agent.rpc: Accepted client: 127.0.0.1:57840
    2015/06/30 23:01:02 [ERR] memberlist: failed to receive: EOF

petemounce avatar Jun 30 '15 23:06 petemounce

I used sudo tcpdump -i eth0 port 8301 -w consul.8301.pcap to capture a tcpdump trace, and have hosted it at https://s3.amazonaws.com/qa8-uk-content-images/consul.8301.pcap for inspection. I don't understand the contents of the file, though.

I ran the trace on 10.233.2.168. Other 2 consul nodes are 10.233.1.138 and 10.233.0.127.

My VPC has a single NACL, with this inbound ruleset:

Rule # Type Protocol Port Range Source Allow / Deny
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
*     ALL Traffic ALL ALL 0.0.0.0/0 DENY

and this outbound:

Rule # Type Protocol Port Range Destination Allow / Deny
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
* ALL Traffic ALL ALL 0.0.0.0/0 DENY

I read that as "allow all, everywhere, in and out".

The instances are in a security group with these rules:

Ports   Protocol    Source  je-securitygroups-qa13-consulEc2Sg-GK7CPH2X0FSP
8400    udp 10.0.0.0/8  ✔
8300-8302   udp 10.0.0.0/8  ✔
8600    udp 10.0.0.0/8  ✔
8500    tcp 10.0.0.0/8  ✔
8400    tcp 10.0.0.0/8  ✔
8500    udp 10.0.0.0/8  ✔
8300-8302   tcp 10.0.0.0/8  ✔
8500    tcp sg-e0c7c185 ✔
22  tcp <redacted>  ✔
53  udp 10.0.0.0/8  ✔
8600    tcp 10.0.0.0/8  ✔
53  tcp 10.0.0.0/8  ✔

petemounce avatar Jun 30 '15 23:06 petemounce

@petemounce it looks like there are Serf pings and normal Serf TCP connections in the sample you posted - was the node you were gathering on experiencing the [ERR] memberlist: failed to receive: EOF problems at the time?

Also, not sure if this is a test cluster or a production setup, but you probably don't want to publicly post the pcap for anything production, it could have real node names and event data in there since it has the contents of the messages moving through the network and not just the headers.

slackpad avatar Jul 01 '15 00:07 slackpad