Templates cannot be unlinked and cleared from hosts if trigger prototype in template depend on trigger in same template

XMLWordPrintable

    • Type: Problem report
    • Resolution: Duplicate
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.22, 7.4.5
    • Component/s: Frontend (F)
    • None

      Triggers created from trigger prototypes prevent unlinking and clearing the template, if the trigger prototype is depending on a master trigger from the template. 

      Host H

      Template T

          Trigger parent

          Trigger prototype proto depending on parent

       

      T linked to H

       

      During LLD, triggers are created on H:

          Trigger proto_instance (created from proto)

      When trying to "unlink and clear" T from H, an error is raised that it cannot be unlinked since proto_instance are depending on proto.

      Steps to reproduce:

      1. Clone default Zabbix template "Linux by Zabbix agent" to "Linux by Zabbix agent - clone 1"
      2. Under dicovery rule "Network interface discovery" , change Trigger "Linux: Interface {#IFNAME}: Link down" , under trigger Dependencies , set it depend on trigger "Linux: Zabbix agent is not available"
      3. Add template to a test host (lucky)
      4. Wait until data comes in , discovery rule process data and creates trigger prototypes
      5. Make sure that Trigger prototype is created and depends on "Linux: Zabbix agent is not available"
      6. Edit host , choose template "Linux by Zabbix agent - clone 1" do click "Unlink and clear" , when  click "Update" button  on host  , get error message 
      7. Get error message "Cannot update host"
        Cannot unlink template "Linux by Zabbix agent - clone 1" from host "lucky" due to dependency of trigger "Linux: Interface eth0: Link down". [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->update() → CHost->validateUpdate() → CHostBase->checkTemplatesLinks() → CHostBase->checkTriggerDependenciesOfHostTriggers() → CApiService::exception() in include/classes/api/services/CHostBase.php:401]
      8.  

      Result:

      Error message is shown,Template is not unlinked.

      Attached screenshot

      Expected:
      Expected template to unlink and clear data

      Workaround:

      Remove dependency in template trigger prototype
      Execute Network discovery rule
      Make sure trigger does not depend on "Linux: Zabbix agent is not available" anymore under Data Collection->Host->test_host->Triggers
      Unlink and clear

      Notes

      Tested on versions 7.0.22 and 7.4.5. 

      Same problem appears on 7.4.5 , but slightly different message  
      "Cannot update host"
      Cannot unlink template "Linux by Zabbix agent - clone 2" from host "h1" due to dependency of trigger "Linux: Interface eth0: Link down".

      Screenshot attached:

            Assignee:
            Zabbix Support Team
            Reporter:
            Guntis Liepins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: