Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-6918

Importing just exported host fails with errors

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 2.0.7
    • Frontend (F)
    • OpenSUSE 12.3 with Zabbix & PostgreSQL 9.2 backend; installed via official openSUSE repositories

      Exporting a host to xml works fine from web UI via Configuration -> Hosts -> (select host) -> Exported Selected dropdown. Everything in the exported XML looks correct (see attached).
      The resulting XML file cannot be imported back into the same Zabbix instance (says "Imported successfully" but details contains errors, and the host is not actually imported, does not show in web UI or in hosts table in database). Changing only the name & interface IP address in the file and attempted to import as a new host only also fails with identical errors (see attached screenshot).
      I've tried removing various sections and also tried export/import of the simplest configuration I could generate (host with 1 group and no other data attached).
      It seems as if the hostid value is not being correctly set to the next available index prior to new host insertion, and remains as the empty string rather than current max hostid + 1.

      Errors are:
      Undefined offset: 0 [include/db.inc.php:1119]
      pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: Invalid input syntax for integer: ""
      LINE 1: ... hi.*,hi.hostid FRM interface hi WHERE hi.hostid='' AND hi....
      ^ [include/db.inc.php:440]
      Error in query [SELECT hi.*,hi.hostid FROM interface hi WHERE hi.hostid='' AND hi.hostid BETWEEN 000000000000000 AND 099999999999999] [ERROR: invalid input syntax for integer: ""
      LINE 1: ... hi.*,hi.hostid FROM interface hi WHERE hi.hostid='' AND hi....
      ^]
      pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:577]
      pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:578]

        1. error.png
          200 kB
          Don Conry
        2. zbx_export_hosts1.xml
          1 kB
          Don Conry

            Unassigned Unassigned
            dconry Don Conry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: