Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Agent failed to connect server with heatbeat error CM5.0.2

Highlighted

Agent failed to connect server with heatbeat error CM5.0.2

Explorer

Getting error while starting the agent.Unable to connect server.

 

 File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 412, in read_framed_message
    raise ConnectionClosedException("Reader read 0 bytes.")
ConnectionClosedException: Reader read 0 bytes.
[28/Jul/2014 16:21:37 +0000] 31749 MainThread agent        INFO     Loading last saved hb response to complete initialization: /var/lib/cloudera-scm-agent/response.avro
[28/Jul/2014 16:21:37 +0000] 31749 MainThread agent        INFO     Using parcels directory from server provided value: /opt/cloudera/parcels
[28/Jul/2014 16:21:37 +0000] 31749 MainThread parcel       INFO     Agent does create users/groups and apply file permissions
[28/Jul/2014 16:21:37 +0000] 31749 MainThread downloader   INFO     Downloader path: /opt/cloudera/parcel-cache
[28/Jul/2014 16:21:37 +0000] 31749 MainThread parcel_cache INFO     Using /opt/cloudera/parcel-cache for parcel cache
[28/Jul/2014 16:21:37 +0000] 31749 MainThread agent        INFO     Active parcel list updated; recalculating component info.
[28/Jul/2014 16:21:38 +0000] 31749 MainThread agent        ERROR    Heartbeating to longmdcfu458.uk.db.com:7180 failed.
Traceback (most recent call last):
  File "/usr/lib64/cmf/agent/src/cmf/agent.py", line 766, in send_heartbeat
    response = self.requestor.request('heartbeat', dict(request=heartbeat))
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 139, in request
    return self.issue_request(call_request, message_name, request_datum)
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 249, in issue_request
    call_response = self.transceiver.transceive(call_request)
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 478, in transceive
    result = self.read_framed_message()
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 484, in read_framed_message
    framed_message = response_reader.read_framed_message()
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 412, in read_framed_message
    raise ConnectionClosedException("Reader read 0 bytes.")
ConnectionClosedException: Reader read 0 bytes.
[28/Jul/2014 16:21:42 +0000] 31749 Monitor-HostMonitor throttling_logger INFO     Using java location: '/usr/java/jdk1.7.0_45-cloudera/bin/java'.
[28/Jul/2014 16:21:53 +0000] 31749 MainThread agent        ERROR    Heartbeating to longmdcfu458.uk.db.com:7180 failed.
Traceback (most recent call last):
  File "/usr/lib64/cmf/agent/src/cmf/agent.py", line 766, in send_heartbeat
    response = self.requestor.request('heartbeat', dict(request=heartbeat))
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 139, in request
    return self.issue_request(call_request, message_name, request_datum)
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 249, in issue_request
    call_response = self.transceiver.transceive(call_request)
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 478, in transceive
    result = self.read_framed_message()
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 484, in read_framed_message
    framed_message = response_reader.read_framed_message()
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/avro-1.6.3-py2.6.egg/avro/ipc.py", line 412, in read_framed_message
    raise ConnectionClosedException("Reader read 0 bytes.")
ConnectionClosedException: Reader read 0 bytes.
                                                                                                               

3 REPLIES 3

Re: Agent failed to connect server with heatbeat error CM5.0.2

Explorer
Mee to have same problem, When I install Cloudera using Path A or B, this issue doesn't come. When I chose Path C, I am getting below issue.
CM-5.10.2
Logs:
[22/Jul/2018 06:50:50 +0000] 1509 MainThread agent ERROR Heartbeating to ip-10-0-0-10.ec2.internal:7180 failed.
Traceback (most recent call last):
File "/opt/cloudera-manager/cm-5.10.2/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.10.2-py2.7.egg/cmf/agent.py", line 1380, in _send_heartbeat
response = self.requestor.request('heartbeat', dict(request=heartbeat))
File "/opt/cloudera-manager/cm-5.10.2/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py", line 141, in request
return self.issue_request(call_request, message_name, request_datum)
File "/opt/cloudera-manager/cm-5.10.2/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py", line 254, in issue_request
call_response = self.transceiver.transceive(call_request)
File "/opt/cloudera-manager/cm-5.10.2/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py", line 483, in transceive
result = self.read_framed_message()
File "/opt/cloudera-manager/cm-5.10.2/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py", line 489, in read_framed_message
framed_message = response_reader.read_framed_message()
File "/opt/cloudera-manager/cm-5.10.2/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py", line 417, in read_framed_message
raise ConnectionClosedException("Reader read 0 bytes.")
ConnectionClosedException: Reader read 0 bytes.

Re: Agent failed to connect server with heatbeat error CM5.0.2

Explorer
Hi,

For me this issue is resolved after updating
server_port=7182 in /opt/cloudera-manager/cm-5.10.2/etc/cloudera-scm-agent/config.ini file and restarted agent

--B V K

Re: Agent failed to connect server with heatbeat error CM5.0.2

Super Guru

@GR,

 

In the log output you provided from the Agent, we see:

 

Heartbeating to longmdcfu458.uk.db.com:7180 failed.

 

By default, the agent will send heartbeats to port 7182.  It appears that the agent is not configured with the correct port.

 

In /etc/cloudera-scm-agent/config.ini, see:

 

# Port that the CM server is listening on.
server_port=7182

 

Make sure that server_port is set to 7182.

 

Then, restart the agent with "service cloudera-scm-agent restart"