<div dir="ltr">```<br>+-----------------------------------------------------------------------------+<br>| +-------------+ dbus calls +-------------------+ | cmd1 +------------------+<br>| | BMCWeb | <----------------------------------> | GPU | | <---->| GPU Out of band |<br>| | Service | (xyz.openbmc_project.Memory.Dimm ) | Manager | | cmd2 | Server |<br>| | | | (backend dbus | | <---> | (hardware level) |<br>| | | | service) | | | service) | <br>| +-------------+ +-------------------+ | +------------------+<br>| BMC |<br>+-----------------------------------------------------------------------------+ <br>```<br><br>Memory URI will use the backend D-Bus interface "xyz.openbmc_project.Memory.Dimm" hosted by the GPU Manager service to fetch all memory-related properties.<br>GPU Manager will update these D-Bus properties by sending SMBus commands to GPU Out-of-Band server.Intermittent failures can occur in SMBus commands.<br>At a given instance, there is a chance that cmd1 will fail and cmd2 may work. we want to use null value for failing property in redfish response instead of failing entire URI<br>This is inline with redfish specification <a href="https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf">https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf</a> , refer 9.5 Common data types 9.5.1 Primitive types.<br>This is our use case.<br><br><br>>Please point to a failing branch in code you'd like handled differently. Again, you've answered in the abstract <br>>which isn't helping me understand what you're trying to accomplish.<br><br>please refer gerrit MR(<a href="https://gerrit.openbmc.org/c/openbmc/bmcweb/+/66368">https://gerrit.openbmc.org/c/openbmc/bmcweb/+/66368</a>)<br>We are trying to handle errors in memory URI properties. We have a backend service named GPU Manager Server <br>that will handle all backend requests related to memory URI. We will use different SMBus commands to update these properties. <br>In this particular URI case, the command for serial number may fail, but SMBus commands for properties like part number and manufacturer will work at a given time.<br><br>if (serialNumber != nullptr)<br>{<br> asyncResp->res.jsonValue[jsonPtr]["SerialNumber"] =<br> mydatatype_t(*serialNumber);<br>}<br><br>if (partNumber != nullptr)<br>{<br> asyncResp->res.jsonValue[jsonPtr]["PartNumber"] =<br> mydatatype_t(*partNumber);<br>}<br><br><br>> If there is an error, the return code should not be 200. 200 OK is reserved for when there was no error.<br><br>Here we are discussing about only one property in dbus interface is failing. not entire interface.<br>According to DMTF spec <a href="https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf">https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf</a>, <br>9.5 Common data types 9.5.1 Primitive types , please refer Table 17 <br>null value, which the service uses when it is unable to determine the property's value due to an error or<br>other temporary condition, or if the schema has requirements for using null for other special conditions.<br><br>we want to use null data type in redfish response to represent error conditions for specific property.<br><br>>This is an example for a double data type. The other types can be done in similar manners, if the dbus interface allows it.<br><br>we checked for other datatypes, we didn't find any implementation details. We mentioned the same in our previous mail.<br><br>>>2. Using default values in D-Bus properties to indicate errors. Is there a reference implementation available for setting default values <br>>>for string and integer data types in bmc web, similar to the implementation of NaN (default value) for the double data type in cable.hpp. <br><br><br>>Sorry, but this sounds like you plan on not propagating errors to the user. <br>>I can't think of a case where that would be the correct thing to do. <br>>If the internal service failed, bmcweb should report that to the user through a return code and error property.<br><br>In our case, there is no failure in the entire service, intermittent failures can occur in smbus commands.<br>We want to use null value for the corresponding property in redfish response to represent the error.<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 1, 2023 at 9:27 PM Ed Tanous <<a href="mailto:edtanous@google.com">edtanous@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 1, 2023 at 7:21 AM chandu chanti <<a href="mailto:chandutmba@gmail.com" target="_blank">chandutmba@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>>Overall, I've read the code, and your email, and I really have no idea what's being proposed that doesn't already exist in a much simpler form, <br>>using the existing error handling mechanisms. While your point that one failing property can fail the whole call is correct, <br>>that's the intent. If an internal service fails, that needs propagated to the user, in the form of an error code, per the Redfish specification.<br><br>please refer Table 17 — Primitive data types in <a href="https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf" target="_blank">https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf</a><br>null value, which the service uses when it is unable to determine the property's value due to an error or<br>other temporary condition, or if the schema has requirements for using null for other special conditions.<br><br><br>> One thing I don't understand is what code is actually failing in this case? Can you point to a place where an error is returned that you'd like >handled differently? <br>> Speaking in concrete terms would help to make the generalized change you're attempting here<br><br>If there is an error in only one property, we want to represent that a specific property is failing in the URI instead of failing the entire URI.<br></div></blockquote><div><br></div><div>Please point to a failing branch in code you'd like handled differently. Again, you've answered in the abstract which isn't helping me understand what you're trying to accomplish.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><br>>Please look at error_messages.hpp and error_messages.cpp<br><br>We cannot have error messages when the HTTP return code is 200.<br></div></blockquote><div><br></div><div>If there is an error, the return code should not be 200. 200 OK is reserved for when there was no error.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><br>> For properties that have a "null" or "invalid" value, this is already implemented, generally with a simple branch.<br>> Example from sensors:<br>><a href="https://github.com/openbmc/bmcweb/blob/99bf026224d6ea60be27bd36793ddfaea5537d2a/redfish-core/lib/sensors.hpp#L934" target="_blank">https://github.com/openbmc/bmcweb/blob/99bf026224d6ea60be27bd36793ddfaea5537d2a/redfish-core/lib/sensors.hpp#L934</a><br><br>This addresses only the double datatype.</div></blockquote><div><br></div><div>This is an example for a double data type. The other types can be done in similar manners, if the dbus interface allows it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"> We are planning to implement it for all data types. Please refer to the following table.<br><br>>If the dbus data type is incorrect this already sets internal error (500). <br>>Please look at sdbusplus::unpackPropertiesNoThrow usage in bmcweb. <br>>Given that the interface failed, this is the most specific error we can give the user. We do log the source of the error though.<br><br>We are considering the case where only one property is failing, not the entire interface. We don't want to fail the entire URI <br>and we had mentioned the same in the very first email.<br></div></blockquote><div><br></div><div>Sorry, but this sounds like you plan on not propagating errors to the user. I can't think of a case where that would be the correct thing to do. If the internal service failed, bmcweb should report that to the user through a return code and error property.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>>> 1 . Using exceptions in our backend D-Bus service by throwing exceptions in the D-Bus property get handlers. <br>>>It works fine for the Get property method call. However, when using the Get All method call, <br>>>if one property fails, an error is returned without checking the other properties. <br>>>Is there a way to implement exceptions in GetAll so that even if one property fails, we can still fetch the remaining properties.<br><br><br>Error represenation Table for different data types<br>| D-Bus Data Type | Value of the D-Bus Property in case of Error | Property Value as seen on Redfish |<br>|-----------------|---------------------------------------------|----------------------------------|<br>| INT16 | INT_MAX | null |<br>| UINT16 | UINT_MAX | null |<br>| INT32 | LONG_MAX | null |<br>| UINT32 | ULONG_MAX | null |<br>| INT64 | LLONG_MAX | null |<br>| UINT64 | ULLONG_MAX | null |<br>| DOUBLE | std::numeric_limits<T>::quiet_NaN() | null |<br>| STRING | BE_ERROR-XXX | null |<br>| BOOL | uint8_t {0–false, 1–true, others- error} | null |<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 31, 2023 at 10:31 PM Ed Tanous <<a href="mailto:edtanous@google.com" target="_blank">edtanous@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 31, 2023 at 4:47 AM chandu chanti <<a href="mailto:chandutmba@gmail.com" target="_blank">chandutmba@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi team,<br><br>We have drafted a proposal for "<span style="font-family:Calibri,sans-serif;font-size:14.6667px">Using default values in D-Bus properties to indicate errors" </span> as <span dir="ltr">communicated in previous mail.</span><br><br>Issue with Existing Implementation:<br>Error handling is not implemented in the existing bmcweb source.</div></blockquote><div><br></div><div>This statement is verifiably incorrect. Many discussions have been had about how we handle Dbus, json, and Redfish errors, and the handling policies are written down in DBUS_USAGE.md. Please familiarize yourself with those previous discussions, and if you believe the conclusion was incorrect, quote those in your response.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"> The values fetched from D-Bus are used directly in the Redfish response, except for some properties.</div></blockquote><div><br></div><div>While this is true for properties that are intended to be sent directly to the user, like Asset information, it's not true of all properties.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"> T<span dir="ltr">here was no way to represent error for a given data type on Redfish.</span></div></blockquote><div><br></div><div>Please look at error_messages.hpp and error_messages.cpp</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><br>New Implementation Proposal:<br>We plan to handle errors from backend D-Bus services in bmcweb using a custom data type class. We will implement a helper class to create a new data type called mydatatype_t. An object of this class will be created with the D-Bus property value as input. This object will be assigned to the JSON response using the assignment operator. This assignment operation will invoke the to_json function with the mydatatype_t object, where D-Bus values will be validated based on their data types. </div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>Data Types and Default Values:<br>The following values will be set on the D-Bus property in case of an error, based on the data type.</div></blockquote><div><br></div><div>If the dbus data type is incorrect this already sets internal error (500). Please look at sdbusplus::unpackPropertiesNoThrow usage in bmcweb. Given that the interface failed, this is the most specific error we can give the user. We do log the source of the error though.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"> In Redfish, we will validate these properties. If the D-Bus property value matches the error value, we will update the property value as null in the Redfish JSON response; otherwise, the corresponding value on D-Bus will be used.<br></div></blockquote><div><br></div><div>For properties that have a "null" or "invalid" value, this is already implemented, generally with a simple branch.</div><div>Example from sensors:<br><a href="https://github.com/openbmc/bmcweb/blob/99bf026224d6ea60be27bd36793ddfaea5537d2a/redfish-core/lib/sensors.hpp#L934" target="_blank">https://github.com/openbmc/bmcweb/blob/99bf026224d6ea60be27bd36793ddfaea5537d2a/redfish-core/lib/sensors.hpp#L934</a><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<thead>
<tr>
<td valign="top" style="border:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><b><span style="font-size:10pt;font-family:"Courier New";color:black">D-Bus</span></b><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><b><span style="font-size:10pt;font-family:"Courier New";color:black">data type</span></b><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:1pt solid black;border-right:1pt solid black;border-bottom:1pt solid black;border-left:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><b><span style="font-size:10pt;font-family:"Courier New";color:black">Value of the D-Bus Property incase of Error </span></b><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:1pt solid black;border-right:1pt solid black;border-bottom:1pt solid black;border-left:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><b><span style="font-size:10pt;font-family:"Courier New";color:black">Property value as seen on
Redfish </span></b><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">INT16</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">INT_MAX</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">null</span></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">UINT16</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">UINT_MAX</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">INT32</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">LONG_MAX</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">UINT32</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">ULONG_MAX</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">INT64</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">LLONG_MAX</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">UINT64</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">ULLONG_MAX</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">DOUBLE</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><a href="http://en.cppreference.com/w/cpp/types/numeric_limits" target="_blank"><span style="font-size:9pt;font-family:"Courier New";color:black">std::numeric_limits</span></a><span style="font-size:9pt;font-family:"Courier New";color:black"><T>::quiet_NaN()</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">STRING</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">BE_ERROR-XXX</span><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
<tr>
<td valign="top" style="border-right:1pt solid black;border-bottom:1pt solid black;border-left:1pt solid black;border-top:none;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black">BOOL</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";color:black;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">uint8_t
<br>
{0–false , 1–true, <br>
others- error}</span><b><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></b></p>
</td>
<td valign="top" style="border-top:none;border-left:none;border-bottom:1pt solid black;border-right:1pt solid black;padding:5pt">
<p class="MsoNormal" align="center" style="margin:0in;text-align:center;line-height:normal;font-size:10.5pt;font-family:Calibri,sans-serif"><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:13.3333px">null</span><br></p>
</td>
</tr>
</thead>
</table><br><span dir="ltr"></span></div></blockquote><div><br></div><div>This table does not match with the Redfish spec on error handling behavior. Please familiarize yourself with <a href="https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.18.0.pdf" style="box-sizing:border-box;color:rgb(0,102,179);text-decoration-line:none;font-family:"Helvetica Neue",Arial,Helvetica,sans-serif;font-size:13.6px" target="_blank">DSP0266</a>, and any updates you make, please reference that specification.</div><div><br></div><div>Also, I have no idea what "BE_ERROR-XXX" is supposed to represent.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span dir="ltr">In case of error conditions Redfish will report "null" for a property irrespective of the data type.</span><br><br><div>For error validation, we will implement a custom class, which will facilitate error validation for D-Bus values. In instances of errors, a null value will be allocated to the JSON response. Example for the uint16_t data type.<br></div></div></blockquote><div><br></div><div>As written, this seems considerably worse than what we have today, and goes backwards on things like: <a href="https://github.com/openbmc/bmcweb/issues/176" target="_blank">https://github.com/openbmc/bmcweb/issues/176</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div><img src="cid:ii_llz2xobr2" alt="image.png" width="188" height="17" style="margin-right: 0px;"><br></div><div><br><img src="cid:ii_llz2fns20" alt="image.png" style="margin-right: 0px;" width="472" height="34"><br><br>For more implementation details please refer the following gerrit link, we implemented it for redfish URI /redfish/v1/Systems/<str>/Memory/<str>/.<div><a href="https://gerrit.openbmc.org/c/openbmc/bmcweb/+/66368" target="_blank">https://gerrit.openbmc.org/c/openbmc/bmcweb/+/66368</a><br><br>Your feedback and insights are greatly appreciated.<br><br>Thanks,<br>Chandrasekhar T.<br></div></div></div></blockquote><div><br></div><div><br></div><div>Overall, I've read the code, and your email, and I really have no idea what's being proposed that doesn't already exist in a much simpler form, using the existing error handling mechanisms. While your point that one failing property can fail the whole call is correct, that's the intent. If an internal service fails, that needs propagated to the user, in the form of an error code, per the Redfish specification.</div><div><br></div><div>One thing I don't understand is what code is actually failing in this case? Can you point to a place where an error is returned that you'd like handled differently? Speaking in concrete terms would help to make the generalized change you're attempting here.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 4, 2023 at 12:37 PM Shakeeb Pasha <<a href="mailto:shakeebbk@gmail.com" target="_blank">shakeebbk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-size:large">Thanks Joseph for the response.</div><div style="font-size:large"><span style="font-size:small">>> I didn't see anyone else answer this. Is your question about how to</span><br style="font-size:small"><span style="font-size:small">>> architect or design your D-Bus interfaces? Is the reference the BMCWeb</span><br style="font-size:small"><span style="font-size:small">>> merely to provide context as a consumer of these D-Bus services? I</span><br style="font-size:small"><span style="font-size:small">>> assume so.</span><br style="font-size:small">Question is two pronged, one we wanted to know the best way to propagate error from dbus to bmcweb.</div><div><font size="4">Options we tried:</font></div><div><font size="4">1. Have handlers of each property throw an exception if there was an error. But this did not work well with current bmcweb implementation(get all method call), as it would lead to the entire resource not getting populated even if we have one property failing.</font></div><div><font size="4">2. Implement one additional associated rc property - and do the error handling bmcweb by looking at that, but this doubled up the number of properties on dbus.</font></div><div><font size="4">3. Use "default values" per property data type, but this would fail for extreme cases like if the property is u32, and if the default value used was INT_MAX, then it breaks when the property could take value 0xFFFFFFFF as valid value.</font></div><div><font size="4">So the query here was to check if any preference from above options or hear any new approaches as well.</font></div><div><font size="4"><br></font></div><div><font size="4">The second query was about how to represent this error(per property error) on redfish, our proposal for now is to return "NULL" for any property that might be failing at the backend. Any thoughts on this approach?</font></div><div><font size="4"><br></font><span style="font-size:small">>> I don't have any special insights. Are you looking to follow a design</span><br style="font-size:small"><span style="font-size:small">>> pattern? Are you looking for direction from the BMCWeb maintainers?</span><br></div><div><span style="font-size:small"><br></span></div><div style="font-size:large">Yes, we are working on a design pattern proposal and will publish it here for review.</div><div style="font-size:large">It would be great if we could get some directions/inputs from the maintainers as well.</div><div style="font-size:large"><br></div><div style="font-size:large">Thanks,</div><div style="font-size:large">Shakeeb</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 3, 2023 at 10:33 PM Joseph Reynolds <<a href="mailto:jrey@linux.ibm.com" target="_blank">jrey@linux.ibm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 7/20/23 2:04 AM, chandu chanti wrote:<br>
> Hi Team, We are planning to handle errors from backend services in bmc <br>
> web. We are considering the following approaches to implement it, but <br>
> we are facing some issues. please provide your inputs. 1 . Using <br>
> exceptions in our backend D-Bus service<br>
> ZjQcmQRYFpfptBannerStart<br>
> This Message Is From an Untrusted Sender<br>
> You have not previously corresponded with this sender.<br>
> Report Suspicious<br>
> <<a href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/PjiDSg!12-vrJJyaRL1Nus7N26ProiLa90y_FB6oawxkmvrT4YcN373bBkdTP-XPRTFLRBygswzt1TwX0wxp5Tel83pR4ZZR-wpxEYJpcKudcTfq2FH6iPLN9Ep4cV_tX4$" rel="noreferrer" target="_blank">https://us-phishalarm-ewt.proofpoint.com/EWT/v1/PjiDSg!12-vrJJyaRL1Nus7N26ProiLa90y_FB6oawxkmvrT4YcN373bBkdTP-XPRTFLRBygswzt1TwX0wxp5Tel83pR4ZZR-wpxEYJpcKudcTfq2FH6iPLN9Ep4cV_tX4$</a>> <br>
><br>
> ZjQcmQRYFpfptBannerEnd<br>
><br>
> Hi Team,<br>
><br>
> We are planning to handle errors from backend services in bmc web. We <br>
> are considering the following approaches to implement it, but we are <br>
> facing some issues. please provide your inputs.<br>
><br>
<br>
<span class="gmail_default" style="font-size:large"></span>I didn't see anyone else answer this. Is your question about how to <br>
architect or design your D-Bus interfaces? Is the reference the BMCWeb <br>
merely to provide context as a consumer of these D-Bus services? I <br>
assume so.<br>
<br>
I don't have any special insights. Are you looking to follow a design <br>
pattern? Are you looking for direction from the BMCWeb maintainers?<br>
<br>
Joseph<br>
<br>
> 1 . Using exceptions in our backend D-Bus service by throwing <br>
> exceptions in the D-Bus property get handlers. It works fine for the <br>
> Get property method call. However, when using the Get All method call, <br>
> if one property fails, an error is returned without checking the other <br>
> properties. Is there a way to implement exceptions in GetAll so that <br>
> even if one property fails, we can still fetch the remaining properties.<br>
><br>
> 2. Using default values in D-Bus properties to indicate errors. Is <br>
> there a reference implementation available for setting default values <br>
> for string and integer data types in bmc web, similar to the <br>
> implementation of NaN (default value) for the double data type in <br>
> cable.hpp.<br>
><br>
> 3. Implement associated return code per property on dbus, but this <br>
> would be very inefficient in terms of double the properties on dbus, <br>
> something we would like to avoid<br>
><br>
> Thanks<br>
> Chandrasekhar T.<br>
><br>
<br>
</blockquote></div></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>