Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19705

User Macros with Macro as Context on VMware Trigger Prototype Causes Assertion

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Cannot Reproduce
    • Icon: Trivial Trivial
    • None
    • 5.4.2
    • Server (S)
    • Ubuntu 20.04
      Zabbix Server 5.4.2
      PostgreSQL 12.7
      TimescaleDB 1.7.5

      Steps to reproduce:

      1. Import vmware_guest_macro_context.xmlto Zabbix Server running version 5.0.12
        Or create a trigger protoype using and LLD macro #FSNAME in the macro context (modelled off the default Windows filesystem discovery template).
      2. Upgrade from 5.0.12 to 5.4.2
      3. The server  crashes with "Invalid trigger" and "zbx_db_rolback: Assertion '0' failed"

      Or

      1. Attempt to add a trigger prototype using an LLD macro #FSNAME in the macro context, eg: {$VFS.FS.PUSED.MAX.MAJ:" {#FSNAME}"}
        # A DB error is displayed: "Cannot update trigger prototype"

        Result:

        When upgrading with such template/trigger prototype, Zabbix Server starts and crashes, producing an error like:
         72661:20210713:210551.873 Invalid trigger "VMware: C:\Program Files\Citrix\PvsVm\Service\PersistedData\: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"C:\ProgramFiles\Citrix\PvsVm\Service\PersistedData\"}%) on {HOST.NAME}" expression: invalid token starting with "{$VFS.FS.PUSED.MAX.WARN:"C:\Program Files\Citrix\PvsVm\Service\PersistedData\"} and (({2}-{3})<10G or {4}<1d)"


        # Then:

        The DB contains all these triggers as state "Unknown" after upgrade.

        Zabbix Server starts and runs fine after deleting all these triggers (maybe not required) and disabling the trigger prototypes affected, then kill -9'ing/starting the service.

        When trying to add such trigger to Zabbix Server running version 5.4.2, a database error is displayed via the frontend :
        Cannot update trigger prototype

        
        

        pg_query(): Query failed: ERROR: deadlock detectedDETAIL: Process 757841 waits for ShareLock on transaction 353753080; blocked by process 617147.Process 617147 waits for ShareLock on transaction 353753075; blocked by process 757841.HINT: See server log for query details.CONTEXT: while updating tuple (2378,16) in relation "triggers" [trigger_prototypes.php:345 → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CTriggerPrototype->update() → CTriggerGeneral->inherit() → CTriggerGeneral->updateReal() → DB::update() → DBexecute() → pg_query() in include/db.inc.php:349]Error in query [UPDATE triggers SET expression='{541553}>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}

        "} and ((

        {541554}-{541555})<10G or {541556}<1d)',recovery_expression='',uuid='',description='VMware: {#FSNAME}: Disk space is very low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%) on {HOST.NAME}' WHERE triggerid='242563'] [ERROR: deadlock detectedDETAIL: Process 757841 waits for ShareLock on transaction 353753080; blocked by process 617147.Process 617147 waits for ShareLock on transaction 353753075; blocked by process 757841.HINT: See server log for query details.CONTEXT: while updating tuple (2378,16) in relation "triggers"]SQL statement execution has failed "UPDATE triggers SET expression='{541553}>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and (({541554}

        -

        {541555}

        )<10G or

        {541556}

        <1d)',recovery_expression='',uuid='',description='VMware:

        {#FSNAME}: Disk space is very low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}

        "}%) on

        {HOST.NAME}

        ' WHERE triggerid='242563'".

        
        

      Expected:
      Zabbix should support using an LLD macro in the macro context of VMware trigger prototypes, as supported with Windows.

            avolodin Aleksey Volodin
            shed Shane
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: