Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with new service server impl and rospy #162

Closed
Carter12s opened this issue Jun 29, 2024 · 1 comment · Fixed by #163
Closed

Error with new service server impl and rospy #162

Carter12s opened this issue Jun 29, 2024 · 1 comment · Fixed by #163
Labels
bug Something isn't working ros1 For issues affecting the native ROS1 implementation

Comments

@Carter12s
Copy link
Collaborator

So our new service server setup can call itself (yay!) but we're defo not fully compliant.

Unclear why other tools are angry right now. But rospy errors:

import rospy
from std_srvs.srv import SetBool
set_bool = rospy.ServiceProxy('/service_server_rs/my_set_bool', SetBool)
set_bool(True)
>>> set_bool(True)
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 567, in connect
    self.socket.connect((dest_addr, dest_port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 509, in call
    transport.connect(dest_addr, dest_port, service_uri)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 596, in connect
    raise TransportInitError(str(e)) #re-raise i/o error
rospy.exceptions.TransportInitError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__
    return self.call(*args, **kwds)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 512, in call
    raise ServiceException("unable to connect to service: %s"%e)
rospy.service.ServiceException: unable to connect to service: [Errno 111] Connection refused

Investigate and fix!

@Carter12s Carter12s added bug Something isn't working ros1 For issues affecting the native ROS1 implementation labels Jun 29, 2024
@Carter12s
Copy link
Collaborator Author

Okay above error was a false alarm I had a borked networking setup with docker.

There is an error here, but it is a little more subtle:

  • If you use rospy.ServiceProxy with persistent=True
  • First call will work
  • Second call will error
>>> set_bool(False)
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 523, in call
    responses = transport.receive_once()
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 744, in receive_once
    self.stat_bytes += recv_buff(sock, b, p.buff_size)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 111, in recv_buff
    raise TransportTerminated("unable to receive data from sender, check sender's logs for details")
rospy.exceptions.TransportTerminated: unable to receive data from sender, check sender's logs for details

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__
    return self.call(*args, **kwds)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 533, in call
    raise ServiceException("transport error completing service call: %s"%(str(e)))
rospy.service.ServiceException: transport error completing service call: unable to receive data from sender, check sender's logs for details

Logs from example show nothing interesting second request is currently swallowed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ros1 For issues affecting the native ROS1 implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant