Leave off firmware properties if EBADR
Have seen where between the mapper call and the inner call here to
phosphor-bmc-code-mgmt, phosphor-bmc-code-mgmt deleted the image.
This was during code update and phosphor-bmc-code-mgmt was deleting the
backup image.
Redfish lists all associated images under the manager resource:
"SoftwareImages": {
"description": "The images that are associated with this manager.",
...
See https://redfish.dmtf.org/schemas/Manager.v1_15_0.json.
bmcweb needs to look at the image purpose hence the call to the backup
image.
EBADR is the resource not found error code.
If EBADR is returned when populating the firmware properties just
leave off the firmware properties. These properties aren't required.
Discussed in discord here:
https://discord.com/channels/775381525260664832/981260009256140852/981263933442785290
We do similar checks for an EBADR return code other places in bmcweb.
Tested: Everything looked the same.
To actually test this code path had to be creative.
Made this call look at a bad path:
*version;
}
},
- obj.second[0].first, obj.first,
+ obj.second[0].first, obj.first + "badid",
"org.freedesktop.DBus.Properties", "GetAll",
"xyz.openbmc_project.Software.Version");
When doing so I saw the following traces but no internal error:
(2022-06-01 20:29:41) [ERROR "fw_utils.hpp":139] error_code = generic:53
(2022-06-01 20:29:41) [ERROR "fw_utils.hpp":140] error msg = Invalid request descriptor
The firmware version and software links were left off.
The GUI handled this missing information well.
The validator passed.
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Change-Id: I9d8cd8b04acadfdd10f660cf9b7ca5dc6f36b4d0
diff --git a/redfish-core/include/utils/fw_utils.hpp b/redfish-core/include/utils/fw_utils.hpp
index c4c323d..5163354 100644
--- a/redfish-core/include/utils/fw_utils.hpp
+++ b/redfish-core/include/utils/fw_utils.hpp
@@ -132,6 +132,14 @@
{
BMCWEB_LOG_ERROR << "error_code = " << ec3;
BMCWEB_LOG_ERROR << "error msg = " << ec3.message();
+ // Have seen the code update app delete the D-Bus
+ // object, during code update, between the call to
+ // mapper and here. Just leave these properties off if
+ // resource not found.
+ if (ec3.value() == EBADR)
+ {
+ return;
+ }
messages::internalError(aResp->res);
return;
}