[ZBX-13712] Error update LLD dependent item Created: 2018 Apr 06  Updated: 2024 Apr 10  Resolved: 2018 May 29

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F)
Affects Version/s: 3.4.8
Fix Version/s: 3.4.10rc1, 4.0.0alpha7, 4.0 (plan)

Type: Incident report Priority: Trivial
Reporter: Andrey Golodyaev Assignee: Alexander Vladishev
Resolution: Fixed Votes: 10
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File zab-err.png    
Issue Links:
Duplicate
is duplicated by ZBX-14356 Mass update failed for dependent items Closed
is duplicated by ZBX-14373 cannot add/update preprocessing regul... Closed
Team: Team B
Sprint: Sprint 34, Sprint 35
Story Points: 1

 Description   

Steps to reproduce:
Update Template LLD dependent item

Result:

Undefined index: master_itemid [disc_prototypes.php:453 ? CFrontendApiWrapper->update() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CItemPrototype->update() ? CItemPrototype->inherit() ? CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1634]

See screenshot...



 Comments   
Comment by Anth0ny [ 2018 Apr 16 ]

+1. Zabbix 3.4.8 (Centos 7.4, PHP 5.6)

Cannot update item prototype
Cannot update item prototype
Details

    Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1634]
    pg_query(): Query failed: ERROR: syntax error at end of input
    LINE 1: SELECT itemid,key_,hostid FROM items WHERE itemid=
    ^ [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
    Error in query [SELECT itemid,key_,hostid FROM items WHERE itemid=] [ERROR: syntax error at end of input
    LINE 1: SELECT itemid,key_,hostid FROM items WHERE itemid=
    ^]
    Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
    Undefined index: [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
    Error in query [SELECT itemid FROM items WHERE hostid=10727] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::update() → DBexecute() → pg_query() in include/db.inc.php:483]
    Error in query [UPDATE items SET master_itemid=NULL WHERE itemid='189526'] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    SQL statement execution has failed "UPDATE items SET master_itemid=NULL WHERE itemid='189526'". [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::update() → DB::exception() in include/classes/db/DB.php:574]
Comment by Kay Schroeder [ 2018 Apr 30 ]

+1 @3.4.8

I figured out that this happens if you have already select an Master-Item. As soon as you assign a different Item as Master-Item it works. So it looks that somewhere missing an reference to the master item if you don't assign it new.

Comment by Holger Gruber [ 2018 May 15 ]

I can confirm updating an dependent item prototype leads to an error.

Cannot update item prototype
Details
Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1634]
Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1634]
pg_query(): Query failed: ERROR: syntax error at end of input
LINE 1: SELECT itemid,key_,hostid FROM items WHERE itemid=
^ [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
Error in query [SELECT itemid,key_,hostid FROM items WHERE itemid=] [ERROR: syntax error at end of input
LINE 1: SELECT itemid,key_,hostid FROM items WHERE itemid=
^]
Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
Undefined index: [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
Error in query [SELECT itemid FROM items WHERE hostid=11529] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
Undefined index: [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
Error in query [SELECT itemid FROM items WHERE hostid=11761] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::update() → DBexecute() → pg_query() in include/db.inc.php:483]
Error in query [UPDATE items SET master_itemid=NULL WHERE itemid='1350982'] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
SQL statement execution has failed "UPDATE items SET master_itemid=NULL WHERE itemid='1350982'". [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::update() → DB::exception() in include/classes/db/DB.php:574]
Comment by Anton Alekseev [ 2018 May 16 ]

+1 @3.4.9

@palivoda, seems like these are the steps to reproduce:

  1. Create template with working discovery (e.g. vfs.fs.discovery).
  2. Link this template to any host where this discovery can work.
  3. Wait for the items to be discovered.
  4. Open template's item prototype options.
  5. Press "Update" button and receive the error.

With these steps I get the following errors:

    Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1634]
    pg_query(): Query failed: ERROR: syntax error at end of input
    LINE 1: SELECT itemid,key_,hostid FROM items WHERE itemid=
    ^ [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
    Error in query [SELECT itemid,key_,hostid FROM items WHERE itemid=] [ERROR: syntax error at end of input
    LINE 1: SELECT itemid,key_,hostid FROM items WHERE itemid=
    ^]
    Undefined index: master_itemid [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
    Undefined index: [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() in include/classes/api/services/CItemGeneral.php:1651]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::select() → DBselect() → pg_query() in include/db.inc.php:369]
    Error in query [SELECT itemid FROM items WHERE hostid=10402] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::update() → DBexecute() → pg_query() in include/db.inc.php:483]
    Error in query [UPDATE items SET master_itemid=NULL WHERE itemid='99976'] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
    SQL statement execution has failed "UPDATE items SET master_itemid=NULL WHERE itemid='99976'". [disc_prototypes.php:453 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CItemPrototype->update() → CItemPrototype->inherit() → CItemGeneral->inheritDependentItems() → DB::update() → DB::exception() in include/classes/db/DB.php:574]
Comment by Andrey Golodyaev [ 2018 May 16 ]

steps to reproduce:

  1. Create discovery template
  2. Create "master item" (type 'zabbix agent' for example)
  3. Create dependent item based on "master item"
  4. Link the template to a host
  5. Wait for the items to be discovered.
  6. Open template's item prototype options.
  7. Change a dependent item  in it (History storage period for example)
  8. Press "Update" button and receive the error.
Comment by Alexander Vladishev [ 2018 May 29 ]

(1) [AF] No translation strings changed

Miks.Kronkalns CLOSED

Comment by Alexander Vladishev [ 2018 May 29 ]

Fixed in dev branch svn://svn.zabbix.com/branches/dev/ZBX-13712

Comment by Alexander Vladishev [ 2018 May 29 ]

Fixed in:

  • 3.4.10rc1 r81346
  • 4.0.0alpha7 r81347
Generated at Tue Apr 23 16:07:41 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.