ZABBIX BUGS AND ISSUES

Not adding triggers dependencies from template

Details

  • Zabbix ID:
    Reviewed 2.0

Description

This issue is the same as ZBX-4056 but for 1.8 branch.

We have two templates with one trigger per every template where one is the dependency for another.
After link templates to host, trigger dependency is missing.
API was not tested.

Activity

Hide
richlv added a comment -

still the same in 1.8.9rc2

Show
richlv added a comment - still the same in 1.8.9rc2
Hide
richlv added a comment - - edited

(1) changes in rev 24828 violate coding style guidelines
<Slava>RESOLVED

<richlv> if statement indentation seems to be still broken, it's spacing is broken as well (after all, that line was modified...) and sql statement still has excess spaces between arguments. there might be other things not listed here.

<Sasha> An update_template_dependencies_for_host() function is not used anywhere; a commented code should be removed
<Slava>RESOLVED r 24896

<pavels> More coding style fixes in r25011, please review.

<Sasha> CLOSED

Show
richlv added a comment - - edited (1) changes in rev 24828 violate coding style guidelines <Slava>RESOLVED <richlv> if statement indentation seems to be still broken, it's spacing is broken as well (after all, that line was modified...) and sql statement still has excess spaces between arguments. there might be other things not listed here. <Sasha> An update_template_dependencies_for_host() function is not used anywhere; a commented code should be removed <Slava>RESOLVED r 24896 <pavels> More coding style fixes in r25011, please review. <Sasha> CLOSED
Hide
Alexander Vladishev added a comment - - edited

(2) when linking a template to a host, host triggers depends on template triggers
https://support.zabbix.com/secure/attachment/17827/triggers.jpg
<Slava>RESOLVED r 24896

<pavels> No it wasn't. RESOLVED in r25038.
<Sasha> CLOSED

Show
Alexander Vladishev added a comment - - edited (2) when linking a template to a host, host triggers depends on template triggers https://support.zabbix.com/secure/attachment/17827/triggers.jpg <Slava>RESOLVED r 24896 <pavels> No it wasn't. RESOLVED in r25038. <Sasha> CLOSED
Hide
richlv added a comment - - edited

(3) rev 24923 - typo in the changelog entry
<Slava>RESOLVED

<pavels> CLOSED.

Show
richlv added a comment - - edited (3) rev 24923 - typo in the changelog entry <Slava>RESOLVED <pavels> CLOSED.
Hide
Alexander Vladishev added a comment - - edited

(4) dependencies aren't copied in operation "Copy selected to ..."

<pavels> RESOLVED.
<Sasha> CLOSED

Show
Alexander Vladishev added a comment - - edited (4) dependencies aren't copied in operation "Copy selected to ..." <pavels> RESOLVED. <Sasha> CLOSED
Hide
Pavels Jelisejevs added a comment - - edited

(5) When linking a template with a dependency on a different template, an empty error line appears:

Trigger in template [ template ] has dependency with trigger in template [ template2 ]

Cannot link template
Host update failed

<pavels> RESOLVED.
<Sasha> CLOSED

Show
Pavels Jelisejevs added a comment - - edited (5) When linking a template with a dependency on a different template, an empty error line appears: Trigger in template [ template ] has dependency with trigger in template [ template2 ] Cannot link template Host update failed <pavels> RESOLVED. <Sasha> CLOSED
Hide
Alexander Vladishev added a comment - - edited

(6) when copying trigger from host to another host there are superfluous actions with DB:

.....
Time:0.000961 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (29,13482,13480)
.....
Time:0.000961 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (30,13483,13481)
.....
Time:0.000969 SQL: DELETE FROM trigger_depends WHERE triggerid_up=13480 AND triggerid_down=13482
Time:0.000971 SQL: DELETE FROM trigger_depends WHERE triggerid_up=13481 AND triggerid_down=13483
.....
Time:0.000962 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (31,13482,13483)
.....
Time:0.000963 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (32,13483,13484)
.....

<pavels> RESOLVED.
<Sasha> CLOSED

Show
Alexander Vladishev added a comment - - edited (6) when copying trigger from host to another host there are superfluous actions with DB: ..... Time:0.000961 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (29,13482,13480) ..... Time:0.000961 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (30,13483,13481) ..... Time:0.000969 SQL: DELETE FROM trigger_depends WHERE triggerid_up=13480 AND triggerid_down=13482 Time:0.000971 SQL: DELETE FROM trigger_depends WHERE triggerid_up=13481 AND triggerid_down=13483 ..... Time:0.000962 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (31,13482,13483) ..... Time:0.000963 SQL: INSERT INTO trigger_depends (triggerdepid,triggerid_down,triggerid_up) VALUES (32,13483,13484) ..... <pavels> RESOLVED. <Sasha> CLOSED
Hide
Alexander Vladishev added a comment - - edited

(7) include/triggers.inc.php:2317 A 'triggerArray' variable can be undefined.

<pavels> RESOLVED.
<Sasha> CLOSED

Show
Alexander Vladishev added a comment - - edited (7) include/triggers.inc.php:2317 A 'triggerArray' variable can be undefined. <pavels> RESOLVED. <Sasha> CLOSED
Hide
Alexander Vladishev added a comment - - edited

(8) Operation "Copy selected to..." and "Full clone" copies trigger dependencies only for one level. All child triggers remains without dependencies.

<pavels> RESOLVED.
<Sasha> CLOSED

Show
Alexander Vladishev added a comment - - edited (8) Operation "Copy selected to..." and "Full clone" copies trigger dependencies only for one level. All child triggers remains without dependencies. <pavels> RESOLVED. <Sasha> CLOSED
Hide
Alexander Vladishev added a comment - - edited

(9) When adding trigger with dependencies, new child triggers are added without dependencies.

<pavels> RESOLVED.
<Sasha> CLOSED

Show
Alexander Vladishev added a comment - - edited (9) When adding trigger with dependencies, new child triggers are added without dependencies. <pavels> RESOLVED. <Sasha> CLOSED
Hide
Alexander Vladishev added a comment - - edited

(10) Mass update operation clears all dependencies. Related issue: ZBX-4600

<pavels> This problem is not related to the current issue, I suggest we fix it in a separate branch. Shouldn't it be a blocker? Looks quite nasty.
<Sasha> Ok, CLOSED

Show
Alexander Vladishev added a comment - - edited (10) Mass update operation clears all dependencies. Related issue: ZBX-4600 <pavels> This problem is not related to the current issue, I suggest we fix it in a separate branch. Shouldn't it be a blocker? Looks quite nasty. <Sasha> Ok, CLOSED
Hide
Alexander Vladishev added a comment - - edited

Related issue: ZBX-648

<pavels> Isn't this a server side problem?
<Sasha> Of course, it's on a server side.

Show
Alexander Vladishev added a comment - - edited Related issue: ZBX-648 <pavels> Isn't this a server side problem? <Sasha> Of course, it's on a server side.
Hide
Alexander Vladishev added a comment -

Successfully tested!

Show
Alexander Vladishev added a comment - Successfully tested!
Hide
Pavels Jelisejevs added a comment -

Merged to 1.8 r25222.

Show
Pavels Jelisejevs added a comment - Merged to 1.8 r25222.
Hide
Pavels Jelisejevs added a comment -

The problem persists in the trunk, but we need to close ZBX-4598 before we can fix it.

Show
Pavels Jelisejevs added a comment - The problem persists in the trunk, but we need to close ZBX-4598 before we can fix it.
Hide
Pavels Jelisejevs added a comment - - edited

Alexander has written a spec on how templated trigger dependencies should be handled. It's available here http://zabbix.org/wiki/Docs/specs/ZBX-4333

<zalex> I guess we have ZBXNEXT-1072 to discuss this awesome work. I'll add few thoughts there.

Show
Pavels Jelisejevs added a comment - - edited Alexander has written a spec on how templated trigger dependencies should be handled. It's available here http://zabbix.org/wiki/Docs/specs/ZBX-4333 <zalex> I guess we have ZBXNEXT-1072 to discuss this awesome work. I'll add few thoughts there.
Hide
Pavels Jelisejevs added a comment -

The fix for the trunk is available in /branches/dev/ZBX-4333-trunk. I've done some code refactoring and fixed several bugs connected to trigger dependencies. I think the code will be a little simpler now.

