Suppress SW EBADR message
During the code update, the following EBADR messages may be generated
and they can be suppressed.
During the code update, the following journal messages may be generated
due to a reason why there is a software version with EBADR because the
software app deleted the old version. The EBADR check already does not
throw an internal error and it shouldn't log to the journal either at
the error based [1].
This commit also cleans up these journal traces because logging both ec
and ec.message is redundant.
```
ay 27 20:17:04.992218 ever28bmc systemd[1]: Starting Delete image a from BMC storage...
May 27 20:17:05.205158 ever28bmc obmc-flash-bmc[2159]: 2048+0 records in
May 27 20:17:05.205158 ever28bmc obmc-flash-bmc[2159]: 2048+0 records out
May 27 20:17:05.391229 ever28bmc obmc-flash-bmc[2161]: 2048+0 records in
May 27 20:17:05.391229 ever28bmc obmc-flash-bmc[2161]: 2048+0 records out
May 27 20:17:05.403161 ever28bmc systemd[1]: obmc-flash-mmc-remove@a.service: Deactivated successfully.
May 27 20:17:05.404485 ever28bmc systemd[1]: Finished Delete image a from BMC storage.
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.986380 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.986380 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.988780 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
```
[1] https://github.com/openbmc/bmcweb/blob/10cf50dca112b27176dc5734126983ad37ba2c04/DEVELOPING.md?plain=1#L213
Change-Id: I9454e85b299649e1a1e40663fac6256415bbfe7d
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index f4872b5..6695ef0 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -89,18 +89,16 @@
{
if (ec)
{
- BMCWEB_LOG_ERROR("error_code = {}", ec);
- BMCWEB_LOG_ERROR("error msg = {}", ec.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 (ec.value() == EBADR)
+ if (ec.value() != EBADR)
{
- return;
+ BMCWEB_LOG_ERROR("error_code = {}", ec);
+ messages::internalError(asyncResp->res);
}
- messages::internalError(asyncResp->res);
return;
}
// example propertiesList
@@ -176,9 +174,11 @@
{
if (ec)
{
- BMCWEB_LOG_ERROR("error_code = {}", ec);
- BMCWEB_LOG_ERROR("error msg = {}", ec.message());
- messages::internalError(asyncResp->res);
+ if (ec.value() != EBADR)
+ {
+ BMCWEB_LOG_ERROR("error_code = {}", ec);
+ messages::internalError(asyncResp->res);
+ }
return;
}
@@ -236,7 +236,6 @@
if (ec)
{
BMCWEB_LOG_DEBUG("error_code = {}", ec);
- BMCWEB_LOG_DEBUG("error msg = {}", ec.message());
// No functional software for this swVersionPurpose, so just
return;
}