[ZBX-5086] Updating host causes deleting of all trigger-dependencies of this host Created: 2012 May 29  Updated: 2017 May 30  Resolved: 2012 Jul 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.0
Fix Version/s: 2.0.2rc1, 2.1.0

Type: Incident report Priority: Critical
Reporter: rrr Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: dependencies, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File zbx5086.xml     XML File zbx_export_hosts(4).xml     XML File zbx_export_templates(2).xml    

 Description   

Everytime I update something in the host-inventary tab, all trigger-dependencies of this host will be removed.



 Comments   
Comment by Toms (Inactive) [ 2012 Jun 01 ]

Unable to reproduce, please specify more precisely steps to reproduce the problem.

Comment by rrr [ 2012 Jun 02 ]

If I change any field in system-tab or system-inventary-tab of any host - all trigger-dependencies of foreign-hosts only will be removed. Trigger-dependencies which belongs to the same host were not touched/removed.

Comment by Toms (Inactive) [ 2012 Jun 04 ]

Where do you find "system" or "system-inventory" tab? What you mean by "foreign-host"?
If possible please specify step by step instruction to reproduce the problem.

Comment by rrr [ 2012 Jun 04 ]

sorry, german translation in frontend differs sometimes...
just replace system and system-inventory into host and host-inventory, which are both placed at "configuration | hosts".

With trigger-dependencies of foreign-hosts i mean dependencies which doesn't belong to the same host but to another host.

Comment by Toms (Inactive) [ 2012 Jun 04 ]

Still unable to reproduce:

create host "h1"
create item "i1" on "h1"
create trigger "t1" on "h1"
create host "h2"
create item "i2" on "h2"
create trigger "t2" on "h2"
add dependency to trigger "t2" from trigger "t1"
change Host Inventory field "type" to "abc"

dependencies are not lost

Export attached.

Comment by rrr [ 2012 Jun 04 ]

ok, we're getting closer to the problem...

Dependencies are only not lost, if the item is created in this host. If the item/trigger is based on a template, it will be still removed after updating any host inventory field.

Comment by Toms (Inactive) [ 2012 Jun 04 ]

now I see the problem

Comment by Toms (Inactive) [ 2012 Jun 05 ]

Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5086

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 02 ]

(1) I have a template linked to a host with two triggers and a dependency between them. When I update the host, I get the following error:

Error in query [INSERT INTO trigger_depends (triggerid_down,triggerid_up,triggerdepid) VALUES ('100100000013823','100100000013816',100100000000575)] [Duplicate entry '100100000013823-100100000013816' for key 2]
SQL statement execution has failed "INSERT INTO trigger_depends (triggerid_down,triggerid_up,triggerdepid) VALUES ('100100000013823','100100000013816',100100000000575)". [CHost.update -> CHost.massUpdate -> CHost.massAdd -> CTemplate.massAdd -> CTemplate.link -> CTrigger.syncTemplateDependencies -> CTrigger.addDependencies -> DB.insert]

<Toms> unable to reproduce the error, please attach simple export for this case.

<pavels> Yeah, looks like it's a bit more complex to reproduce. See zbx_export_templates(2).xml for the template and zbx_export_hosts(4).xml for the host. After the import, try to update the dep-host.

<Toms> CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 02 ]

(2) Currently it's not a good idea, to add second arguments to public methods. I think we can introduce a private deleteTemplatedDependencies method to delete the corresponding dependencies.

<Toms> CLOSED

Comment by Toms (Inactive) [ 2012 Jul 09 ]

Started everything from scratch.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 10 ]

(1) Why is the $graph parameter in CTemplate::checkCircularAndDoubleLinkage passed as reference? Btw, I've corrected some code formatting issues in r28785.

<Toms> CLOSED As we discussed, we don't want to use reference for performance. Removed reference.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 11 ]

TESTED, but please close (1) before merging.

Comment by Toms (Inactive) [ 2012 Jul 11 ]

Fixed in 2.0.1rc1 r28794, 2.1.0 r28795

Generated at Sat Apr 20 13:04:00 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.