diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2020-11-20 23:26:04 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-12-30 05:08:19 +0300 |
commit | 88b3dd12851cd7bdd4b5c065ba99f40feafb775e (patch) | |
tree | 85c172e6175e971e1bba5c5198f2e28b03534bf7 /redfish-core/lib/update_service.hpp | |
parent | 81ce609e30274435b4f8c3fc65340c6b6b153b0c (diff) | |
download | bmcweb-88b3dd12851cd7bdd4b5c065ba99f40feafb775e.tar.xz |
Look for Version Already Exists Error
Look for Software.Version.Error.AlreadyExists and return Invalid Upload
and Resource Already Exists.
Heard from users it is hard to know why the image failed to upload
in this case.
Tested: Built with PDI and phosphor-bmc-code-mgmt changes and saw the
error.
curl -k -H "Content-Type: application/octet-stream" -X POST -T $image https://${bmc}/redfish/v1/UpdateService
{
"Version@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type UpdateService.v1_4_0.UpdateService with the property Version with the value uploaded version already exists.",
"MessageArgs": [
"UpdateService.v1_4_0.UpdateService",
"Version",
"uploaded version"
],
"MessageId": "Base.1.8.1.ResourceAlreadyExists",
"MessageSeverity": "Critical",
"Resolution": "Do not repeat the create operation as the resource has already been created."
}
],
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "/redfish/v1/$metadata#Message.v1_1_1.Message",
"Message": "Invalid file uploaded to /redfish/v1/UpdateService: Image version already exists.",
"MessageArgs": [
"/redfish/v1/UpdateService",
"Image version already exists"
],
"MessageId": "OpenBMC.0.1.0.InvalidUpload",
"MessageSeverity": "Warning",
"Resolution": "None."
}
],
"code": "OpenBMC.0.1.0.InvalidUpload",
"message": "Invalid file uploaded to /redfish/v1/UpdateService: Image version already exists."
}
}
Change-Id: Ieab0116650dd64949da6b7ac93254193803f8f90
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'redfish-core/lib/update_service.hpp')
-rw-r--r-- | redfish-core/lib/update_service.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index 0eb9d103b9..87933fa2d6 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -329,8 +329,7 @@ static void monitorForSoftwareAvailable( { return; // if this was our message, timeout will cover it } - if (!boost::starts_with(*type, - "xyz.openbmc_project.Software.Image.Error")) + if (!boost::starts_with(*type, "xyz.openbmc_project.Software")) { return; } @@ -352,6 +351,17 @@ static void monitorForSoftwareAvailable( redfish::messages::invalidUpload(asyncResp->res, url, "Invalid image format"); } + else if (*type == "xyz.openbmc_project.Software.Version.Error." + "AlreadyExists") + { + + redfish::messages::invalidUpload( + asyncResp->res, url, "Image version already exists"); + + redfish::messages::resourceAlreadyExists( + asyncResp->res, "UpdateService.v1_4_0.UpdateService", + "Version", "uploaded version"); + } else if (*type == "xyz.openbmc_project.Software.Image.Error.BusyFailure") { |