Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details
I've not been able to locate an answer to this although it's been asked often. In a very simple case (directly from a tutorial) I am getting the above error message. I kind of understand what the error is trying to say: the action client is exiting and the action server is complaining about it disappearing. But I don't understand why. Is there further tear down needed in the action client so the server doesn't complain?
I am running melodic on ubuntu 18.04. Here's the source code:
#! /usr/bin/env python
import rospy
import actionlib
from prrexamples.msg import TimerAction, TimerGoal, TimerResult
# Declare the node
rospy.init_node('timer_action_client')
# Get the method to talk to the action
client = actionlib.SimpleActionClient('timer', TimerAction)
# Now just wait for it to come up.
client.wait_for_server()
rospy.loginfo("Action server detected")
# Create the TimerGoal objet
goal = TimerGoal()
# Set it up
goal.time_to_wait = rospy.Duration.from_sec(5.0)
# And now tell the action to begin working on the goal
client.send_goal(goal)
# Block until the action says the job is done
client.wait_for_result()
# Print the result.
rospy.loginfo('Time elapsed: %f'%(client.get_result().time_elapsed.to_sec()))
and
#! /usr/bin/env python
import rospy
import time
import actionlib
from prrexamples.msg import TimerAction, TimerGoal, TimerResult
# Action Request Comes in
def do_timer(goal):
start_time = time.time()
time.sleep(goal.time_to_wait.to_sec())
result = TimerResult()
result.time_elapsed = rospy.Duration.from_sec(time.time() - start_time)
result.updates_sent = 0
server.set_succeeded(result)
# Declare that we are a node
rospy.init_node('timer_action_server')
# Declare that this node will handle actions
# When action requests come in, call do_timer method
server = actionlib.SimpleActionServer('timer', TimerAction, do_timer, False)
# Start it up
server.start()
# Wait until ^c
rospy.spin()
I'm running into this too. I think the teardown is correct, could be a bug in actionlib. Consider creating an issue on their github. I'm also noticing that this warning only pops up occasionally.
I have the same question "[WARN] [1614305288.280276, 0.000000]: Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details." Do you deal with it? Please give me some advice, thank you!
@Bing Han Please don't provide answers that are not answers. This is a Q&A site not a discussion forum. I've reposted your answer as a question comment.