Skip to content

SimpleUpdate request should be validated before sending (POST with invalid payload is processing) #675

@ehaligow

Description

@ehaligow

When I am sending following POST to SimpleUpdate (parameter Targets is missing):

intel@ubuntu:~/ODIM/build$ curl -X POST -k -u 'admin:Od!m12$4' https://odim.local.com:45000/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate-d '{"ImageURI": "<URI_of_the_firmware_image>"}'| jq
 % Total  % Received % Xferd Average Speed Time  Time  Time Current
                 Dload Upload Total Spent  Left Speed
100 534 100 491 100  43  983  86 --:--:-- --:--:-- --:--:-- 1068
{
 "@odata.type": "#Task.v1_5_1.Task",
 "@odata.id": "/redfish/v1/TaskService/Tasks/taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "@odata.context": "/redfish/v1/$metadata#Task.Task",
 "Id": "taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "Name": "Task taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "Message": "The task with id taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b has started.",
 "MessageId": "TaskEvent.1.0.3.TaskStarted",
 "MessageArgs": [
  "taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b"
 ],
 "NumberOfArgs": 1,
 "Severity": "OK"
}

I get response 202. Then, I send GET to TaskService with id given before, I get Critical. After that, after GET on TaskMonitor and learn that the property is missing.

intel@ubuntu:~/ODIM/build$ curl -k -u 'admin:Od!m12$4' https://odim.local.com:45000/redfish/v1/TaskService/Tasks/taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b | jq
 % Total  % Received % Xferd Average Speed Time  Time  Time Current
                 Dload Upload Total Spent  Left Speed
100 758  0 758  0  0 2406   0 --:--:-- --:--:-- --:--:-- 2406
{
 "@odata.type": "#Task.v1_5_0.Task",
 "@odata.id": "/redfish/v1/TaskService/Tasks/taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "@odata.context": "/redfish/v1/$metadata#Task.Task",
 "Id": "taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "Name": "Task taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "TaskState": "Exception",
 "StartTime": "2021-09-15T09:35:25.903880697Z",
 "EndTime": "2021-09-15T09:35:26.002489871Z",
 "TaskStatus": "Critical",
 "TaskMonitor": "/taskmon/taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b",
 "PercentComplete": 100,
 "Payload": {
  "HttpHeaders": [
   "Content-type: application/json; charset=utf-8"
  ],
  "HttpOperation": "POST",
  "JsonBody": "{\"ImageURI\":\"\\u003cURI_of_the_firmware_image\\u003e\"}",
  "TargetUri": "/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate"
 },
 "Messages": []
}
intel@ubuntu:~/ODIM/build$ curl -k -u 'admin:Od!m12$4' https://odim.local.com:45000/taskmon/taskc4bc4501-74cb-4f11-ab1d-1903a0cc067b | jq
 % Total  % Received % Xferd Average Speed Time  Time  Time Current
                 Dload Upload Total Spent  Left Speed
100 540 100 540  0  0 2177   0 --:--:-- --:--:-- --:--:-- 2177
{
 "error": {
  "code": "Base.1.10.0.GeneralError",
  "message": "An error has occurred. See ExtendedInfo for more information.",
  "@Message.ExtendedInfo": [
   {
    "@odata.type": "#Message.v1_0_8.Message",
    "MessageId": "Base.1.10.0.PropertyMissing",
    "Message": "The property Targets is a required property and must be included in the request. 'Targets' parameter cannot be empty",
    "Severity": "Warning",
    "MessageArgs": [
     "Targets"
    ],
    "Resolution": "Ensure that the property is in the request body and has a valid value and resubmit the request if the operation failed."
   }
  ]
 }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:normalnormal priority, can be taken up after high priority issues are addressedstatus:newThis tag is attached to a new issue during creation onlytype:bugThis tag is attached to 'bug' issue during creation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions