-
Problem report
-
Resolution: Unresolved
-
Major
-
None
-
6.2.4
Steps to reproduce:
- Create a Template with a Host Discovery
- Ensure a Group prototype is defined
- Save
- Let it discover the host and create the group
- Modify the name
Result:
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)=(2624) is still referenced from table "group_discovery". [host_prototypes.php:289 → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHostPrototype->update() → CHostPrototype->updateForce() → CHostPrototype::updateGroupPrototypes() → DB::delete() → DBexecute() → pg_query() in include/db.inc.php:373] Error in query [DELETE FROM group_prototype WHERE group_prototypeid='2596'] [ERROR: update or delete on table "group_prototype" violates foreign key constraint "c_group_discovery_2" on table "group_discovery" DETAIL: Key (group_prototypeid)=(2624) is still referenced from table "group_discovery".] SQL statement execution has failed "DELETE FROM group_prototype WHERE group_prototypeid='2596'"
I assume this happens because the discovery has been executed, created groups and hosts and these are still tied together.
I have also tried adding a second Group Prototype, save and delete the old one afterwards but the result is the same.
Expected:
No error, changes applied.