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

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

Open
ehaligow opened this issue Sep 15, 2021 · 0 comments
Labels
prio:normal normal priority, can be taken up after high priority issues are addressed status:new This tag is attached to a new issue during creation only type:bug This tag is attached to 'bug' issue during creation

Comments

@ehaligow
Copy link
Collaborator

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."
   }
  ]
 }
}
@ehaligow ehaligow added type:bug This tag is attached to 'bug' issue during creation status:new This tag is attached to a new issue during creation only prio:normal normal priority, can be taken up after high priority issues are addressed labels Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio:normal normal priority, can be taken up after high priority issues are addressed status:new This tag is attached to a new issue during creation only type:bug This tag is attached to 'bug' issue during creation
Projects
None yet
Development

No branches or pull requests

1 participant