/check_mk/api/1.0/objects/agent/3c8d1a7ee35e1e01?host_name=<my hostname>&os_type=linux_rpm throws a HTTP 500 error

Trying to download an agent with the API (tested with the interactive GUI and with the examples provided at the API documentation) result in the following error:

{
  "title": "Internal Server Error",
  "status": 500,
  "detail": "'str' object has no attribute 'items'",
  "crash_id": "4c47eb7e-259e-11ec-96f8-005056a1b915",
  "crash_report": {
    "href": "http://<my checkmk master>/master/check_mk/crash.py?crash_id=4c47eb7e-259e-11ec-96f8-005056a1b915&site=master",
    "method": "get",
    "rel": "cmk/crash-report",
    "type": "text/html"
  },
  "stack_trace": [
    "Traceback (most recent call last):",
    "  File \"/omd/sites/master/lib/python3/cmk/gui/wsgi/applications/rest_api.py\", line 403, in _wsgi_app",
    "    return wsgi_app(environ, start_response)",
    "  File \"/omd/sites/master/lib/python3/cmk/gui/wsgi/applications/rest_api.py\", line 207, in __call__",
    "    wsgi_app = self.func(ParameterDict(path_args))",
    "  File \"/omd/sites/master/lib/python3/cmk/gui/plugins/openapi/restful_objects/decorators.py\", line 535, in _validating_wrapper",
    "    response = self.func(param)",
    "  File \"/omd/sites/master/lib/python3/cmk/gui/cee/plugins/openapi/endpoints/agent.py\", line 353, in show_agent_information",
    "    config_rules = get_agent_config_rules(agent_hash)",
    "  File \"/omd/sites/master/lib/python3/cmk/gui/cee/plugins/wato/agent_bakery/misc.py\", line 155, in get_agent_config_rules",
    "    for key, value in conf.items():",
    "AttributeError: 'str' object has no attribute 'items'",
    ""
  ]
}

Any hint what’s wrong here?

This looks like the same issue I have:
Use REST API for automatic agent deployment - Troubleshooting - Checkmk Community

If I’m not mistaken, it should be fixed in 2.0.0p12: RESTAPI: fix agent information and agent download (checkmk.com)
Now we only have to wait until it is released :wink:

1 Like

Hi @Wummeke and @MasopustC , p12 is now out :slight_smile:

2 Likes

already downloaded :slight_smile: … but looks like your webserver certificate has expired (at least my wget complained about it :slight_smile: )

Can confirm that on my site this error has been gone!

Thanks a lot for your effort!

Downloading the agent works for me too, with this new release.

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.