History log of /openbmc/bmcweb/redfish-core/src/error_messages.cpp (Results 1 – 25 of 74)
Revision Date Author Comments
# fa345c78 16-Jun-2024 Ed Tanous <ed@tanous.net>

Add EventBufferExceeded message

This is a method that exists in the base registry that we will use in
the next commit.

Tested: Code compiles. Code is not yet used.

Change-Id: I02e81371adeb8d3e2c2

Add EventBufferExceeded message

This is a method that exists in the base registry that we will use in
the next commit.

Tested: Code compiles. Code is not yet used.

Change-Id: I02e81371adeb8d3e2c2515a8af94b9a1ac0973a9
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 4a7fbefd 06-Apr-2024 Ed Tanous <ed@tanous.net>

Fix large copies with url_view and segments_view

Despite these objects being called "view" they are still relatively
large, as clang-tidy correctly flags, and we ignore.

Change all function uses to

Fix large copies with url_view and segments_view

Despite these objects being called "view" they are still relatively
large, as clang-tidy correctly flags, and we ignore.

Change all function uses to capture by:
const boost::urls::url_view_base&

Which is the base class of all boost URL types, and any class (url,
url_view, etc) is convertible to that base.

Change-Id: I8ee2ea3f4cfba38331303a7e4eb520a2b6f8ba92
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 1827b4f1 03-Apr-2024 Asmitha Karunanithi <asmitk01@in.ibm.com>

Move to Redfish Action specific setProperty call

This commit will migrate all the setProperty calls initiated by a
redfish"Action" to "setDbusProperty" method in Redfish namespace that
handles all D

Move to Redfish Action specific setProperty call

This commit will migrate all the setProperty calls initiated by a
redfish"Action" to "setDbusProperty" method in Redfish namespace that
handles all DBuserrors in a consistent manner.

This method will determine if a setProperty is called during redfish
"Action" or just setting of a dbus property and internally call
appropriate methods that handles different set of errors.

All the Redfish action specific errors are defined in error_messages.hpp
file.
This specific change moves setProperty call in hypervisor_system.hpp and
covers errors in the mentioned file only.

Tested-By:
<Yet to test this usecase>

Change-Id: I3da48fbeabcdcf088c4481021232f08a44797c86
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# f0b59af4 20-Mar-2024 Ed Tanous <ed@tanous.net>

Add misc-include-cleaner

And fix the includes that are wrong.

Note, there is a very large ignore list included in the .clang-tidy
configcfile. These are things that clang-tidy doesn't yet handle
w

Add misc-include-cleaner

And fix the includes that are wrong.

Note, there is a very large ignore list included in the .clang-tidy
configcfile. These are things that clang-tidy doesn't yet handle
well, like knowing about a details include.

Change-Id: Ie3744f2c8cba68a8700b406449d6c2018a736952
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 367b3dce 17-Jan-2024 Ginu George <ginugeorge@ami.com>

Pass correct Argument Types to propertyValueIncorrect Error Message

Changed the code to pass the parameters according to their types.

Tested: Code Compiles properly and tested.

Change-Id: Ie0e13d3

Pass correct Argument Types to propertyValueIncorrect Error Message

Changed the code to pass the parameters according to their types.

Tested: Code Compiles properly and tested.

Change-Id: Ie0e13d39cd892afda36dfabec871f0fe8d8498e4
Signed-off-by: Ginu George <ginugeorge@ami.com>

show more ...


# 99bf0262 21-Aug-2023 Divya Jyoti <divya1.jyoti@intel.com>

Fix incorrect response code for header size limit