RESOLVED.

Show
Pavels Jelisejevs added a comment - The fix for the trunk is available in /branches/dev/ZBX-4333-trunk. I've done some code refactoring and fixed several bugs connected to trigger dependencies. I think the code will be a little simpler now. RESOLVED.
Hide
Oleksiy Zagorskyi added a comment -

ZBX-4317 could be retested after this fix and maybe closed too

Show
Oleksiy Zagorskyi added a comment - ZBX-4317 could be retested after this fix and maybe closed too
Hide
Eduards Samersovs added a comment - - edited

(11) Create T2 from T3 dependence. Create T1 from T2 dependence. Create T3 from T1 dependence. The result is incorrect error message, seems update with rollback happens.
Updated: Trigger "cpu t3" on "dep_t3".
Incorrect dependency. [CTrigger.update -> CTrigger.addDependencies -> CTrigger.validateAddDependencies -> CTrigger.checkDependencies]

<pavels> Indeed, we need to create the triggers first, and only then can we validate the dependencies and rollback, if something is not right. To fix this, we would need to completely rewrite the code.

<Eduard> CLOSED

Show
Eduards Samersovs added a comment - - edited (11) Create T2 from T3 dependence. Create T1 from T2 dependence. Create T3 from T1 dependence. The result is incorrect error message, seems update with rollback happens. Updated: Trigger "cpu t3" on "dep_t3". Incorrect dependency. [CTrigger.update -> CTrigger.addDependencies -> CTrigger.validateAddDependencies -> CTrigger.checkDependencies] <pavels> Indeed, we need to create the triggers first, and only then can we validate the dependencies and rollback, if something is not right. To fix this, we would need to completely rewrite the code. <Eduard> CLOSED
Hide
Eduards Samersovs added a comment - - edited

(12) Trigger can be dependent on himself.

P.S. When we try remove trigger dependence on himself error message is shown:
Updated: Trigger "cpu t3" on "dep_t3".
Empty input parameter. [CTrigger.update -> CTrigger.addDependencies -> CTrigger.validateAddDependencies]

<pavels> RESOLVED.
<Eduard> CLOSED

Show
Eduards Samersovs added a comment - - edited (12) Trigger can be dependent on himself. P.S. When we try remove trigger dependence on himself error message is shown: Updated: Trigger "cpu t3" on "dep_t3". Empty input parameter. [CTrigger.update -> CTrigger.addDependencies -> CTrigger.validateAddDependencies] <pavels> RESOLVED. <Eduard> CLOSED
Hide
Eduards Samersovs added a comment - - edited

(13) Create template with trigger (TT1). Create host with trigger (HT1). Create dependence TT1 to HT1. Save. Try remove this dependence - error message is shown..

Updated: Trigger "t1" on "dep_t1".
Empty input parameter. [CTrigger.update -> CTrigger.addDependencies -> CTrigger.validateAddDependencies]

<pavels> RESOLVED.
<Eduard> CLOSED

Show
Eduards Samersovs added a comment - - edited (13) Create template with trigger (TT1). Create host with trigger (HT1). Create dependence TT1 to HT1. Save. Try remove this dependence - error message is shown.. Updated: Trigger "t1" on "dep_t1". Empty input parameter. [CTrigger.update -> CTrigger.addDependencies -> CTrigger.validateAddDependencies] <pavels> RESOLVED. <Eduard> CLOSED
Hide
Eduards Samersovs added a comment - - edited

(14) Create Template with 1 item and 2 triggers (T1 and T2). Create trigger dependence T2 from T1. Make full clone. Error message is shown..

Created: Item "cpu t1" on "dep_t1_clone".
Created: Trigger "t1.1" on "dep_t1_clone".
Created: Trigger "t1.2" on "dep_t1_clone".
mysql_real_escape_string() expects parameter 1 to be string, array given [include/db.inc.php:616]
mysql_real_escape_string() expects parameter 1 to be string, array given [include/db.inc.php:616]
Cannot create dependency [CTrigger.create -> CTrigger.addDependencies]

<pavels> RESOLVED.
<Eduard> CLOSED

