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

Cannot update host prototype

XMLWordPrintable

      Steps to reproduce:

      1. Create a Template with a Host Discovery
      2. Ensure a Group prototype is defined
      3. Save
      4. Let it discover the host and create the group
      5. 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.

            zabbix.dev Zabbix Development Team
            frank Frank
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: