eProsima / Integration-Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ROS 2 - WebSocket crashes when running hello_world example

tal-grossman opened this issue · comments

how to reproduce

  1. setup environment according to https://integration-service.docs.eprosima.com/en/latest/examples/different_protocols/pubsub/ros2-websocket.html
  2. run integration-service src/Integration-Service/examples/basic/ros2_websocket__helloworld.yaml

Expected result:

ros2 node with integration service bridge are running and ready to bridge msgs according to documentation

Actual result:

service is crashed with terminal log:

[Integration Service][INFO] [is::sh::ROS2] Created node '/is_ros2_node_1804289383' [Integration Service][INFO] [is::sh::WebSocket::Server] Security disabled, creating TCP endpoint... [Integration Service][INFO] [is::sh::WebSocket::Server] Initializing TCP server on port 80 [2021-05-19 09:51:39] [info] asio listen error: system:13 (Permission denied) terminate called after throwing an instance of 'websocketpp::exception' what(): Underlying Transport Error Aborted (core dumped)

Additional Information

on SOSS (prior to integration service) with latest branch with commit hash: 457ceef
I was able to run ros2-websocket bridge and publish/subscribe msgs using node-red and websocket client/server

Good morning, sorry to hear that you are having problems with this example. However, it sounds quite strange for me. I would first make sure that no other websocket server is already running on the same port, as this could cause this exception to appear.

Definitely the WebSocket System Handle could improve the handling of possible exceptions, and we will do so in the future, but for now, please describe thoroughly your setup environment, which versions of each repository you are using (Integration Service, ROS2-SH, WEBSOCKET-SH) and also you asio and websocketpp library versions. Also it would be useful to know if this error is happening when running the example directly on your local environment, using a Docker, virtual machine, etc.

Thanks!

Hi @jamoralp!
You were right - when I changed the port to 9999 or other than 80 it was working. I dont know why 80 wasn't but ok for now.

for your questions:

  • Integration service: 812b14e
  • ROS-SH: 8f6e0e1ed1a20e2ee6f20c56e29bd8d325f7048b
  • Websocket-SH: 436c8ddf52768f49b5f8a74a3453a437c962bbb0
  • libwebsocketpp-dev: 0.8.1-7
    Im using on my local enviorment

That's good to hear. Port 80 is used a lot and probably some other application in your machine is already using it. Anyway, we definitely were aware that these kinds of situations should be managed by the WebSocket System Handle to simply warn the user, instead of launching an exception that crashes the whole Integration Service instance. We will note that down as an improvement for the next minor release 🙂

I am going to close this issue, please reopen it if you have any more problems and we will be happy to help. Thanks!