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

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 5.0.19rc1, 5.4.8rc1, 6.0.0beta1
    • API (A)
    • Sprint 82 (Nov 2021), Sprint 83 (Dec 2021), Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022), Sprint 87 (Apr 2022), Sprint 88 (May 2022), Sprint 89 (Jun 2022), Sprint 90 (Jul 2022), Sprint 91 (Aug 2022)
    • 0.5

      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.

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

              Created:
              Updated:
              Resolved: