Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details

asked 2019-07-20 15:30:35 -0500

pitosalas gravatar image

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()
edit retag flag offensive close merge delete