| 36b5cba2 | 12-Feb-2026 |
Jason Westover <jwestover@nvidia.com> |
Fix webassets to support Vite build output
The webui-vue project migrated from webpack to Vite, which changes the output filenames. Vite names entry chunks as index.[hash].js instead of webpack's a
Fix webassets to support Vite build output
The webui-vue project migrated from webpack to Vite, which changes the output filenames. Vite names entry chunks as index.[hash].js instead of webpack's app.[hash].js. The starts_with("index.") check in addFile() was remapping these JS/CSS files to their parent directory path (intended only for index.html), causing 404 errors when the browser requested the actual asset URLs.
Restrict the index file detection to only apply to .html files, so that index.html is still correctly mapped to "/" while other files starting with "index." are served at their actual paths.
Also broaden the etag hash detection from hex-only characters to full alphanumeric to support Vite's base64-style content hashes alongside webpack's hex hashes.
Add unit tests for getStaticEtag() covering both webpack and Vite hash formats, path prefixes, edge cases, and validation of hash length and character constraints.
Tested: Unit tests pass Vite-based webui-vue loads and caches etags
Change-Id: I3f7d2e062d0fd8be4ded7889b64a7228b4a6459b Signed-off-by: Jason Westover <jwestover@nvidia.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 64fe8020 | 28-Jan-2026 |
Ed Tanous <etanous@nvidia.com> |
Do not allow data beyond the trailer
There is nothing in the multipart spec[1] that states that a parser should allow any bytes after a multipart payload.
Several unit tests have a \r\n after their
Do not allow data beyond the trailer
There is nothing in the multipart spec[1] that states that a parser should allow any bytes after a multipart payload.
Several unit tests have a \r\n after their boundary condition that previously the parser just ignored. Testing shows this is fairly normal, so handle both cases still, but if any other characters show up, fail the parse.
Unit test is also simplified to be more clear.
Tested: Unit test coverage
[1] https://datatracker.ietf.org/doc/html/rfc7578#section-4.1
Change-Id: I16643c61867708886cc87c236447ec1c19bf934f Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 76c2ad64 | 03-Feb-2023 |
Ed Tanous <ed@tanous.net> |
Remove usages of nlohmann::json::begin()
nlohmann::json::begin() throws an uncaught exception.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I08244b
Remove usages of nlohmann::json::begin()
nlohmann::json::begin() throws an uncaught exception.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I08244b0787cd4d6e592b0731196490a5160aba62
show more ...
|
| 96a194c4 | 18-Aug-2025 |
Ed Tanous <ed@tanous.net> |
Implement modernize-use-ranges
This tidy check can transform code to use std::ranges. Enable the check, apply the fixes it proposes.
Tested: Redfish service validator passes in qemu
Change-Id: I3
Implement modernize-use-ranges
This tidy check can transform code to use std::ranges. Enable the check, apply the fixes it proposes.
Tested: Redfish service validator passes in qemu
Change-Id: I3f21b27d3d30277f71b9c8a2c584a22bc16865e9 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 9ad2c6f4 | 22-Oct-2025 |
Ed Tanous <etanous@nvidia.com> |
Update to boost 1.89
Update the subtree boost to 1.89; Keep the "required" version at 1.88 because that's currently what yocto uses. Now that we don't need old versions, the branch for boost 1.84
Update to boost 1.89
Update the subtree boost to 1.89; Keep the "required" version at 1.88 because that's currently what yocto uses. Now that we don't need old versions, the branch for boost 1.84 support is removed, and we can universally pull in boost::process as a library.
Additionally boost::core::string_view has defined a std::formatter nearly identical to what was done there, so there's now a conflict. Add a version check and shift to the boost provided formatter when it's available.
Tested: Code builds out of tree correctly.
Change-Id: I15a10da084da8f9d9460781b16a0fdc92987fc9a Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 1aa94df4 | 31-Jul-2025 |
Harshit Aghera <haghera@nvidia.com> |
sensor_utils: Add PeakReading property
Add support for PeakReading and PeakReadingTime for sensors. This enhancement allows sensor readings to include max observed value information in the Redfish A
sensor_utils: Add PeakReading property
Add support for PeakReading and PeakReadingTime for sensors. This enhancement allows sensor readings to include max observed value information in the Redfish API, along with timestamp. It uses PDI xyz.openbmc_project.Telemetry.Report. Property PeakReading is added if OperationType in PDI property ReadingParameters is set to Maximum.
Current Limitation - The ResetMetrics action is currently not supported for sensor URIs. As a result, the ability to clear PeakReading values for GPU Power Sensors has not been implemented.
Future Consideration - If ResetMetrics action support is added in the future, the corresponding functionality will also need to be implemented in the dbus-sensor application to ensure full compatibility.
Schema: https://redfish.dmtf.org/schemas/v1/Sensor.v1_2_0.yaml (PeakReading)
Backend implementation for reference: https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/82479
Tested: Build an image for nvl32-obmc machine with the following patches cherry picked.
https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490 https://gerrit.openbmc.org/c/openbmc/bmcweb/+/82449.
The patch cherry-picks the following patches that are currently under review.
``` 1. device tree https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/ 2. mctpd patches https://github.com/CodeConstruct/mctp/pull/85 3. u-boot changes https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t 4. kernel changes as specified in the openbmc patch (for espi) 5. entity-manager changes https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455 6. platform-init changes https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456 7. spi changes https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/ ```
``` > curl -s -k -u 'root:0penBmc' https://10.137.203.137/redfish/v1/Chassis/NVIDIA_GB200_1/Sensors/power_NVIDIA_GB200_GPU_0_Power_0 { "@odata.id": "/redfish/v1/Chassis/NVIDIA_GB200_1/Sensors/power_NVIDIA_GB200_GPU_0_Power_0", "@odata.type": "#Sensor.v1_2_0.Sensor", "Id": "power_NVIDIA_GB200_GPU_0_Power_0", "Name": "NVIDIA GB200 GPU 0 Power 0", "PeakReading": 52.671, "PeakReadingTime": 0, "Reading": 27.214, "ReadingRangeMax": 5000.0, "ReadingRangeMin": 0.0, "ReadingType": "Power", "ReadingUnits": "W", "Status": { "Health": "OK", "State": "Enabled" } }% ````
Change-Id: I8c1ab6ce85f31419db4a1d931bf99722d24afbd7 Signed-off-by: Harshit Aghera <haghera@nvidia.com>
show more ...
|
| e5ab2df5 | 21-Jul-2025 |
rajeeranjan <ranjan.rajeev1609@gmail.com> |
Add temp file and FD support to TemporaryFileHandle
This commit adds file descriptor and temporary file management to DuplicatableFileHandle, removing the redundant test-only TemporaryFileHandle uti
Add temp file and FD support to TemporaryFileHandle
This commit adds file descriptor and temporary file management to DuplicatableFileHandle, removing the redundant test-only TemporaryFileHandle utility.
Changes: - Add file descriptor constructor and setFd() method - Add temporary file constructor with string_view content - Add filePath member and automatic cleanup in destructor - Add configurable temp-dir meson option (default: /tmp/bmcweb) - Remove include/file_test_utilities.hpp - Update all tests to use DuplicatableFileHandle - Rename stringPath to filePath
These features will be used by the multipart parser to stream large uploads to temporary files instead of keeping them in memory, and by the update service to pass file descriptors over D-Bus.
Change-Id: I982f5928d453f9f0c13d91c3525006134ddc87b3 Signed-off-by: Rajeev Ranjan <ranjan.rajeev1609@gmail.com>
show more ...
|
| 6cbd6c41 | 10-Jul-2025 |
Ed Tanous <etanous@nvidia.com> |
fix: add account checking inside verifyMtls
Currently if we don't have account in bmcweb but have valid format certificate, we will have 500 internal server error when we send request to bmcweb. But
fix: add account checking inside verifyMtls
Currently if we don't have account in bmcweb but have valid format certificate, we will have 500 internal server error when we send request to bmcweb. But, if we don't have valid format certificate, we will get 401 unauthorized. This is not ideal as the http code is not appropriate. Also, this might introduce some security risk as the user can deduce whether their certificate format is valid or not based on the http code.
This patch is intended to solve this issue by checking whether the username exists in the system. If not, we will return nullptr inside verifyMtls function, which result in 401 unauthorized response if the user have valid format of certificate, but there is no related username inside the system
Change-Id: I479a10ed2bcce2c9969e19fa3aab9686ba4c71be Signed-off-by: Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 84153edd | 04-Nov-2025 |
Patrick Williams <patrick@stwcx.xyz> |
use sdbusplus unpack syntax
Rather than defining a variable and then reading it from a message, sdbusplus also supports directly unpack-ing from the message. Use this syntax instead as it is more e
use sdbusplus unpack syntax
Rather than defining a variable and then reading it from a message, sdbusplus also supports directly unpack-ing from the message. Use this syntax instead as it is more efficient and succinct.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iebf93534fb4b68ec5f37f0b81fbe3456831d5d70
show more ...
|
| a1700527 | 20-May-2024 |
Ed Tanous <ed@tanous.net> |
Set json no IO
There's only a couple remaining places we use json IO. Not including IO improves compile times in a minor way, because the nlohmann stream/file template is relatively expensive to co
Set json no IO
There's only a couple remaining places we use json IO. Not including IO improves compile times in a minor way, because the nlohmann stream/file template is relatively expensive to compile.
Tested: Launched bmcweb. Observed bmcweb_persistent_data.json created. Rebooted bmcweb with 'systemctl restart bmcweb' and observed launched correctly with persistent file present.
Change-Id: I56f674f20fa8553dc86245a765818849aa5fa102 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| e5dd4999 | 17-Feb-2025 |
Ed Tanous <etanous@nvidia.com> |
Remove getNthStringFromPath function
This utility function is being removed for several reasons. First, it does not verify the full string on URIs and paths, so things like /foo/bar/baz/valid_id wo
Remove getNthStringFromPath function
This utility function is being removed for several reasons. First, it does not verify the full string on URIs and paths, so things like /foo/bar/baz/valid_id would still pass this check.
Second, it is used for both URIs and dbus paths, both of which we have better utility functions these days respectively, boost::url for urls and sdbusplus::message::object_path for dbus paths. Neither of the two is escaped properly when this function is used.
Therefore, remove it and replace it with the appropriate alternatives.
The existing URI functions were found to not accept fragments (given they are rarely used in PATCH). Add support for fragments to cover the getNthStringFromPath use cases.
Tested: Redfish service validator passes.
Change-Id: Ibc6755ad69397123d7fef0e0b764042bbb48888b Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 13880454 | 17-Sep-2025 |
Ed Tanous <etanous@nvidia.com> |
Read state directory from systemd file
Reading the state dir from the systemd service file gives us flexibility to define the bmcweb state from wherever we like, rather than just using the current d
Read state directory from systemd file
Reading the state dir from the systemd service file gives us flexibility to define the bmcweb state from wherever we like, rather than just using the current directory, which might not be writable.
Tested: bmcweb boots, shows state is persisted in the same location as previously.
Change-Id: I9c048421fe249b73b1cae2ff5204ffd357cd3123 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 55385c70 | 06-Aug-2025 |
Ed Tanous <etanous@nvidia.com> |
Clean up CLI naming
Now that all applications run through one CLI, names like run() don't make a lot of sense. Update names to match the new reality, make bmcweb with no arguments launch the webser
Clean up CLI naming
Now that all applications run through one CLI, names like run() don't make a lot of sense. Update names to match the new reality, make bmcweb with no arguments launch the webserver once again.
Tested: bmcweb boots. Change-Id: I011b57507872a9518a9c470b58779805504c7293 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 28c3fdcc | 29-Sep-2025 |
Ed Tanous <ed@tanous.net> |
Fix arm BUILD
aarch64 gcc warns on this line. Fix it.
Change-Id: Ic752cda31f27b7d68af99ca53efcdfcdf0e659a7 Signed-off-by: Ed Tanous <etanous@nvidia.com> |
| 3577e446 | 19-Aug-2025 |
Ed Tanous <ed@tanous.net> |
Fix includes
Our includes haven't been enforced by tidy in a while. Run the script, check in the result, minus the false positives.
Change-Id: I6a6da26f5ba5082d9b4aa17cdc9f55ebd8cd41a6 Signed-off-
Fix includes
Our includes haven't been enforced by tidy in a while. Run the script, check in the result, minus the false positives.
Change-Id: I6a6da26f5ba5082d9b4aa17cdc9f55ebd8cd41a6 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 834d99ba | 03-Aug-2025 |
Myung Bae <myungbae@us.ibm.com> |
Fix handling of ssl_key_handler for WebUI
The previous commit 90cd2e1 [1] causes WebUI to fail to load and connect. It is because a global static var (`hasWebuiRoute`) is instantiated per compile u
Fix handling of ssl_key_handler for WebUI
The previous commit 90cd2e1 [1] causes WebUI to fail to load and connect. It is because a global static var (`hasWebuiRoute`) is instantiated per compile unit and it ends up causing the inconsistency of the value of it.
Tested: - Verify WebUI to load successful - Redfish Service Validator passes
[1] https://github.com/openbmc/bmcweb/commit/90cd2e1d2e2228b0c575c9a3b6b2dc75eac9eb68
Change-Id: I09c3a9a831528e25c09299b0ee15993974d94d88 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
| 1060065e | 07-Aug-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
identity.hpp: add header guard
Add `#pragma once` to a header file.
Noticed this issue when trying unity build in yocto environment.
``` bbmcweblib.a.p/bmcweblib-unity0.cpp | In file included from
identity.hpp: add header guard
Add `#pragma once` to a header file.
Noticed this issue when trying unity build in yocto environment.
``` bbmcweblib.a.p/bmcweblib-unity0.cpp | In file included from ../git/redfish-core/lib/network_protocol.hpp:14, | from /home/alexander/openbmc/build/s8030/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+git/build/../git/redfish-core/src/redfish.cpp:30, | from libbmcweblib.a.p/bmcweblib-unity0.cpp:13: | ../git/include/identity.hpp:7:20: error: redefinition of 'std::string getHostName()' | 7 | inline std::string getHostName() | | ^~~~~~~~~~~ | In file included from /home/alexander/openbmc/build/s8030/tmp/work/arm1176jzs-openbmc-linux-gnueabi/bmcweb/1.0+git/build/../git/http/mutual_tls.cpp:7, | from libbmcweblib.a.p/bmcweblib-unity0.cpp:1: | ../git/include/identity.hpp:7:20: note: 'std::string getHostName()' previously defined here | 7 | inline std::string getHostName() | | ^~~~~~~~~~~ | ninja: build stopped: subcommand failed. | INFO: autodetecting backend as ninja ```
Tested: Inspection only.
Change-Id: Ib7811ee12da763203b50fc81d39d642d2de3e212 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| b2539069 | 12-Mar-2024 |
Ed Tanous <etanous@nvidia.com> |
Implement zstd decompression
Given the size of Redfish schemas these days, it would be nice to be able to store them on disk in a zstd format. Unfortunately, not all clients support zstd at this ti
Implement zstd decompression
Given the size of Redfish schemas these days, it would be nice to be able to store them on disk in a zstd format. Unfortunately, not all clients support zstd at this time.
This commit implements reading of zstd files from disk, as well as decompressing zstd in the case where the client does not support zstd as a return type.
Tested: Implanted an artificial zstd file into the system, and observed correct decompression both with an allow-encoding header of empty string and zstd.
Change-Id: I8b631bb943de99002fdd6745340aec010ee591ff Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| e30d3345 | 24-Jun-2025 |
Corey Ethington <cethington@coreweave.com> |
Add ServiceIdentification
Implements GET and PATCH support for ServiceIdentification in Managers/bmc and service root.
Tested: - Refish Service Validator passes - Tested on romulus: 1. GET initial
Add ServiceIdentification
Implements GET and PATCH support for ServiceIdentification in Managers/bmc and service root.
Tested: - Refish Service Validator passes - Tested on romulus: 1. GET initial value ``` curl -k "https://$BMC/redfish/v1" { ... } ``` ServiceIdentification is not yet present in service root, as expected ``` curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/Managers/bmc" { ... "ServiceIdentification": "", ... } ```
2. PATCH and GET with valid value ``` curl -k -X PATCH "https://$BMC/redfish/v1/Managers/bmc" -H "X-Auth-Token: $XAUTH_TOKEN" \ -H 'Content-Type: application/json' --data-raw '{"ServiceIdentification": "foo"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request completed successfully.", "MessageArgs": [], "MessageId": "Base.1.19.Success", "MessageSeverity": "OK", "Resolution": "None." } ] }
curl -k "https://$BMC/redfish/v1" { ... "ServiceIdentification": "foo", ... }
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/Managers/bmc" { ... "ServiceIdentification": "foo", ... } ```
3. PATCH and GET with invalid value ``` curl -k -X PATCH "https://$BMC/redfish/v1/Managers/bmc" -H "X-Auth-Token: $XAUTH_TOKEN" \ -H 'Content-Type: application/json' --data-raw '{"ServiceIdentification": "$$$"}' { "ServiceIdentification@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value provided for the property ServiceIdentification is not valid.", "MessageArgs": [ "ServiceIdentification" ], "MessageId": "Base.1.19.PropertyValueError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ] }
curl -k -X PATCH "https://$BMC/redfish/v1/Managers/bmc" -H "X-Auth-Token: $XAUTH_TOKEN" \ -H 'Content-Type: application/json' --data-raw '{"ServiceIdentification": "2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The string 'ServiceIdentification' exceeds the length limit 99.", "MessageArgs": [ "ServiceIdentification", "99" ], "MessageId": "Base.1.19.StringValueTooLong", "MessageSeverity": "Warning", "Resolution": "Resubmit the request with an appropriate string length." } ], "code": "Base.1.19.StringValueTooLong", "message": "The string 'ServiceIdentification' exceeds the length limit 99." } }
curl -k "https://$BMC/redfish/v1" { ... "ServiceIdentification": "foo", ... }
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/Managers/bmc" { ... "ServiceIdentification": "foo", ... } ```
Change-Id: I5b71a73e947ec64cabb8d93c8503a18fb43b8937 Signed-off-by: Corey Ethington <cethington@coreweave.com>
show more ...
|
| 3b28fa2b | 23-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Rearrange features
The backends are different things compared to generic code. Today, these are all included in the /include folder, but it's not very clear what options control which backends, or
Rearrange features
The backends are different things compared to generic code. Today, these are all included in the /include folder, but it's not very clear what options control which backends, or how things map together. This also means that we can't separate ownership between the various companies.
This commit is a proposal to try to create a features folder, separated by the code for the various backends, to make interacting with this easier. It takes the form
features/<option name>/files.hpp features/<option name>/files_test.hpp
Note, redfish-core was already at top level, and contains lots of code, so to prevent lots of conflicts, it's simply symlinked into that folder to make clear that it is a backend, but not to move the implementation and cause code conflicts.
Tested: Unit tests pass. Code compiles.
Change-Id: Idcc80ffcfd99c876734ee41d53f894ca5583fed5 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| ad4f86b6 | 13-Jun-2025 |
Patrick Williams <patrick@stwcx.xyz> |
http_utility: removed unused using
GCC 15.1 fails with the following:
``` 19:18:43 | ../git/include/http_utility.hpp:50:30: error: unused using-declaration 'boost::spirit::x3::uint_' [-Werror=unuse
http_utility: removed unused using
GCC 15.1 fails with the following:
``` 19:18:43 | ../git/include/http_utility.hpp:50:30: error: unused using-declaration 'boost::spirit::x3::uint_' [-Werror=unused-variable] 19:18:43 | 50 | using boost::spirit::x3::uint_; ```
Fix it with a trivial removal of an unused using.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia24038d3146e818062dfb3f6c0c6bc84fa1ba470
show more ...
|
| 82b286fb | 06-May-2025 |
Ed Tanous <ed@tanous.net> |
Remove implicit conversions
Since 2020, nlohmann has recognized that implicit conversions to and from json are an issue. Many bugs have been caused at both development time and runtime due to unexp
Remove implicit conversions
Since 2020, nlohmann has recognized that implicit conversions to and from json are an issue. Many bugs have been caused at both development time and runtime due to unexpected implicit conversions from json to std::string/int/bool. This commit disables implicit conversions using JSON_USE_IMPLICIT_CONVERSIONS [1]. This option will become the default in the future. That comment was written 3 years ago at this point, so we should prepare.
Tested: Redfish service validator passes.
[1] https://json.nlohmann.me/api/macros/json_use_implicit_conversions/ Change-Id: Id6cc47b9bbf8889e4777fd6d77ec992f3139962c Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| a4943693 | 27-May-2025 |
Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com> |
remove meta mtls parse mode
as we have successfully merged patches that enable UserPrincipalName parse mode, we can start removing Meta only parse mode. This commit is intended to remove MTLSCommonN
remove meta mtls parse mode
as we have successfully merged patches that enable UserPrincipalName parse mode, we can start removing Meta only parse mode. This commit is intended to remove MTLSCommonNameParseMode::Meta from the upstream code
Tested: - build bmcweb - deploy to a device that already use UPN - check if it works fine by sending curl request /AccountService
Change-Id: Idcf4340a2a9940f035aea41cd30ef4df7bd95530 Signed-off-by: Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com>
show more ...
|
| 6136e852 | 14-May-2025 |
Myung Bae <myungbae@us.ibm.com> |
Fix inconsistent persistent subscription load
When BMC reboots or bmcweb restarts, the persistent subscriptions may not be loaded properly but they may still be in the file.
Later on if BMC reboots
Fix inconsistent persistent subscription load
When BMC reboots or bmcweb restarts, the persistent subscriptions may not be loaded properly but they may still be in the file.
Later on if BMC reboots or bmcweb restarts, those unloaded subscriptions may potentially and unexpectedly cause the reload into the active subscriptions.
The key cause is due to the compiler evaluation order for the function arguments where the last argument is evaluated and pushed into the stack first. As the result, the first argument `newSub->id` may already be invalid after the last argument `std::make_shared<>(std::move(*newSub))` is evaluated and pushed into the parameter stack [1]. This may cause the failure of `subscriptionsConfigMap.emplace()` and results in the missing instantiation of the persistent subscriptions.
Tested: - Create many subscriptions - GET subscriptions ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions { "@odata.id": "/redfish/v1/EventService/Subscriptions", "@odata.type": "#EventDestinationCollection.EventDestinationCollection", "Members": [ { "@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741" }, ... { "@odata.id": "/redfish/v1/EventService/Subscriptions/949306789" } ], "Members@odata.count": 6, "Name": "Event Destination Collections" } ``` - Restart bmcweb - GET subscriptions again and check whether they are the same. - Sometimes, none or only a few may be instantiated like
``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions { "@odata.id": "/redfish/v1/EventService/Subscriptions", "@odata.type": "#EventDestinationCollection.EventDestinationCollection", "Members": [ { "@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741" } ], "Members@odata.count": 1, "Name": "Event Destination Collections" } ``` - However, the file `/home/root/bmcweb_persistent_data.json` still has the old entries.
- Also verify Redfish Service Validator to pass
[1] https://github.com/openbmc/bmcweb/blob/0c814aa604b36cff01b495f9c335f981c7be83be/include/persistent_data.hpp#L184
Change-Id: Ia8a3c1bd3d4f4e479b599077ba8f26e47f8d22ef Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
| 3d158643 | 12-May-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix the build
I don't feel like breaking these out at the moment or writing a commit message. This fixes the build for clang-tidy. If anyone wants to break these out with appropriate commit messag
Fix the build
I don't feel like breaking these out at the moment or writing a commit message. This fixes the build for clang-tidy. If anyone wants to break these out with appropriate commit messages, feel free.
Change-Id: Id0b65d238dfb9b8036c0ffddf2f32d221e5988c2 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|