Ad Widget

Collapse

ERROR: Cannot add action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • getabc
    Junior Member
    • Jul 2015
    • 1

    #1

    ERROR: Cannot add action

    Hello Zabbix World!

    When I try to add a new action I get the error below. I can alter all my existing actions.

    Any idea what might be wrong?


    Code:
    Error in query [INSERT INTO opmessage (message,mediatypeid,default_msg,subject,operationid) VALUES ('Trigger: {TRIGGER.NAME}\r\nTrigger status: {TRIGGER.STATUS}\r\nTrigger severity: {TRIGGER.SEVERITY}\r\nTrigger URL: {TRIGGER.URL}\r\n\r\nItem values:\r\n\r\n1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}\r\n2. {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}\r\n3. {ITEM.NAME3} ({HOST.NAME3}:{ITEM.KEY3}): {ITEM.VALUE3}\r\n\r\nOriginal event ID: {EVENT.ID}',NULL,'1','{TRIGGER.STATUS}: {TRIGGER.NAME}','4')] [Duplicate entry '4' for key 'PRIMARY']
    SQL statement execution has failed "INSERT INTO opmessage (message,mediatypeid,default_msg,subject,operationid) VALUES ('Trigger: {TRIGGER.NAME}\r\nTrigger status: {TRIGGER.STATUS}\r\nTrigger severity: {TRIGGER.SEVERITY}\r\nTrigger URL: {TRIGGER.URL}\r\n\r\nItem values:\r\n\r\n1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}\r\n2. {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}\r\n3. {ITEM.NAME3} ({HOST.NAME3}:{ITEM.KEY3}): {ITEM.VALUE3}\r\n\r\nOriginal event ID: {EVENT.ID}',NULL,'1','{TRIGGER.STATUS}: {TRIGGER.NAME}','4')". [actionconf.php:161 → CFrontendApiWrapper->create() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->create() → CAction->addOperations() → DB::insert() → DB::exception() in /usr/share/zabbix/include/classes/db/DB.php:441]
  • Viewer
    Senior Member
    • Oct 2012
    • 131

    #2
    I have the same issue!!
    Error in query [INSERT INTO opmessage (message,mediatypeid,default_msg,subject,operationid) VALUES ('Trigger: {TRIGGER.NAME}\r\nTrigger status: {TRIGGER.STATUS}\r\nTrigger severity: {TRIGGER.SEVERITY}\r\nTrigger URL: {TRIGGER.URL}\r\n\r\nItem values:\r\n\r\n1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}\r\n2. {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}\r\n3. {ITEM.NAME3} ({HOST.NAME3}:{ITEM.KEY3}): {ITEM.VALUE3}\r\n\r\nOriginal event ID: {EVENT.ID}',NULL,'1','{TRIGGER.STATUS}: {TRIGGER.NAME}','10')]
    [Duplicate entry '10' for key 'PRIMARY']
    > select operationid from opmessage ;
    +-------------+
    | operationid |
    +-------------+
    | 4 |
    | 5 |
    | 6 |
    | 7 |
    | 8 |
    | 9 |
    | 10 |
    | 11 |
    | 12 |
    +-------------+
    > select * from ids where table_name like "opmes%";
    +---------------+-----------------+--------+
    | table_name | field_name | nextid |
    +---------------+-----------------+--------+
    | opmessage_grp | opmessage_grpid | 1 |
    | opmessage_usr | opmessage_usrid | 9 |
    +---------------+-----------------+--------+
    I understood what cause in "nextid",
    but when i modify nexid
    Code:
    > update ids set nextid=13 where table_name='opmessage_usr';
    it not resolved issue.
    Help to understand the dependence
    Last edited by Viewer; 29-10-2015, 08:16.

    Comment

    Working...