open-rmf/rmf-web

API server unable to perform cancel task

Closed this issue · 2 comments

Bug report

Required information:

Description of the bug

After creating a task in rmf-web using the UI, I am unable to cancel the task and receive error 500. Even after refreshing the task is still there in progress.

Steps to reproduce the bug

Expected the API server to accept the command and return an ok code ie 200, also update the status in the server so that upon refresh a cancel state will be displayed instead of in progress.

Actual behavior

Instead, a message stating "Failed to cancel task: Request failed with status code 500" is shown in the bottom left corner. After refreshing the page statuses stay the same.

Screenshots

image

Additional information

This problem was encountered during local testing with everything hosted on the same device. Running ros2 topic echo /fleet_states still shows the task as active.
Furthermore, when testing through the openapi interface error 500 internal server error was also raised.

Hello @Magiccofee! I'm sorry to see that you are having issues with the API server. I have changed the issue to question as there is not enough information in your issue for us to recreate it.

Kindly, provide more information regarding your RMF instance for recreation, whether you are running simulation or hardware, what sort of task was it, was the task already ongoing, was the task still in queue, etc

Hi @aaronchongth , thank you for replying. I am running RMF with hardware, error was noticed when sending loop tasks through rmf-web dashboard. The task was ongoing as the robot was in motion.
I have accessed the /docs page and tried using the function through there and have also gotten error 500.
image1

Upon restarting rmf-web, I tried cancelling tasks again and seem to have been successful even though the message of error 500 still appears and posting from API server /docs page is met with the same error. In the terminal, I checked the logs and found these lines

INFO: 127.0.0.1:56784 - "GET /tasks/patrol.dispatch-4/log?between=0%2C9007199254740991 HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:56784 - "OPTIONS /tasks/cancel_task HTTP/1.1" 200 OK
INFO:fastapi.RmfService:sent request '0f7ea6d5-57aa-48e0-98f4-83c407311413'
DEBUG:fastapi.RmfService:rmf_task_msgs.msg.ApiRequest(json_msg='{"type": "cancel_task_request", "task_id": "patrol.dispatch-4"}', request_id='0f7ea6d5-57aa-48e0-98f4-83c407311413')
INFO: 127.0.0.1:56784 - "GET /tasks/patrol.dispatch-4/log?between=0%2C9007199254740991 HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:56796 - "POST /tasks/cancel_task HTTP/1.1" 500 Internal Server Error

Prior to restarting rmf-web, I had seen an instance of two tasks being reflected in the tasks tab assigned to the same robot and both underway. Robot was only working on the more recent task. This occurred after i restated RMF core while
image(2)

Is this due to a mismatch between the server and other rmf components and is it required to restart the rmf-web dashboard and api server whenever the components such as rmf core or fleet adapter needs to be restarted?