activation: Add error handling in deleteImageManagerObject
Handle exceptions from the sdbusplus method call API.
The call to Delete an object from the image manager fails with:
sd_bus_call: System.Error.ELOOP: Too many levels of symbolic links
Catch the error so the app doesn't core dump. Issue
openbmc/openbmc#3311 will track root cause of the error.
Tested: A PNOR code update operation succeeds without core dumps
or error messages.
Change-Id: Ib384a16436bbb0521d247b7b6157b8877db5a4cb
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/activation.cpp b/activation.cpp
index e807d04..e8f0db9 100755
--- a/activation.cpp
+++ b/activation.cpp
@@ -242,13 +242,30 @@
method = this->bus.new_method_call(
(mapperResponse.begin()->first).c_str(), path.c_str(),
"xyz.openbmc_project.Object.Delete", "Delete");
- mapperResponseMsg = bus.call(method);
-
- // Check that the bus call didn't result in an error
- if (mapperResponseMsg.is_method_error())
+ try
{
- log<level::ERR>("Error in Deleting image from image manager",
- entry("VERSIONPATH=%s", path.c_str()));
+ auto mapperResponseMsg = bus.call(method);
+
+ // Check that the bus call didn't result in an error
+ if (mapperResponseMsg.is_method_error())
+ {
+ log<level::ERR>("Error in Deleting image from image manager",
+ entry("VERSIONPATH=%s", path.c_str()));
+ return;
+ }
+ }
+ catch (const SdBusError& e)
+ {
+ if (e.name() != nullptr && strcmp("System.Error.ELOOP", e.name()) == 0)
+ {
+ // TODO: Error being tracked with openbmc/openbmc#3311
+ }
+ else
+ {
+ log<level::ERR>("Error performing call to Delete object path",
+ entry("ERROR=%s", e.what()),
+ entry("PATH=%s", path.c_str()));
+ }
return;
}
}