#
a0969c70
|
| 19-Sep-2024 |
Myung Bae <myungbae@us.ibm.com> |
Remove subscription for TerminateAfterRetries policy
Redfish Data Model [1] section 6.42.5.2 and EventDestination schema [2] specify that the subscription is terminated under the following policy an
Remove subscription for TerminateAfterRetries policy
Redfish Data Model [1] section 6.42.5.2 and EventDestination schema [2] specify that the subscription is terminated under the following policy and the conditions.
DeliveryRetryPolicy: - `TerminateAfterRetries`: ``` This value shall indicate the subscription is terminated after the maximum number of retries is reached, specified by the DeliveryRetryAttempts property in the event service. ```
This implements this policy to delete subscription of the stale client connections after trying `DeliveryRetryAttempts` when `DeliveryRetryPolicy == TerminateAfterRetries`.
Tested: 1) Subscription with blocked communication between bmcweb and listener
- Run Redfish Event Listener [3] to subscribe events with `DeliveryRetryPolicy == TerminateAfterRetries`
- Check the subscription creation ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/ ```
- Generate an event and check the delivery to the listener. For example, ``` curl -k -X POST https://${bmc}/redfish/v1/EventService/Actions/EventService.SubmitTestEvent ```
- Block the communication between bmcweb and listener (or modify the listener not to delete the subscription at its exit, and kill the listener so that its subscription is still alive)
- If the above task is already finished, generate more events and wait for the sufficient time till `DeliveryRetryAttempts`.
- bmcweb journal log may contain the entries like ``` Sep 20 10:47:55 p10bmc bmcwebd[286]: [ERROR http_client.hpp:444] Maximum number of retries reached. https://9.3.62.209:8080/Redfish-Event-Listener Sep 20 10:47:55 p10bmc bmcwebd[286]: [ERROR event_service_manager.hpp:1459] Subscription 590587653 is deleted after MaxRetryAttempts ```
- Check the subscription again if the subscription is deleted.
2) Redfish Validator passes
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2024.3.html [2] https://github.com/openbmc/bmcweb/blob/878edd599b1706ec8ffe6c3d81ba7cb3534f6393/redfish-core/schema/dmtf/csdl/EventDestination_v1.xml#L857 [3] https://github.com/DMTF/Redfish-Event-Listener
Change-Id: I6e41288995cbb6e37e17a7ef1be093abb7ce54b9 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
#
56ba386d
|
| 10-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Fix Persistent Subscription PATCH
The `RedfishEvent` subscription is expected to be persistent over bmc reboot or bmcweb restart. However, the properties on PATCH are currently not persistent after
Fix Persistent Subscription PATCH
The `RedfishEvent` subscription is expected to be persistent over bmc reboot or bmcweb restart. However, the properties on PATCH are currently not persistent after reboot or bmcweb restart.
This commit is to sync those properties to the persistent store after PATCH.
In addition, this commit fixes a missing `id` copy when a new UserSubscription is created in [1] (introduced by [2]). As a result, it may cause the following messages during bmcweb start after subscription POST or PATCH like ``` Oct 16 14:37:34 p10bmc systemd[1]: Started Start bmcwebd server. Oct 16 14:37:34 p10bmc bmcwebd[15320]: [ERROR event_service_store.hpp:253] Subscription missing required field information, refusing to restore Oct 16 14:37:34 p10bmc bmcwebd[15320]: [ERROR persistent_data.hpp:166] Problem reading subscription from persistent store ``` After this, those subscriptions become lost.
Tested:
1. Subscription PATCH
- Create a subscription (e.g. use Redfish-Service-Validator).
- GET subscription and check the properties ``` SUBID=<id> curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} ```
- PATCH subscription with a different value. ``` curl -k -X PATCH https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} \ -H "Content-Type: application/json" -d '{"DeliveryRetryPolicy":"RetryForever"}' ```
- Reboot BMC or restart bmcweb
- GET subscription and check the properties ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} ````
Before the fix, the property values are the same as before PATCH. After the fix, the last patched property values will be kept.
2. Redfish Service Validator passes
[1] https://github.com/openbmc/bmcweb/blob/21a94d5cd4be74a85c978c0cd63e4c633093c531/redfish-core/include/event_service_manager.hpp#L812 [2] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/65720
Change-Id: If5d2f622cc945faa6999d1e3e70211e881e19a79 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
#
788b091b
|
| 14-Oct-2024 |
Igor Kanyuka <ifelmail@gmail.com> |
Event: Change MemberId type to string
The type of the MemberId according to the schema https://redfish.dmtf.org/schemas/v1/Event.v1_4_0.json is string and not int. This prevents the request from be
Event: Change MemberId type to string
The type of the MemberId according to the schema https://redfish.dmtf.org/schemas/v1/Event.v1_4_0.json is string and not int. This prevents the request from being deserialized by clients written in typed languages.
Change-Id: Ic1a00044fdb71e20cb96d4256e935f59bf79da8f Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
show more ...
|
#
21a94d5c
|
| 14-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Fix coredump during subscription
Commit 4b712a29debc1a0860cc04850b262203cad402a5 [1] a bug on missing the subscription copy from user persistent data when subscription object is created, and it may
Fix coredump during subscription
Commit 4b712a29debc1a0860cc04850b262203cad402a5 [1] a bug on missing the subscription copy from user persistent data when subscription object is created, and it may cause a bmcweb crash.
Tested:
- Create subscription (e.g. Redfish Event Listener)
- Create a dump ``` curl -k -X POST "https://${bmc}/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData" \ -H "Content-Type: application/json" -d '{"DiagnosticDataType": "Manager"}'
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 ```
BMC journal will contain like ``` Oct 14 21:49:20 p10bmc bmcwebd[287]: terminate called after throwing an instance of 'std::bad_weak_ptr' Oct 14 21:49:20 p10bmc bmcwebd[287]: what(): bad_weak_ptr Oct 14 21:49:21 p10bmc systemd[1]: bmcweb.service: Main process exited, code=dumped, status=6/ABRT Oct 14 21:49:21 p10bmc systemd[1]: bmcweb.service: Failed with result 'core-dump'
``` [1] 4b712a29debc1a0860cc04850b262203cad402a5
Change-Id: I58479bb5e1f203fec60ad0971f0c750ab5695f14 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
#
d3a48a14
|
| 25-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Refactor eventMatchesFilter
eventMatchesFilter no longer needs to be a member of the Subscription class, because it no longer uses subscription data. Refactor so it can be in its own file, with its
Refactor eventMatchesFilter
eventMatchesFilter no longer needs to be a member of the Subscription class, because it no longer uses subscription data. Refactor so it can be in its own file, with its own set of unit tests.
Tested: Unit Tests pass.
Change-Id: I718fa36021078973609591c704cb717d31079df7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
4b712a29
|
| 02-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Move UserSubscription to composition
This allows for two very important simplifying changes. First, we can use the default copy operators on the UserSubscription class, which is far less error pron
Move UserSubscription to composition
This allows for two very important simplifying changes. First, we can use the default copy operators on the UserSubscription class, which is far less error prone than writing it manually, which we have two copies of in code already.
Second, it allows the Subscription class to move to using values rather than shared_ptr everywhere, which cleans up a significant amount of code.
Tested: Ran Redfish-Event-Listener, subscription created and destroyed correctly. Calling POST SubmitTestEvent showed events propagating to server.
Change-Id: I6d258cfe3594edddf3960ae2d4559d70acca1bf8 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
a14c9113
|
| 04-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Add extra subscription params support
OriginResource allows filtering messages on a per-device basis. This was already listed as supported in our docs.
RegistryPrefixes is also added.
Tested: Uni
Add extra subscription params support
OriginResource allows filtering messages on a per-device basis. This was already listed as supported in our docs.
RegistryPrefixes is also added.
Tested: Unit tests pass.
Change-Id: Idfde8416f2f466ce11957177e052b540fc669888 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
6d799e14
|
| 11-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Rename sendEvent
There are currently 3 function prototypes that hold the name "sendEvent". This makes them hard to search for, and even though they take different arguments, and are attached to dif
Rename sendEvent
There are currently 3 function prototypes that hold the name "sendEvent". This makes them hard to search for, and even though they take different arguments, and are attached to different classes, they're still difficult to trace.
Rename two of the classes.
Tested: Code compiles. Rename only.
Change-Id: I5df9c690ba0ca8ebe19c73fc0848e9c3ef4d52f7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
6be832e2
|
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that c
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that can likely be had.
[1] https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=edtanous_bmcweb&open=AY9_HYjgKXKyw1ZFwgVP
Tested: Comment change only. Code compiles.
Change-Id: Ia960317761f558a87842347ca0b5f3da63f8e730 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
03d4d37c
|
| 29-Aug-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
event service manager: more meaningful debug logs
When debugging event subscriptions, this helps to investigate where a particular event was filtered or experienced some validation error.
Change-Id
event service manager: more meaningful debug logs
When debugging event subscriptions, this helps to investigate where a particular event was filtered or experienced some validation error.
Change-Id: If08ac5c7d2dea5921261a8a464d3ea6899615df5 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
#
d2cdd478
|
| 13-Aug-2024 |
Chandra Harkude <Chandramohan.harkude@gmail.com> |
Event : add MemberId in TestEvent
Currently the memberId is missing in the Event structure of TestEvent but memeberId must be present in the Event structure as per DMTF schema
https://redfish.dmtf.
Event : add MemberId in TestEvent
Currently the memberId is missing in the Event structure of TestEvent but memeberId must be present in the Event structure as per DMTF schema
https://redfish.dmtf.org/schemas/v1/Event.v1_10_1.json
Therefore added MemberId in Test event structure.
Tested : ``` curl -k -u root:0penBmc -X POST /redfish/v1/EventService/Actions/ EventService.SubmitTestEvent -d '{"MessageId":""}'
Event received at the Redfish-Event-Listener
bodydata: { "@odata.type": "#Event.v1_4_0.Event", "Events": [ { "Context": "", "EventId": "TestID", "EventTimestamp": "2024-08-13T08:14:56+00:00", "EventType": "Event", "MemberId": 0, "Message": "Generated test event", "MessageArgs": [], "MessageId": "OpenBMC.0.2.TestEventLog", "Severity": "OK" } ], "Id": "1", "Name": "Event Log" } ``` Change-Id: I285e41ce377127fb1429f643e5068635384c7bfd Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
show more ...
|
#
bd79bce8
|
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
471cd249
|
| 19-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Remove EventType
EventType::Event doesn't exist in the Event schema.
Initially, we thought to change it to EventType::Alert, but further inspection of the Redfish schemas shows that the property it
Remove EventType
EventType::Event doesn't exist in the Event schema.
Initially, we thought to change it to EventType::Alert, but further inspection of the Redfish schemas shows that the property itself is deprecated, so rather than try to make it "correct" it is better to just remove it.
This is technically a breaking API change, but given that very few schema-correct implementations of Redfish clients exist, even fewer EventService receivers exist, and this hasn't been reported before, I'd be extremely surprised if this broke any implementation.
Tested: Sending test events shows no EventType generated.
Change-Id: I933b2cc1dc2fb71714392949dd6eb030fbdcf8aa Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
539d8c6b
|
| 19-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are allowed.
Doing this found two places where we had structs that didn't fulfill the schema. They have been commented, but will be fixed with a breaking change at some point in the future.
Tested: WIP
Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
f80a87f2
|
| 16-Jun-2024 |
Ed Tanous <etanous@nvidia.com> |
Add SSE filter param support
The Redfish spec require filtering of SSE entries to be supported. This commit rearranges the code, and implements SSE sorting as well as support for Last-Event-Id. To
Add SSE filter param support
The Redfish spec require filtering of SSE entries to be supported. This commit rearranges the code, and implements SSE sorting as well as support for Last-Event-Id. To do this it adds a dependency on boost circular_buffer.
Tested:
SSE connections succeed. Show filtered results.
Change-Id: I7aeb266fc40471519674c7b65cd5cc4625019e68 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
f8fe2211
|
| 16-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Simplify task service code
This code repeats itself a lot. Reduce complexity.
Tested: ``` curl -vvvv -k --http1.1 --user "root:0penBmc" -X POST "https://192.168.7.2/redfish/v1/Managers/bmc/LogServ
Simplify task service code
This code repeats itself a lot. Reduce complexity.
Tested: ``` curl -vvvv -k --http1.1 --user "root:0penBmc" -X POST "https://192.168.7.2/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData" -H "Content-Type: application/json" -d '{"DiagnosticDataType": "Manager"}' ```
Starts a dump, and operates as expected.
Change-Id: I36000aababfc842845ba0d2103d3f6cd79a12385 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
19bb362b
|
| 05-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
EventDestination: Implement VerifyCertificate
VerifyCertificate is a property on the Redfish EventDestination schema. It specifies that this property is: ``` An indication of whether the service wil
EventDestination: Implement VerifyCertificate
VerifyCertificate is a property on the Redfish EventDestination schema. It specifies that this property is: ``` An indication of whether the service will verify the certificate of the server referenced by the `Destination` property prior to sending the event ```
To keep prior behavior, and to ensure behavior that's secure by default, if the user omits the property, it is assumed to be true. This property is also persisted and restored.
Tested: Redfish-Event-Listener succeeds with the following procedure Start Redfish-Event-Listener PATCH /redfish/v1/Subscriptions/<subid> VerifyCertificate: false POST /redfish/v1/EventService/Actions/EventService.SubmitTestEvent
Redfish-Event-Listener then hits an internal error, due to an encoding compatibility unrelated to this patch, but is documented in the receiver [1]
POST of a subscription with VerifyCertificate: false set, succeeds.
[1] https://github.com/DMTF/Redfish-Event-Listener/blob/6f3f98beafc89fa9bbf86aa4f8cac6c1987390fb/RedfishEventListener_v1.py#L61
Change-Id: I27e0a3fe87b4dbd0432bfaa22ebf593c3955db11 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
9ed3f90a
|
| 15-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Fix crash on subscriptions
When the subscription limit is hit, there is Subscription events generated when Subscription objects are constructed. Unfortunately, we make an accidental copy of the Sub
Fix crash on subscriptions
When the subscription limit is hit, there is Subscription events generated when Subscription objects are constructed. Unfortunately, we make an accidental copy of the Subscription object in include/persistent_data.hpp
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/72670
Is lined up to fix that issue, but we need to fix the underlying problem where we have memory safety issues in global variables.
This commit is something to fix the issue, by simply destroying the object causing the problem before more events can be received.
Tested: Followed instructions on the aforementioned commit to create the max number of subscriptions. Called systemctl restart bmcweb
Observed no more crash on shutdown.
Change-Id: Ie52545f5cb8a044c186d0e9db47362e170b1fdb5 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
04c35e22
|
| 17-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove unused variable
This hasn't been used in a while. Remove it.
Tested: Code compiles.
Change-Id: I3134cee6e013a630cc7d17727c2f29de3a40fbc1 Signed-off-by: Ed Tanous <etanous@nvidia.com> Signe
Remove unused variable
This hasn't been used in a while. Remove it.
Tested: Code compiles.
Change-Id: I3134cee6e013a630cc7d17727c2f29de3a40fbc1 Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
0bdda665
|
| 03-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Remove nlohmann::json::items()
nlohmann::json::items() throws an exception if the object in question is not a json object. This has the potential to cause problems, and isn't in line with the stand
Remove nlohmann::json::items()
nlohmann::json::items() throws an exception if the object in question is not a json object. This has the potential to cause problems, and isn't in line with the standard that we code against.
Replace all uses of items with iterating the nlohmann::json::object_t.
This adds a new error check for pulling the object_t out of the nlohmann::json object before each iteration, to ensure that we're handling errors.
Tested: Redfish service validator passes.
Change-Id: I2934c9450ec296c76544c2a7c5855c9b519eae7f Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
c688dde3
|
| 16-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Remove readSSEQueryParams method
This method is currently unused, and as-written, only implements a portion of the filter specification. It has things that are incorrect to the standard, like compl
Remove readSSEQueryParams method
This method is currently unused, and as-written, only implements a portion of the filter specification. It has things that are incorrect to the standard, like completely removing slashes (which are supposed to represent json pointers) and parens (which are supposed to represent precedence of operators).
Given the prior commits which implement a full parser for filter expressions, including a proper AST with unit testing, this seems reasonable to remove.
This block of code was originally checked in here: 07941a88 Support the $filter query params for SSE stream then almost immediately reverted in part, keeping this block of code so we could reuse it once the SSE problems were fixed. d206b437 Revert http::Request::socket() callback
There has been no input since, so it should be safe to delete this block.
Tested: Dead code, not used. Code compiles.
Change-Id: I95bcac6984aeb569a38c8c2e1e083119c5c97aa4 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
bdbfae2a
|
| 22-May-2024 |
Ed Tanous <ed@tanous.net> |
Fix crash in SSE
When multiple SSE sockets are present, this code has a potential to crash, given the vector is being modified in this loop.
Tested: Reproduction of this is not reliable. Inspectio
Fix crash in SSE
When multiple SSE sockets are present, this code has a potential to crash, given the vector is being modified in this loop.
Tested: Reproduction of this is not reliable. Inspection only.
Change-Id: I66d4b55b5c0ad46d41d34dd6558b50c5f6fcfc12 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
83328316
|
| 09-May-2024 |
Ed Tanous <ed@tanous.net> |
Fix lesser used options
25b54dba775b31021a3a4677eb79e9771bcb97f7 missed several cases where we had ifndef instead of ifdef. because these weren't the defaults, these don't show up as failures when
Fix lesser used options
25b54dba775b31021a3a4677eb79e9771bcb97f7 missed several cases where we had ifndef instead of ifdef. because these weren't the defaults, these don't show up as failures when testing.
Tested: Redfish service validator passes. Inspection primarily. Mechanical change.
Change-Id: I3f6915a97eb44d071795aed76476c6bee7e8ed27 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
5b90429a
|
| 16-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit:
When that's done, these missing headers become compile errors. We should just fix the
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit:
When that's done, these missing headers become compile errors. We should just fix them.
In addition, this allows us to enable automatic header checking in clang-tidy using misc-header-cleaner. Because the compiler can now "see" all the defines, it no longer tries to remove headers that it thinks are unused.
[1] https://github.com/openbmc/bmcweb/commit/4fdee9e39e9f03122ee16a6fb251a380681f56ac
Tested: Code compiles.
Change-Id: Ifa27ac4a512362b7ded7cc3068648dc4aea6ad7b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
4c521c3c
|
| 07-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix file removal
This code used std::remove, which is a mechanism for removing characters from strings. Clearly it meant std::filesystem::remove(), which removes files from the filesystem.
Correct
Fix file removal
This code used std::remove, which is a mechanism for removing characters from strings. Clearly it meant std::filesystem::remove(), which removes files from the filesystem.
Correct it.
Change-Id: I030966203c1682a11c723c596accdf34637dd1ba Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|