template full cloning fails when trigger prototype depends on regular trigger with recovery expression

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Major
    • None
    • Affects Version/s: 6.0.19
    • Component/s: Frontend (F)
    • None

      Summary should be pretty much clear.

      Example minimalistic template attached zbx_export_templates-not-cloning.yaml

      Import to get "Example-not-cloning" template created and try to full clone it, you will get an error (line wraps are added for readability):

      Trigger prototype 
      "Interface {#IFINDEX}: Packet Loss on Link"
      cannot depend on the non-existent trigger 
      "direct trigger" 
      on the template 
      "Example-not-cloning-dupe". 
      [templates.php:399 → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CDiscoveryRule->copy() → CDiscoveryRule->copyDiscoveryRule() → CDiscoveryRule->copyTriggerPrototypes() → CApiService::exception() in include/classes/api/services/CDiscoveryRule.php:922]
      

       
      Then go to the single trigger on template level and change its mode to just Expression (without Recovery) and now you will be able to clone the template.

      It should not be this way, something is wrong in order of routines, when doing full clone such template.

      Tested on current git rev, Zabbix 6.0.20rc1

        1. error.png
          31 kB
          Oleksii Zagorskyi
        2. zbx_export_templates-not-cloning.yaml
          3 kB
          Oleksii Zagorskyi

            Assignee:
            Zabbix Development Team
            Reporter:
            Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: