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.
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....
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]