Ad Widget

Collapse

проблема с синхронизацией шаблона

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vanishox
    Member
    • Mar 2011
    • 47

    #1

    проблема с синхронизацией шаблона

    День добрый, помогите пожалуйста.
    Возникла проблема, при попытке добавить новый узел сети и привязать к нему шаблон, получаю трэйс ошибки:
    HTML Code:
    pg_query(): Query failed: ERROR: duplicate key value violates unique constraint "auditlog_pkey" DETAIL: Key (auditid)=(209510) already exists. [include/db.inc.php:546]
    Error in query [INSERT INTO auditlog (auditid,userid,clock,ip,action,resourcetype,resourceid,resourcename) values (209510,5,1333345013,'192.168.168.184',0,13,42276,'172.20.0.9:Zyxel-3012_UNAVAILABLE')] [ERROR: duplicate key value violates unique constraint "auditlog_pkey" DETAIL: Key (auditid)=(209510) already exists.]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:444]
    Error in query [SELECT h.* FROM hosts h, hosts_templates ht WHERE h.hostid=ht.hostid AND (ht.templateid IN (12770)) ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:619]
    pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:621]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:444]
    Error in query [select * from triggers where triggerid=32901] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:619]
    pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:621]
    Нет триггера с triggerid=[32901]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:444]
    Error in query [SELECT t2.triggerid, t2.expression FROM triggers t2, functions f1, functions f2, items i1, items i2 WHERE f1.triggerid=32901 AND i1.itemid=f1.itemid AND f2.function=f1.function AND f2.parameter=f1.parameter AND i2.itemid=f2.itemid AND i2.key_=i1.key_ AND i2.hostid=12770 AND t2.triggerid=f2.triggerid AND t2.description='' AND t2.templateid=0 ] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:619]
    pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:621]
    pg_query(): Query failed: ERROR: syntax error at or near "," LINE 1: ...nts,url,value,expression,templateid) VALUES (0,'',,,,'','',2... ^ [include/db.inc.php:546]
    Error in query [INSERT INTO triggers (triggerid,description,type,priority,status,comments,url,value,expression,templateid) VALUES (0,'',,,,'','',2,'0',32901)] [ERROR: syntax error at or near "," LINE 1: ...nts,url,value,expression,templateid) VALUES (0,'',,,,'','',2... ^]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:444]
    Error in query [SELECT DISTINCT t.triggerid,t.templateid FROM triggers t,functions f,items i WHERE t.triggerid=f.triggerid AND f.itemid=i.itemid AND i.hostid=12770 AND EXISTS (SELECT 1 FROM triggers tt,functions ff,items ii WHERE tt.triggerid=ff.triggerid AND ff.itemid=ii.itemid AND ii.hostid=12361 AND tt.triggerid=t.templateid)] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:619]
    pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:621]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:444]
    Error in query [SELECT DISTINCT td.triggerid_down,td.triggerid_up FROM items i,functions f,triggers t,trigger_depends td WHERE i.itemid=f.itemid AND f.triggerid=t.triggerid AND t.templateid IN (td.triggerid_up,td.triggerid_down) AND i.hostid=12770] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:619]
    pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:621]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:444]
    Error in query [SELECT h.hostid FROM hosts h WHERE (h.hostid IN (12770)) AND ((h.hostid BETWEEN 000000000000000 AND 099999999999999)) AND h.status IN (0,1,3)] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:619]
    pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:621]
    У вас нет полномочий для выполнения этой операции
    Не удалось синхронизировать шаблон
    В чем может быть проблема и с какой стороны смотреть на этот трэйс?
    - Захожу под супер-администратором - проверил все - разрешения все есть.
    - Проверил в базе, в таблице auditlog строки со значением "auditid" = 209510 нет.
  • vanishox
    Member
    • Mar 2011
    • 47

    #2
    Developers ау-у-у...
    Насколько я понял - проблема заключается в том, что при попытке вставить в таблицу auditlog какую-либо строку, мы пытаемся вставить auditid = 209510, а так как auditid является уникальным первичным ключом, который автоинкрементируется, то происходит конфликт (это может возникать из-за того, что данные удалялись дописывались вручную).
    Только непонятно - где хранится текущее значение auditid, так как в таблице auditlog последняя запись с auditid=209501.
    Нашел ссылку:



    Только там решения приводятся для последовательностей, а у себя я такой не обнаруживаю в базе.
    Может кто-нибудь сможет подсказать что с этим делать???

    Comment

    • dotneft
      Senior Member
      • Nov 2008
      • 699

      #3
      Должно помочь

      Code:
      DELETE FROM ids WHERE table_name = 'auditlog';
      + если веб-интерфейс старый (последний 1.8.11), то можете его обновить.

      Comment

      • vanishox
        Member
        • Mar 2011
        • 47

        #4
        dotneft - спасибо бооольшое. То что надо.

        Comment

        Working...