In this commit the response code for the exceeding header size limit
during event subscription(post request to
/redfish/v1/EventService/Subscription

Fix incorrect response code for header size limit

In this commit the response code for the exceeding header size limit
during event subscription(post request to
/redfish/v1/EventService/Subscriptions) is changed to 400 (Bad
Request) instead of 405 (Method not allowed)

Tested:
If header size in post body is large(>8096), then response code is
returned as 400

Change-Id: Ie1301777c994dff64a49e625d7f4f7de72010610
Signed-off-by: Divya Jyoti <divya1.jyoti@intel.com>

show more ...


# 62598e31 17-Jul-2023 Ed Tanous <ed@tanous.net>

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.

Tested: compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8

show more ...


# d9fcfcc1 06-Jul-2023 Ed Tanous <edtanous@google.com>

Tidy enable modernize-redundant-void-arg

We have places where we explicitly set something to the pattern of
method(void)

This is no longer necessary to declare, so fix the places where we do
it to

Tidy enable modernize-redundant-void-arg

We have places where we explicitly set something to the pattern of
method(void)

This is no longer necessary to declare, so fix the places where we do
it to make the codebase consistent, and enable the check.

Tested: Clang-tidy passes.

Change-Id: I3ef03fc07d65b656fecbcfea638dd12ba95f22e0
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# d85418e3 23-Jun-2023 Patrick Williams <patrick@stwcx.xyz>

error_messages: remove source_location indirect

clang-16 now supports std::source_location so remove the indirection
that uses experimental::source_location in some cases.

Tested: Compiled with `CX

error_messages: remove source_location indirect

clang-16 now supports std::source_location so remove the indirection
that uses experimental::source_location in some cases.

Tested: Compiled with `CXX=clang++`.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Id55bdf01855206c6892684e1e56cc5ff56e2b5a2

show more ...


# 95b3ad73 27-Jun-2022 Ed Tanous <edtanous@google.com>

Make redfish::messages rely on typesafe structures

The previous patches modified these fields one at a time, for the cases
where we had code calling these in odd ways. This commit goes and
effects

Make redfish::messages rely on typesafe structures

The previous patches modified these fields one at a time, for the cases
where we had code calling these in odd ways. This commit goes and
effects the same change on the rest of the message handlers where it
makes sense.

Any input to a message function that mentions a "value" replaces the
value with a nlohmann::json object, to make calling this code easier.

The one exception is StringValueTooLong, which by definition, requires
the input value to be a string, so that is left as string_view
intentionally.

Tested: Dead unused code. Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I00b9804b2aadf5584032be91a0ee53b9a94a7430

show more ...


# 14fbced6 27-Jun-2022 Ed Tanous <edtanous@google.com>

Make propertyValueIncorrect typesafe

Similar to the previous patches, make propertyValueIncorrect accept a
nlohmann::json object as input. This removes the need for the dump()
call, which oddly eno

Make propertyValueIncorrect typesafe

Similar to the previous patches, make propertyValueIncorrect accept a
nlohmann::json object as input. This removes the need for the dump()
call, which oddly enough, in our one usage, was actually incorrect, and
could cause bmcweb to throw an exception in parsing in theory.

Tested: Only used in one error condition. Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie35d61101c2db88b16d42d71e66bceef540e8429

show more ...


# f818b04d 27-Jun-2022 Ed Tanous <edtanous@google.com>

Make propertyValueFormatError more typesafe

Similar to other patches, make propertyValueFormatError accept a
nlohmann::json object, which removes a lot of the unsafe dump code that
we have littered

Make propertyValueFormatError more typesafe

Similar to other patches, make propertyValueFormatError accept a
nlohmann::json object, which removes a lot of the unsafe dump code that
we have littered about.

Tested: No easy to replicate error. Code is identical to previous
patchsets. Inspection and code compilation only.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic9d0f196b6e198073189f744b738db7ffa2f1b74

show more ...


# 2e8c4bda 27-Jun-2022 Ed Tanous <edtanous@google.com>

Make propertyValueTypeError more typesafe

Similar to the prior patchset in this series, propertyValueTypeError can
be moved to safer constructs. This ensures that we are minimizing how
many places

Make propertyValueTypeError more typesafe

Similar to the prior patchset in this series, propertyValueTypeError can
be moved to safer constructs. This ensures that we are minimizing how
many places we are calling dump() from, and allows us to reduce the
amount of code written for error handling.

Tested:
PATCH /redfish/v1/SessionService {"SessionTimeout": "foo"}

Returns PropertyValueTypeError in the same behavior as prior to this
patch.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iddff4b787f35c49bf923663d61bba156687f358c

show more ...


# e2616cc5 27-Jun-2022 Ed Tanous <edtanous@google.com>

Make propertyValueNotInList typesafe

The error codes for this function accept a string_view, which has caused
a number of cases of users of this function to call dump() to_string()
and all manner of

Make propertyValueNotInList typesafe

The error codes for this function accept a string_view, which has caused
a number of cases of users of this function to call dump() to_string()
and all manner of other conversions. Considering that dump() is
something that's difficult to call correctly, and overly wordy, it would
be ideal if the message code just handled that for us.

Therefore, this commit changes the prototype to include a nlohmann::json
object as an argument instead of string_view, then audits the codebase
for all uses, and moves them to a more normalized usage, which allows
the calling code to call "dump" for them.

Tested: PATCH /redfish/v1/SessionService {"SessionTimeout": 1}

Returns the PropertyValueNotInList error as it did before.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If62909072db1f067ad1f8aa590bb716c84181219

show more ...


# c1c7b94b 02-Jun-2023 Ed Tanous <edtanous@google.com>

Remove duplicated stringValueTooLong

This prototype got added twice, once with int as a value, and once with
size_t. This builds fine in 64 bit, but in 32 bit, fails.

Tested: Code compiles

Signed

Remove duplicated stringValueTooLong

This prototype got added twice, once with int as a value, and once with
size_t. This builds fine in 64 bit, but in 32 bit, fails.

Tested: Code compiles

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie3de779330d768cdd84d5647d242d5fe447d2a85

show more ...


# 600af5f1 06-Oct-2021 AppaRao Puli <apparao.puli@linux.intel.com>

Input parameter validation for Event Subscription

User input must be validated to avoid the out-of-memory issue. This
commit adds the size check on input parameters such as Context,
Destination and

Input parameter validation for Event Subscription

User input must be validated to avoid the out-of-memory issue. This
commit adds the size check on input parameters such as Context,
Destination and Header field while create or update the
EventDestination.

Added a generic error message "PropertySizeExceeded" in message registry
which is used as response when size limit is exceeded.

Tested
- Validated using POST on Event Subscription.
- When Context, Destination and Headers were too long,
received a error message denoting the same.

Change-Id: Ibab847ce0c99f445a76e6d3aee8074428bb7d30f
Signed-off-by: AppaRao Puli <apparao.puli@intel.com>
Signed-off-by: Ayushi Smriti <smriti.ayushi@intel.com>
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# faf100f9 25-May-2023 Ed Tanous <edtanous@google.com>

Fix some includes

System includes should be included with <>, in-tree includes should be
included with "". This was found manually, with the help of the
following grep statement[1].

git grep -o -h

Fix some includes

System includes should be included with <>, in-tree includes should be
included with "". This was found manually, with the help of the
following grep statement[1].

git grep -o -h "#include .*" | sort | uniq

Tested:
Code compiles

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1a6b2a5ba35ccbbb61c67b7c4b036a2d7b3a36a3

show more ...


# ad539545 12-May-2023 Patrick Williams <patrick@stwcx.xyz>

use emplace where appropriate per clang-tidy

The clang-tidy warning 'modernize-use-emplace' correctly flags a
few places where emplace should be used over push.

Signed-off-by: Patrick Williams <pat

use emplace where appropriate per clang-tidy

The clang-tidy warning 'modernize-use-emplace' correctly flags a
few places where emplace should be used over push.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6ca79285a87d6927e718345dc8dce0387e6b1eda

show more ...


# d9f466b3 06-Mar-2023 Ed Tanous <edtanous@google.com>

Take url views by value

Any of our things taking URLs should be taking url_view by value,
similar to how we take string_view.

From the beast documentation:
"...it acts like a string_view in terms o

Take url views by value

Any of our things taking URLs should be taking url_view by value,
similar to how we take string_view.

From the beast documentation:
"...it acts like a string_view in terms of ownership." [1]
Therefore, we should treat it like we treat string_view, and take by value, not reference.

[1] https://www.boost.org/doc/libs/master/libs/url/doc/html/url/ref/boost__urls__url_view.html

Tested:
Stacked these patches. Redfish service validator passes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I696b495f4aa04984225853f653cc175c0eaad79d

show more ...


# 4ef82a15 03-Feb-2023 Alex Schendel <alex.schendel@intel.com>

Add Support for ActionParameterNotInList Message

This commit adds support for the ActionParameterNotInList Redfish DMTF
error message.

Change-Id: I7fd9b7c952e7ffa4c7c4c585ae28315b40556a21
Signed-of

Add Support for ActionParameterNotInList Message

This commit adds support for the ActionParameterNotInList Redfish DMTF
error message.

Change-Id: I7fd9b7c952e7ffa4c7c4c585ae28315b40556a21
Signed-off-by: Alex Schendel <alex.schendel@intel.com>

show more ...


# 079360ae 29-Jun-2022 Ed Tanous <edtanous@google.com>

Prepare for boost::url upgrade

The new boost URL now interops properly with std::string_view, which is
great, and cleans up a bunch of mediocre code to convert one to another.
It has also been pulle

Prepare for boost::url upgrade

The new boost URL now interops properly with std::string_view, which is
great, and cleans up a bunch of mediocre code to convert one to another.
It has also been pulled into boost-proper, so we no longer need a
boost-url dependency that's separate.

Unfortunately, boost url makes these improvements by changing
boost::string_view for boost::urls::const_string, which causes us to
have some compile errors on the missing type.

The bulk of these changes fall into a couple categories, and have to be
executed in one commit.
string() is replaced with buffer() on the url and url_view types
boost::string_view is replaced by std::string_view for many times, in
many cases removing a temporary that we had in the code previously.

Tested: Code compiles with boost 1.81.0 beta.
Redfish service validator passes.
Pretty good unit test coverage for URL-specific use cases.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8d3dc89b53d1cc390887fe53605d4867f75f76fd

show more ...


# b4ad4c05 16-Sep-2022 Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>

bmcweb: Add strictAccountTypes error message

Error message to be thrown when StrictAccountTypes is true and the
specified value(s) for AccountTypes or OEMAccountTypes was not accepted.

Testing:
str

bmcweb: Add strictAccountTypes error message

Error message to be thrown when StrictAccountTypes is true and the
specified value(s) for AccountTypes or OEMAccountTypes was not accepted.

Testing:
strictAccountTypes() error message was tested while testing redfish
PATCH API for patching AccountTypes.

Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
Change-Id: I13abcd142ddfb04a2a187c9373fa996ecfe987a1

show more ...


# 3590bd1d 12-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: propogate errors for expand

The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subquer

query: propogate errors for expand

The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subqueries and the "highest priority" HTTP code.

DMTF doesn't specify how expand queries handle error codes, since using
subqueries is an implementation choice that we made in this project.

What we did here follows existing behavior of this project, and follows
the error message section of the Redfish spec;
[1] https://redfish.dmtf.org/schemas/DSP0266_1.15.1.html#error-responses

As for now, this commit uses the worst HTTP code among all the error
code. See query_param.hpp, function |propogateErrorCode| for detailed
order of the errror codes.

Tested:
1. this is difficult to test, but I hijacked the code so it returns
errors in TaskServices, then I verified that "/redfish/v1?$expand=."
correctly returns 500 and the gets the error message set.
2. unit test so that when there are multiple errors, the final response
gets a generate error message.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I0c1ebdd9015f389801db9150d687027485f1203c

show more ...


# 613dabea 09-Jul-2022 Ed Tanous <edtanous@google.com>

Remove nlohmann brace initialization

There's a few last places (outside of tests) where we still use
nlohmann brace initialization. Per the transforms we've been doing,
move these to constructing t

Remove nlohmann brace initialization

There's a few last places (outside of tests) where we still use
nlohmann brace initialization. Per the transforms we've been doing,
move these to constructing the objects explicitly, using operator[],
nlohmann::object_t and nlohmann::array_t. Theses were found by manual
inspection grepping for all uses of nlohmann::json.

This is done to reduce binary size and reduce the number of intermediate
objects being constructed. This commit saves a trivial amount of size
(~4KB, Half a percent of total) and in addition but makes our
construction consistent.

Tested:
Redfish service validator passes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7478479a9fdc41b254eef325002d413c1fb411a0

show more ...


# 44c70412 31-Jul-2022 Ed Tanous <edtanous@google.com>

Add 405 handler for redfish

Redfish has specific error messages for OperationNotSupported in the
Base registry. This commit allows bmcweb to return both the correct
return code (405) and the correc

Add 405 handler for redfish

Redfish has specific error messages for OperationNotSupported in the
Base registry. This commit allows bmcweb to return both the correct
return code (405) and the correct error message, while not effecting the
rest of the tree.

We didn't have the equivalent call in error_messages, so this adds the
required call.

Tested:
GET /redfish/v1 returns ServiceRoot
GET /redfish/v1/foo Returns 404
PATCH /redfish/v1 returns 405 OperationNotSupported
POST /redfish/v1/Chassis returns 405 OperationNotSupported
DELETE /redfish/v1/Chassis returns 405 ResourceCannotBeDeleted
POST /redfish/v1/foo/bar Returns 404

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6f980af7307af602344b65a12a2b7589cc9ec959
Signed-off-by: Carson Labrado <clabrado@google.com>

show more ...


123