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

Duplicate entries in trigger_depends entries are created by copying from host to templates, breaks upgrade to 2.0

    XMLWordPrintable

Details

    • Incident report
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.8.15
    • None
    • Frontend (F)

    Description

      Certain behaviour can provoke duplicate entries in the trigger_depends table, resulting in failure when updating to 2.0:

      ERROR: could not create unique index "trigger_depends_1"
      DETAIL: Table contains duplicated values.
      ERROR: current transaction is aborted, commands ignored until end of transaction block

      There seem to be different ways to cause the problem. I discovered the following one:

      • Create a host, create two items and triggers on these items; add dependency between the two
      • Create a template (no need to assign it to a host)
      • Copy the items and then the triggers to the template

      SELECT count, t.description as trigger_down, t2.description as trigger_up from trigger_depends as td join triggers as t on td.triggerid_down = t.triggerid join triggers as t2 on td.triggerid_up = t2.triggerid group by 2, 3 having count > 1 order by 1 desc;

      count | trigger_down | trigger_up
      ------------------------------------------------------
      2 | affentrigger2 | affentrigger

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              volter Volker Fröhlich
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: