[ZBX-20713] Import vmware template 6.0.1 Created: 2022 Mar 05  Updated: 2023 Oct 16  Resolved: 2023 Oct 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 6.0.1
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: tuor Assignee: Edgars Melveris
Resolution: Incomplete Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,

 

  1. I update from 5.4 to 6.0
  2. I imported the current vmware template.

I got this error (the only template with this error):

 * pg_query(): Query failed: ERROR: update or delete on table "group_prototype" violates foreign key constraint "c_group_discovery_2" on table "group_discovery"
 * DETAIL: Key (group_prototypeid)=(215) is still referenced from table "group_discovery". [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CHostPrototype->update() → CHostPrototype->updateForce() → CHostPrototype::updateGroupPrototypes() → DB::delete() → DBexecute() → pg_query() in include/db.inc.php:349]
 * Error in query [DELETE FROM group_prototype WHERE (group_prototypeid IN ('209','211'))] [ERROR: update or delete on table "group_prototype" violates foreign key constraint "c_group_discovery_2" on table "group_discovery"
 * DETAIL: Key (group_prototypeid)=(215) is still referenced from table "group_discovery".]
 * SQL statement execution has failed "DELETE FROM group_prototype WHERE (group_prototypeid IN ('209','211'))"

Kind regards

Tuor



 Comments   
Comment by Alexey Pustovalov [ 2022 Mar 05 ]

Where from you downloaded the template?

Comment by tuor [ 2022 Mar 05 ]

https://github.com/zabbix/zabbix/tree/release/6.0/templates/app/vmware

Comment by Edgars Melveris [ 2022 Mar 07 ]

Have you made any manual modifications to the DB? Can you show all options you've selected before import and also the screenshot of the changes window?

Comment by tuor [ 2022 Mar 08 ]

In general no, I didn't modify the DB. There was some manual work for the update (TimescaleDB).

Ssomeone did modify the template in our Zabbix Instance. Maybe that is why it can not be imported. I'll have to study the diff in more detail.

Comment by tuor [ 2022 Apr 14 ]

This was due to changes to the template we did in version 5.4. We had to remove the assignment of this template from all hosts, then it worked. It was, because we did modify the group prototypes. The import would have modified the groups and this was not possible. Changing the groups after assigning isn't possible to. If I have to change the group prototypes, I have to remove the assignment from all hosts, modify the template and reassign it again.

Generated at Thu Jun 04 19:36:40 EEST 2026 using Jira 10.3.18#10030018-sha1:5642e4ad348b6c2a83ebdba689d04763a2393cab.