Show
Eduards Samersovs added a comment - - edited (14) Create Template with 1 item and 2 triggers (T1 and T2). Create trigger dependence T2 from T1. Make full clone. Error message is shown.. Created: Item "cpu t1" on "dep_t1_clone". Created: Trigger "t1.1" on "dep_t1_clone". Created: Trigger "t1.2" on "dep_t1_clone". mysql_real_escape_string() expects parameter 1 to be string, array given [include/db.inc.php:616] mysql_real_escape_string() expects parameter 1 to be string, array given [include/db.inc.php:616] Cannot create dependency [CTrigger.create -> CTrigger.addDependencies] <pavels> RESOLVED. <Eduard> CLOSED
Hide
Eduards Samersovs added a comment - - edited

(15) Create Template with 1 item and 2 triggers (T1 and T2). Create trigger dependence T2 from T1. Try "copy to" T1 to some other template. Validation message is confusing..

Created: Trigger "t1.1" on "dep_t2_clone".
Empty input parameter. [CTrigger.addDependencies -> CTrigger.validateAddDependencies]

<pavels> RESOLVED.
<Eduard> Still can reproduce

<pavels> Sorry, I've misunderstood your description. RESOLVED.
<Eduard> CLOSED

Show
Eduards Samersovs added a comment - - edited (15) Create Template with 1 item and 2 triggers (T1 and T2). Create trigger dependence T2 from T1. Try "copy to" T1 to some other template. Validation message is confusing.. Created: Trigger "t1.1" on "dep_t2_clone". Empty input parameter. [CTrigger.addDependencies -> CTrigger.validateAddDependencies] <pavels> RESOLVED. <Eduard> Still can reproduce <pavels> Sorry, I've misunderstood your description. RESOLVED. <Eduard> CLOSED
Hide
Eduards Samersovs added a comment - - edited

(16) Some messages are not translatable.

CTrigger->addDependencies()
self::exception(ZBX_API_ERROR_PARAMETERS, 'Cannot create dependency');

CTrigger->deleteDependencies()
self::exception(ZBX_API_ERROR_PARAMETERS, 'Cannot delete dependency');

<pavels> RESOLVED.
<Eduard> CLOSED

Show
Eduards Samersovs added a comment - - edited (16) Some messages are not translatable. CTrigger->addDependencies() self::exception(ZBX_API_ERROR_PARAMETERS, 'Cannot create dependency'); CTrigger->deleteDependencies() self::exception(ZBX_API_ERROR_PARAMETERS, 'Cannot delete dependency'); <pavels> RESOLVED. <Eduard> CLOSED
Hide
Eduards Samersovs added a comment -

Tested

Show
Eduards Samersovs added a comment - Tested
Hide
Oleksiy Zagorskyi added a comment - - edited

Pavels, just interesting, why here is so many work for trunk although we have resolved and closed ZBX-4056?
Additional improvements?

<pavels> More like additional bug fixes. Even after ZBX-4056 a lot of problems with trigger dependencies remained.
<zalex> Thanks. CLOSED

Show
Oleksiy Zagorskyi added a comment - - edited Pavels, just interesting, why here is so many work for trunk although we have resolved and closed ZBX-4056? Additional improvements? <pavels> More like additional bug fixes. Even after ZBX-4056 a lot of problems with trigger dependencies remained. <zalex> Thanks. CLOSED
Hide
Pavels Jelisejevs added a comment - - edited

I've updated to the latest trunk and manually resolved some conflicts, please check that everything is ok in CTemplate.php, CTrigger.php and CTriggerGeneral.php.

<Eduard> Unfortunately can't find any bug, so CLOSED

Show
Pavels Jelisejevs added a comment - - edited I've updated to the latest trunk and manually resolved some conflicts, please check that everything is ok in CTemplate.php, CTrigger.php and CTriggerGeneral.php. <Eduard> Unfortunately can't find any bug, so CLOSED
Hide
Pavels Jelisejevs added a comment -

Merged to trunk r25906.

CLOSED.

Show
Pavels Jelisejevs added a comment - Merged to trunk r25906. CLOSED.
Hide
Pavel Timofeev added a comment -

It's very very awaiting change for new 1.8 release.

Show
Pavel Timofeev added a comment - It's very very awaiting change for new 1.8 release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: