ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

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

Comments

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.

achille gravatar image achille  ( 2019-10-28 19:19:44 -0500 )edit

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 gravatar image Bing Han  ( 2021-02-25 21:24:15 -0500 )edit

@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.

jarvisschultz gravatar image jarvisschultz  ( 2021-02-26 11:47:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-12 03:55:02 -0500

hanback114 gravatar image

I think you can use "del" inner function temporory.

It make client to be disconnected normally.

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 2,192 times

Last updated: Jul 20 '19