Ad Widget

Collapse

Duplicate entry for primary key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bvlad
    Junior Member
    • Feb 2017
    • 5

    #1

    Duplicate entry for primary key

    I am attempting to add a template to a host, it looks to create the applications and items, but it doesn't bring over the triggers. This is what happens when attempting to add the template:

    Cannot update host
    Details
    • Created: Item "SQL: Service State - SQL Server" on "SQLServ5".
    • Created: Item "SQL: Service State - SQL Agent" on "SQLServ5".
    • Created: Application "Availability" on "SQLServ5".
    • Created: Application "CPU" on "SQLServ5".
    • Created: Application "Filesystem" on "SQLServ5".
    • Created: Application "General" on "SQLServ5".
    • Created: Application "Integrity" on "SQLServ5".
    • Created: Application "Memory" on "SQLServ5".
    • Created: Application "Network" on "SQLServ5".
    • Created: Application "OS" on "SQLServ5".
    • Created: Application "Performance" on "SQLServ5".
    • Created: Application "Processes" on "SQLServ5".
    • Created: Application "Services" on "SQLServ5".
    • Error in query [INSERT INTO items_applications (applicationid,itemid,itemappid) VALUES ('1725','44928','17326')] [Duplicate entry '17326' for key 'PRIMARY']
    • SQL statement execution has failed "INSERT INTO items_applications (applicationid,itemid,itemappid) VALUES ('1725','44928','17326')".

    I've tried deleting that itemappid from the items_applications table, but it just recreates it or gives the same error on a different itemappid.
  • bvlad
    Junior Member
    • Feb 2017
    • 5

    #2
    This is zabbix server 3.0 running on Centos 7.2.1511 and MariaDB 5.5.44.

    Comment

    • bvlad
      Junior Member
      • Feb 2017
      • 5

      #3
      Tried deleting all duplicates, but now it is just looping with the following when we try applying the template to the host:

      Error in query [INSERT INTO items_applications (applicationid,itemid,itemappid) VALUES ('1725','44930','17326')] [Duplicate entry '17326' for key 'PRIMARY']
      SQL statement execution has failed "INSERT INTO items_applications (applicationid,itemid,itemappid) VALUES ('1725','44930','17326')".


      and

      Error in query [INSERT INTO housekeeper (tablename,field,value,housekeeperid) VALUES ('trends','itemid','44930','8002')] [Duplicate entry '8002' for key 'PRIMARY']
      SQL statement execution has failed "INSERT INTO housekeeper (tablename,field,value,housekeeperid) VALUES ('trends','itemid','44930','8002')".

      Comment

      • bvlad
        Junior Member
        • Feb 2017
        • 5

        #4
        Ended up going out and finding all primary key conflicts and deleted them.

        Truncated auditlog and housekeeper tables.

        Issue resolved.
        Last edited by bvlad; 16-02-2017, 17:28.

        Comment

        Working...