Ad Widget

Collapse

Incorrect value "" for unsigned int field "valuemapid".

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdowden
    Junior Member
    • Jan 2013
    • 2

    #1

    Incorrect value "" for unsigned int field "valuemapid".

    I have a shiny new install of 2.0.4 on Sqlite3. Didn't have any problems getting it up and running. I installed the agent on a separate machine and tried adding it as a host from the web client. No problem there, except that whenever I try to attach a Template (ANY template) I get the following error:

    Code:
    ERROR: Cannot update host
    Incorrect value "" for unsigned int field "valuemapid".
    My Google-fu is weak on this one and I could only find a few references, mostly out of date. I did peruse the database and only see the valuemapid column in the valuemaps table. The values of this column are sequential values 1-11 which seems reasonable.

    Any suggestions on troubleshooting this would be greatly appreciated.
  • heaje
    Senior Member
    Zabbix Certified Specialist
    • Sep 2009
    • 325

    #2
    If I remember correctly, the SQLite3 support for the Zabbix Server is experimental. Try this with another supported DB type and see if you have the same issue.

    Comment

    • mdowden
      Junior Member
      • Jan 2013
      • 2

      #3
      Interesting. I rebuilt Zabbix with PostgreSQL support and reinstalled. That error went away. I hadn't seen anywhere that Sqlite wasn't fully supported and it is actually listed explicitly in the docs on Database creation scripts.

      I had previously tried using Sqlite because my project is just a PoC and Sqlite (with PHP support) was already on the server.

      Thanks for the advice.

      Comment

      • rhqq
        Junior Member
        • Dec 2013
        • 2

        #4
        Has this been fixed or any hot-fix is available? I have Zabbix 2.2.1:

        The schema for sqlite creates table:
        sqlite> .schema valuemaps
        CREATE TABLE valuemaps (
        valuemapid bigint NOT NULL,
        name varchar(64) DEFAULT '' NOT NULL,
        PRIMARY KEY (valuemapid)
        );
        CREATE INDEX valuemaps_1 ON valuemaps (name);

        It is obvious it has to be "NOT NULL". The issue is with php files, possibly some INSERT, however I'm not savvy enough with php to look into it...

        Comment

        • rhqq
          Junior Member
          • Dec 2013
          • 2

          #5
          Any update on this

          Issue on Zabbix 2.2.1 still persists

          Comment

          • LynxChaus
            Junior Member
            • Feb 2013
            • 25

            #6
            2.4.x affected too. Small patch cures this:
            Code:
            --- a/frontends/php/include/classes/db/DB.php   2015-03-03 10:00:58.000000000 +0000
            +++ b/frontends/php/include/classes/db/DB.php   2015-03-17 21:18:18.199191362 +0000
            @@ -336,7 +336,7 @@
                                                            break;
                                                    case self::FIELD_TYPE_ID:
                                                    case self::FIELD_TYPE_UINT:
            -                                               if (!zbx_ctype_digit($values[$field])) {
            +                                               if (!zbx_ctype_digit($values[$field]) && $tableSchema['fields'][$field]['null'] !== TRUE) {
                                                                    self::exception(self::DBEXECUTE_ERROR, _s('Incorrect value "%1$s" for unsigned int field "%2$s".', $values[$field], $field));
                                                            }
                                                            $values[$field] = zbx_dbstr($values[$field]);

            Comment

            Working...