Hello Dimitry,

thank you for the answere. For sure, you can reproduce this errors. I have done the folowing steps again and the error was happening:

1. Import the Schema and Standard in mysql.
2. Set Zabbix Server as node 1 (zabbix_server -n1)
3. Import my exported templates
4. import my exported hosts

So, now you show you ids table and find out, thats last ids for node 0 and node 1 are showing! Now you can try edit or create a item or trigger - the error message with duplicate key will show! Also you can see error message in the zabbix_server.log for the recovered entries will show!

In our policy, it is not allow use versions not supported by main stable version on debian (or other distributions). This means, wie have to use the debian package versions. I have try this on a testsystem - the error ost not happening on version 2.4.4.

I have use the high security level, because it can be lose some data!

vg

Robert

Am 15.07.2015 um 15:09 schrieb Debian Bug Tracking System:
This is an automatic notification regarding your Bug report
which was filed against the zabbix-server-mysql package:

#792260: zabbix-server-mysql: Problem in distributed monitoring mode - ids 
table get out of sync - Duplicate entry by save data

It has been closed by Dmitry Smirnov<[email protected]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Dmitry 
Smirnov<[email protected]>  by
replying to this email.


-- 792260: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792260 Debian Bug Tracking System Contact [email protected] with problems

ForwardedMessage.eml

Betreff:
Re: Bug#792260: zabbix-server-mysql: Problem in distributed monitoring mode - ids table get out of sync - Duplicate entry by save data
Von:
Dmitry Smirnov <[email protected]>
Datum:
15.07.2015 14:26

An:
[email protected]


Hi Robert,

On Monday 13 July 2015 13:49:14 you wrote:
>Severity: critical
Please do not panic and use correct severity levels:

     https://www.debian.org/Bugs/Developer#severities

I read your bug report but it is hard to understand what are you doing and
why. There are no clear instructions how to reproduce the problem, not to
mentions that fiddling directly with database is highly unusual.
In any case this problem have nothing to do with Debian packaging and since
it is clearly an upstream problem I'm closing this bug because we do not have
capacity to help you with that kind of problems here.

It is definitely worth trying Zabbix version 2.4.5 (in case this bug is
already fixed) and if not then please seek help upstream:

     https://support.zabbix.com/

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them [email protected],
and the maintainer will reopen the bug report if appropriate.

-- Best wishes, Dmitry Smirnov. --- Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick

zabbix-server-mysql: Problem in distributed monitoring mode - ids table get.eml

Betreff:
zabbix-server-mysql: Problem in distributed monitoring mode - ids table get out of sync - Duplicate entry by save data
Von:
Robert G <[email protected]>
Datum:
13.07.2015 13:49

An:
Debian Bug Tracking System <[email protected]>


Package: zabbix-server-mysql
Version: 1:2.2.7+dfsg-2
Severity: critical
Justification: causes serious data loss

Dear Maintainer,

next to my change zabbix server to node 1, I get some problems by edit or add 
new
entries in triggers, hosts or items. On save I get following error
(example on edit/add item, Error in php frontend):


<SNIP>
[INSERT INTO items 
(type,snmp_community,snmp_oid,hostid,name,description,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_contextname,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,snmpv3_privpassphrase,formula,logtimefmt,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,filter,port,inventory_link,lifetime,interfaceid,templateid,itemid)
 VALUES ('3','','','100100000010293','ICMP 
ping','','icmpping','60','7','365','0','3','','','0','0','','','0','0','','0','','1','','100100000000001','','','','0','0','','','','','0','','','0','30','100100000000153','100100000023655','100100000058464')]
 [Duplicate entry '100100000058464' for key 'PRIMARY']

SQL statement execution has failed "INSERT INTO items 
(type,snmp_community,snmp_oid,hostid,name,description,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_contextname,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,snmpv3_privpassphrase,formula,logtimefmt,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,filter,port,inventory_link,lifetime,interfaceid,templateid,itemid)
 VALUES ('3','','','100100000010293','ICMP 
ping','','icmpping','60','7','365','0','3','','','0','0','','','0','0','','0','','1','','100100000000001','','','','0','0','','','','','0','','','0','30','100100000000153','100100000023655','100100000058464')".
</SNIP>

The new or changed date are not save - this means, it will be discard.

So, I read some other forum message, that the problems its depend to the table 
ids.
Interest on this System is, that some entries also depend on node 0 - but I have
actually only the node 1.:

Code: select * from ids;
<SNIP>
+--------+----------------------+--------------------------+-----------------+
| nodeid | table_name           | field_name               | nextid          |
+--------+----------------------+--------------------------+-----------------+
|      0 | functions            | functionid               | 100100000021356 |
|      0 | graphs               | graphid                  | 100100000005068 |
|      0 | graphs_items         | gitemid                  | 100100000012510 |
|      0 | items                | itemid                   | 100100000058464 |
|      0 | items_applications   | itemappid                | 100100000041744 |
|      0 | item_discovery       | itemdiscoveryid          | 100100000029388 |
|      0 | triggers             | triggerid                | 100100000020646 |
|      1 | actions              | actionid                 | 100100000000008 |
|      1 | applications         | applicationid            | 100100000001677 |
|      1 | application_template | application_templateid   | 100100000001126 |
|      1 | auditlog             | auditid                  | 100100000006780 |
|      1 | auditlog_details     | auditdetailid            | 100100000000259 |
|      1 | conditions           | conditionid              | 100100000000014 |
|      1 | expressions          | expressionid             | 100100000000011 |
|      1 | functions            | functionid               | 100100000021356 |
|      1 | graphs               | graphid                  | 100100000005077 |
|      1 | graphs_items         | gitemid                  | 100100000012519 |
|      1 | groups               | groupid                  | 100100000000031 |
|      1 | group_prototype      | group_prototypeid        | 100100000000021 |
|      1 | hostmacro            | hostmacroid              | 100100000000175 |
|      1 | hosts                | hostid                   | 100100000010292 |
|      1 | hosts_groups         | hostgroupid              | 100100000000396 |
|      1 | hosts_templates      | hosttemplateid           | 100100000000427 |
|      1 | housekeeper          | housekeeperid            | 100100000001743 |
|      1 | images               | imageid                  | 100100000000117 |
|      1 | interface            | interfaceid              | 100100000000152 |
|      1 | items                | itemid                   | 100100000058463 |
|      1 | items_applications   | itemappid                | 100100000041755 |
|      1 | item_discovery       | itemdiscoveryid          | 100100000029387 |
|      1 | maintenances         | maintenanceid            | 100100000000002 |
|      1 | maintenances_groups  | maintenance_groupid      | 100100000000001 |
|      1 | maintenances_hosts   | maintenance_hostid       | 100100000000013 |
|      1 | maintenances_windows | maintenance_timeperiodid | 100100000000002 |
|      1 | media                | mediaid                  | 100100000000014 |
|      1 | media_type           | mediatypeid              | 100100000000002 |
|      1 | operations           | operationid              | 100100000000008 |
|      1 | opmessage_grp        | opmessage_grpid          | 100100000000005 |
|      1 | opmessage_usr        | opmessage_usrid          | 100100000000001 |
|      1 | profiles             | profileid                | 100100000000257 |
|      1 | rights               | rightid                  | 100100000000001 |
|      1 | screens              | screenid                 | 100100000000039 |
|      1 | screens_items        | screenitemid             | 100100000000182 |
|      1 | sysmaps              | sysmapid                 | 100100000000007 |
|      1 | sysmaps_elements     | selementid               | 100100000000245 |
|      1 | sysmaps_links        | linkid                   | 100100000000023 |
|      1 | timeperiods          | timeperiodid             | 100100000000002 |
|      1 | triggers             | triggerid                | 100100000020646 |
|      1 | trigger_depends      | triggerdepid             | 100100000000141 |
|      1 | users                | userid                   | 100100000000019 |
|      1 | users_groups         | id                       | 100100000000022 |
|      1 | user_history         | userhistoryid            | 100100000000001 |
|      1 | usrgrp               | usrgrpid                 | 100100000000014 |
+--------+----------------------+--------------------------+-----------------+
</SNIP>

So I delete all Node 0 entries and set correct all entries depend on node 1 to 
max of
the depend table. My PHP Script for this:

<SNIP>
#!/usr/bin/php
<?php
         $link = mysql_connect('localhost','zabbix','PASSWORD');
         mysql_select_db('zabbix', $link);

         $sql    = 'SELECT table_name, field_name, nextid FROM ids';

         $result = mysql_query($sql, $link);

         while ($row = mysql_fetch_assoc($result))
         {
                 $sql2 = "SELECT max(".$row['field_name'].") AS MAX FROM 
".$row['table_name'].";";
                 $result2 = mysql_query($sql2, $link);
                 $row2 = mysql_fetch_assoc($result2);
                 if ( $row['nextid'] != $row2['MAX'] &&  $row2['MAX'] != '' &&  
$row2['MAX'] > 0)
                 {
                         echo "Debug:".$row['table_name']." - Ist: ".$row['nextid']." Soll: 
".$row2['MAX']."\n";
                         $sql3="UPDATE ids SET nextid=".$row2['MAX']." WHERE 
table_name='".$row['table_name']."' AND nodeid =1";
                         echo "$sql3\n";
                         mysql_unbuffered_query($sql3,$link);
                 }

         }

?>
</SNIP>

But, next to some time, the error will coming back. Also a find entries with 
nodeid 0 on table ids. There error will show in manually add
entries and add by import!

Also in some cases of discovery, there error is effencted on auto creation of 
items, triggers or graphs. The erremessage in zabbix_server.log are
the same information.

Additional depended packages:
ii      zabbix-frontend-php              1:2.2.7+dfsg-2



-- System Information:
Debian Release: 8.1
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.1.2 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages zabbix-server-mysql depends on:
ii  adduser           3.113+nmu3
ii  fping             3.10-2
ii  libc6             2.19-18
ii  libcurl3-gnutls   7.38.0-4+deb8u2
ii  libiksemel3       1.4-2
ii  libldap-2.4-2     2.4.40+dfsg-1
ii  libmysqlclient18  5.5.43-0+deb8u1
ii  libodbc1          2.3.1-3
ii  libopenipmi0      2.0.16-1.4
ii  libsnmp30         5.7.2.1+dfsg-1
ii  libssh2-1         1.4.3-4.1
ii  libxml2           2.9.1+dfsg1-5
ii  lsb-base          4.1+Debian13+nmu1
ii  ucf               3.0030

Versions of packages zabbix-server-mysql recommends:
ii  mysql-server  5.5.43-0+deb8u1
ii  snmpd         5.7.2.1+dfsg-1

Versions of packages zabbix-server-mysql suggests:
ii  logrotate             3.8.7-1+b1
ii  snmp-mibs-downloader  1.1
ii  zabbix-frontend-php   1:2.2.7+dfsg-2

-- Configuration Files:
/etc/default/zabbix-server changed [not included]

-- no debconf information

Reply via email to