Closed vladimir-pachnik closed 2 years ago
Hi,
I also think that this problem originated from the command pipe usage. The deletion of the comment in Icinga 2 itself worked but the deletion from the database not. Is it true that you tried to delete all those comments in Web 2? How did you create those comments in the first place? And do they appear with icinga2 object list --type Comment | grep carbon-cache11
?
Comments in Icinga 2 itself are DSL objects and thus can be listed with the above command.
All the best, Eric
Hello,
icingaweb2
icinga2 object list --type Comment | grep carbon-cache11
Best regards
i have this same issue.. created comments via API are not possible to delete anymore Whether by IcingaWeb2 nor by API
however after restarting icinga2 the comments are deleted. for UI created comments its possible to delete via UI/API
The icinga2 process is the source of truth which comments currently do exist, so the issue here is that these weren't deleted from the IDO database rather than not being returned in the API. Given that Icinga DB was now released and the IDO was deprecated, this issue most likely won't receive anymore attention. Should you observe something similar with Icinga DB, please open another issue.
Describe the bug
When the API is queried for comment objects that are positively present in the IDO MySQL backend DB, it returns empty set.
The objects are visible in icingaweb2 UI (but cannot be deleted from there in turn).
To Reproduce
Provide a link to a live example, or an unambiguous set of steps to reproduce this issue. Include configuration, logs, etc. to reproduce, if relevant.
MariaDB [icinga]> select * from icinga_objects where icinga_objects.object_id in(49207,28340,1354,90); +-----------+-------------+---------------+------------------------------------+-------------------+-----------+ | object_id | instance_id | objecttype_id | name1 | name2 | is_active | +-----------+-------------+---------------+------------------------------------+-------------------+-----------+ | 90 | 1 | 13 | icinga2-master01.int.na.intgdc.com | NULL | 1 | | 1354 | 1 | 1 | carbon-cache11.int.eu1.intgdc.com | NULL | 1 | | 28340 | 1 | 2 | carbon-cache11.int.eu1.intgdc.com | splunkd-process | 1 | | 49207 | 1 | 2 | carbon-cache11.int.eu1.intgdc.com | splunk-forwarders | 1 | +-----------+-------------+---------------+------------------------------------+-------------------+-----------+
MariaDB [icinga]> select service_id,instance_id,host_object_id,service_object_id as s_o_id,display_name from icinga_services where icinga_services.service_object_id in('49207','28340'); +------------+-------------+----------------+--------+----------------------+ | service_id | instance_id | host_object_id | s_o_id | display_name | +------------+-------------+----------------+--------+----------------------+ | 24549 | 1 | 1354 | 28340 | Splunk process check | | 46207 | 1 | 1354 | 49207 | Splunk forwarders | +------------+-------------+----------------+--------+----------------------+
MariaDB [icinga]> select host_id,host_object_id,alias,display_name, address from icinga_hosts where icinga_hosts.host_object_id = 1354; +---------+----------------+-----------------------------------+-----------------------------------+--------------+ | host_id | host_object_id | alias | display_name | address | +---------+----------------+-----------------------------------+-----------------------------------+--------------+ | 1007 | 1354 | carbon-cache11.int.eu1.intgdc.com | carbon-cache11.int.eu1.intgdc.com | 10.8.147.167 | +---------+----------------+-----------------------------------+-----------------------------------+--------------+
curl -k -u root:REDACTED -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST https://localhost:5665/v1/objects/comments -d '{ "type": "Comment", "filter": "comment.host_name==\"carbon-cache11.int.eu1.intgdc.com\"","pretty": true }' { "results": [] }
curl -s -k -u root:REDACTED -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST https://localhost:5665/v1/objects/comments| jq '.'| grep carbon-cache11