Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • Professional Edition
    • None
    • I updated yesterday to the newest version of the professional edition (Yesterday means 6 Oct)

    Description

      The db.log file is filling up with the following error message:

      [2015/10/07 17:08:23 +0000] syslog.php(42723): Failed dbQuery (#1062 - Duplicate entry '0' for key 'PRIMARY'), Query: INSERT INTO `syslog` (`device_id`,`program`,`facility`,`priority`,`level`,`tag`,`msg`,`timestamp`) VALUES .....

      At the same time the debug.log is filling up with the corresponding information.

      It could be that the problem has something to do with the switch to:
      $config['db_extension'] = 'mysqli';

      This creates about 50GB of log files per day. It would be great if this is resolved fast.

      Attachments

        Activity

          [OBS-1488] Problem with DB query in syslog

          perhaps, it is somehow associated with that maria db is used.. I will check this later.
          but this table (and auto increment) created at initial schema install.

          landy Mike Stupalov added a comment - perhaps, it is somehow associated with that maria db is used.. I will check this later. but this table (and auto increment) created at initial schema install.

          This solved the problem. You can close the issue.

          Do you know why this could happen?

          modir Raffael Luthiger added a comment - This solved the problem. You can close the issue. Do you know why this could happen?

          Yes, seq should be auto increment and in correct install it is:

          mysql> SHOW COLUMNS FROM `syslog`;
          +-----------+---------------------+------+-----+-------------------+----------------+
          | Field     | Type                | Null | Key | Default           | Extra          |
          +-----------+---------------------+------+-----+-------------------+----------------+
          | device_id | int(11)             | YES  | MUL | NULL              |                |
          | facility  | varchar(10)         | YES  |     | NULL              |                |
          | priority  | tinyint(4)          | NO   | MUL | 8                 |                |
          | level     | tinyint(4)          | NO   |     | 8                 |                |
          | tag       | varchar(10)         | YES  |     | NULL              |                |
          | timestamp | timestamp           | NO   | MUL | CURRENT_TIMESTAMP |                |
          | program   | varchar(32)         | YES  | MUL | NULL              |                |
          | msg       | text                | YES  |     | NULL              |                |
          | seq       | bigint(20) unsigned | NO   | PRI | NULL              | auto_increment |
          +-----------+---------------------+------+-----+-------------------+----------------+
          

          run from mysql console:

          ALTER TABLE `syslog` CHANGE `seq` `seq` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
          

          landy Mike Stupalov added a comment - Yes, seq should be auto increment and in correct install it is: mysql> SHOW COLUMNS FROM `syslog`; +-----------+---------------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+---------------------+------+-----+-------------------+----------------+ | device_id | int(11) | YES | MUL | NULL | | | facility | varchar(10) | YES | | NULL | | | priority | tinyint(4) | NO | MUL | 8 | | | level | tinyint(4) | NO | | 8 | | | tag | varchar(10) | YES | | NULL | | | timestamp | timestamp | NO | MUL | CURRENT_TIMESTAMP | | | program | varchar(32) | YES | MUL | NULL | | | msg | text | YES | | NULL | | | seq | bigint(20) unsigned | NO | PRI | NULL | auto_increment | +-----------+---------------------+------+-----+-------------------+----------------+ run from mysql console: ALTER TABLE `syslog` CHANGE `seq` `seq` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
          modir Raffael Luthiger added a comment - - edited

          The output is this:

          MariaDB [observium]> SHOW COLUMNS FROM `syslog`;
          +-----------+---------------------+------+-----+-------------------+-------+
          | Field     | Type                | Null | Key | Default           | Extra |
          +-----------+---------------------+------+-----+-------------------+-------+
          | device_id | int(11)             | YES  | MUL | NULL              |       |
          | facility  | varchar(10)         | YES  |     | NULL              |       |
          | priority  | tinyint(4)          | NO   | MUL | 8                 |       |
          | level     | tinyint(4)          | NO   |     | 8                 |       |
          | tag       | varchar(10)         | YES  |     | NULL              |       |
          | timestamp | timestamp           | NO   | MUL | CURRENT_TIMESTAMP |       |
          | program   | varchar(32)         | YES  | MUL | NULL              |       |
          | msg       | text                | YES  |     | NULL              |       |
          | seq       | bigint(20) unsigned | NO   | PRI | NULL              |       |
          +-----------+---------------------+------+-----+-------------------+-------+
          

          As you can see the "seq" is the primary key. From my query you can see that "seq" is not part of the values written into the table.

          From my point of view the "seq" should have an auto increment set.

          Could it be that one of the last updates changed the column type of "seq" from int to bigint and the ALTER TABLE forgot to set the "auto increment" or something similar?

          modir Raffael Luthiger added a comment - - edited The output is this: MariaDB [observium]> SHOW COLUMNS FROM `syslog`; +-----------+---------------------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+---------------------+------+-----+-------------------+-------+ | device_id | int(11) | YES | MUL | NULL | | | facility | varchar(10) | YES | | NULL | | | priority | tinyint(4) | NO | MUL | 8 | | | level | tinyint(4) | NO | | 8 | | | tag | varchar(10) | YES | | NULL | | | timestamp | timestamp | NO | MUL | CURRENT_TIMESTAMP | | | program | varchar(32) | YES | MUL | NULL | | | msg | text | YES | | NULL | | | seq | bigint(20) unsigned | NO | PRI | NULL | | +-----------+---------------------+------+-----+-------------------+-------+ As you can see the "seq" is the primary key. From my query you can see that "seq" is not part of the values written into the table. From my point of view the "seq" should have an auto increment set. Could it be that one of the last updates changed the column type of "seq" from int to bigint and the ALTER TABLE forgot to set the "auto increment" or something similar?

          And if possible, from mysql console:

          SHOW COLUMNS FROM `syslog`;
          

          landy Mike Stupalov added a comment - And if possible, from mysql console: SHOW COLUMNS FROM `syslog`;

          Please write FULL problematic query here (with values).

          landy Mike Stupalov added a comment - Please write FULL problematic query here (with values).

          People

            landy Mike Stupalov
            modir Raffael Luthiger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: