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

Duplicate key value violates unique constraint

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Server (S)
    • None
    • PostgreSQL 16 + Timescaledb + Zabbix Server 7.0.3
    • Sprint candidates

      There is an assumption that this may be related to old versions of zabbix-agent. Since version 6.0, the history scheme has been significantly changed by adding primary keys item, clock, ns. Since we use old zabbix-agent, we could not receive (or take into account) data that should be unique (item, clock, ns). What do you think?)

      ```

      2333:20240320:215501.796 [Z3008] query failed due to primary key constraint: [0] PGRES_FATAL_ERROR:ERROR:  duplicate key value violates unique constraint "6817_3461_history_uint_pkey"

      DETAIL:  Key (itemid, clock, ns)=(218671, 1710960896, 0) already exists.

        2333:20240320:215501.907 skipped 218 duplicates

      ```

      To confirm this theory, I am attaching tickets + code.

      https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/970b6b7c708f4dbc88d84b23a69cbc3235dcd29d#src/libs/zbxtime/time.c

      https://support.zabbix.com/browse/ZBXNEXT-6921

      https://support.zabbix.com/si/jira.issueviews:issue-html/ZBX-22695/ZBX-22695.html

            zabbix.dev Zabbix Development Team
            emikh Eugene Mihaylovskiy
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: