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

Unexpected errors are observed when linking items from 2 templates that populate same inventory field to a host

XMLWordPrintable

    • Sprint 90 (Jul 2022), Sprint 91 (Aug 2022), Sprint 92 (Sep 2022)
    • 0.5

      Problem description: If two templates, both of which have an item that populates the same inventory field, are linked to a host, then apart from an expected human readable error message, two additional errors are observed:

      Undefined offset: 0 [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->update() → CHost->massUpdate() → CHost->massAdd() → CHostGeneral->massAdd() → CHostGeneral->link() → CItem->syncTemplates() → CItemGeneral->inherit() → CItemGeneral->_inherit() → CItem::validateInventoryLinks() in include/classes/api/services/CItem.php:1016]
      Trying to access array offset on value of type null [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->update() → CHost->massUpdate() → CHost->massAdd() → CHostGeneral->massAdd() → CHostGeneral->link() → CItem->syncTemplates() → CItemGeneral->inherit() → CItemGeneral->_inherit() → CItem::validateInventoryLinks() in include/classes/api/services/CItem.php:1016]
      Two items ("Host name" and "") cannot populate one host inventory field "Name", this would lead to a conflict.
      

      Steps to reproduce:

      1. Create a host
      2. Create two templates - each template should have an item that populates inventory field "Name"
      3. Open its configuration and link the following templates:
      4. Link both created templates to this host
      5. Attempt to save host configuration

      Result: the above three error messages are observed
      Expected: only the following error message should be observed:

      Two items ("Host name" and "") cannot populate one host inventory field "Name", this would lead to a conflict.
      

            iivs Ivo Kurzemnieks
            solonkins Sergejs Olonkins
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: