[ZBX-25284] Not possible to delete inherited host prototype from host if a web scenario was added after discovery of a host by this prototype Created: 2024 Sep 24 Updated: 2025 Apr 22 |
|
Status: | Resolved |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A), Frontend (F) |
Affects Version/s: | 6.4.20rc1, 7.0.5rc1, 7.2.0alpha1 |
Fix Version/s: | 7.0.13rc1, 7.2.7rc1, 7.4.0rc1 (master) |
Type: | Problem report | Priority: | Trivial |
Reporter: | Sergejs Olonkins | Assignee: | Vladimirs Maksimovs |
Resolution: | Unresolved | Votes: | 0 |
Labels: | delete, host.prototypes, inheritance | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | 8h | ||
Original Estimate: | Not Specified |
Attachments: |
![]() |
||||||||
Issue Links: |
|
||||||||
Team: | |||||||||
Sprint: | Prev.Sprint, S24-W40/41, S24-W42/43, S24-W46/47, S24-W48/49, S24-W50/51/52/1, S25-W2/3 | ||||||||
Story Points: | 2 |
Description |
Problem description: Imagine that there's a template has a host prototype that should link the discovered hosts to the same template. This template is linked to a host "test", a host is discovered by this prototype. Afterwards, a Web scenario is added to this template, and, therefore it appears on the discovered host and on the "test" host, and then the template is unlinked from host "test". After these actions it will not be possible to delete this host prototype from host "test" due to the following error: pg_query(): Query failed: ERROR: update or delete on table "hosts" violates foreign key constraint "c_httptest_2" on table "httptest" DETAIL: Key (hostid)=(10643) is still referenced from table "httptest". [host_prototypes.php:325 → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHostPrototype->delete() → CHostPrototype::deleteForce() → DB::delete() → DBexecute() → pg_query() → CConfigFile->{closure}() in conf/zabbix.conf.php:87] Error in query [DELETE FROM hosts WHERE hostid='10643'] [ERROR: update or delete on table "hosts" violates foreign key constraint "c_httptest_2" on table "httptest" DETAIL: Key (hostid)=(10643) is still referenced from table "httptest".] SQL statement execution has failed "DELETE FROM hosts WHERE hostid='10643'" Steps to reproduce:
Result: host prototype cannot be deleted due to the above mentioned error. |
Comments |
Comment by Janis Freibergs [ 2024 Oct 11 ] |
Fixed in development branch feature/ZBX-25284-7.0 |