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

Errors are observed when attempting to link certain templates to host

    XMLWordPrintable

Details

    • Team A
    • Sprint 82 (Nov 2021), Sprint 83 (Dec 2021)
    • 0.5

    Description

      Problem description: The below "Undefined offset: 0" and "Trying to access array offset on value of type null" errors are observed when attempting to link "APC UPS SNMP" and "macOS" templates:

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

      Steps to reproduce:

      1. Navigate to Configuration => Hosts and click on the "Create host" button
      2. In the opened host configuration form populate the "Host name" and "Groups" fields and add Agent and SNMP interfaces.
      3. In field "Templates" select the "Undefined offset: 0" and "Trying to access array offset on value of type null" templates
      4. Attempt to save host configuration

      Result: the above errors are observed.
      Expected: no "Undefined offset" or "Trying to access array offset on value of type null" errors should not be observed.

      Attachments

        Activity

          People

            zabbix.dev Zabbix Development Team
            solonkins Sergejs Olonkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: