Search Ruleset API Returns HTTP 500

CMK version: Checkmk Raw Edition 2.1.0
OS version: 20.04.4 LTS (Focal Fossa)

Error message: Error: Internal Server Error

I am experimenting with the Checkmk REST API (via the interactive UI [/check_mk/api/1.0/ui/]) in an effort to make adding a large number of rules simpler and easier. One of the required fields for creating a rule is ruleset so I tried calling the search ruleset API (GET /domain-types/ruleset/collections/all) to get a list of all of the known rulesets but it returns an HTTP 500 error. I tried setting/updating various optional fields but the result was always the same. The show ruleset API (GET /objects/ruleset/{ruleset_name}) seems to work as intended when provided a proper value for the ruleset name.

I checked the Apache access log and confirmed that the 500 error is being thrown by Apache. I checked the Apache error log but it does not have any entries correlating the requests that returned HTTP 500.

How can I troubleshoot this further? Any guidance is appreciated.

Thank you,
Jason

Hi,

I can recreate the issue in 2.1.0p8 when I use the fulltext parameter for this Endpoint.
You can see the Stacktrace in ~/var/log/web.log and there is also a crash Report created:

It is working fine when I use only the folder parameter or the name parameter.
This request is showing me the “Check HTTP service” Ruleset for example:

http://<myhost>/<mysite>/api/1.0/domain-types/ruleset/collections/all?name=HTTP

I will send a mail to the checkmk feedback mail for the issue with the fulltext parameter.

Best Regards
Thomas

1 Like

Thank you for confirming that you are able to replicate this issue, Thomas.

Thank you also for the additional information about the log file and crash report. I reviewed the crash reports in my system and found that there seems to be 2 different issues: using the fulltext parameter results in the same error you see in 2.1.0p8; while using no parameters results in TypeError (Object of type HTML is not JSON serializable).

Can you please confirm whether you are also able to reproduce the latter case? If not then it has likely already been fixed.

I can confirm that using the name parameter works properly on vanilla 2.1.0 as well.

I have no issues when I use no Parameters for the Ruleset Endpoint, the following query works fine:

http://<cmkhost>/<cmksite>/api/1.0/domain-types/ruleset/collections/all

Maybe this is the werk which has fixed it:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.