[ZBX-6918] Importing just exported host fails with errors Created: 2013 Aug 22  Updated: 2017 May 30  Resolved: 2013 Aug 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.7
Fix Version/s: None

Type: Incident report Priority: Critical
Reporter: Don Conry Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: import, postgresql
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OpenSUSE 12.3 with Zabbix & PostgreSQL 9.2 backend; installed via official openSUSE repositories


Attachments: PNG File error.png     XML File zbx_export_hosts1.xml    
Issue Links:
Duplicate
duplicates ZBX-6922 It's not possible to import the host. Closed

 Description   

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]



 Comments   
Comment by Don Conry [ 2013 Aug 22 ]

Just an add'tl note, have also tried various combinations of checking the boxes on the import screen, from the simplest (only import new host) to most complex (new & modified hosts, groups, templates, items, etc). The given example above was set with an already existing group & template.

Comment by Pavels Jelisejevs (Inactive) [ 2013 Aug 23 ]

This could be the same problem as ZBX-6922.

Eduards Yes, fix in ZBX-6922 must help!

Comment by Alexander Vladishev [ 2013 Aug 27 ]

It's a duplicate of ZBX-6922. I'm closing the issue.

Generated at Fri Apr 26 21:43:08 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.