[ZBX-16072] Unable to update trigger of a certain template Created: 2019 May 02  Updated: 2024 Apr 10  Resolved: 2019 Sep 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 4.2.1
Fix Version/s: 4.0.12rc1, 4.2.6rc1, 4.4.0alpha2, 4.4 (plan)

Type: Problem report Priority: Blocker
Reporter: Robin Roevens Assignee: Ivo Kurzemnieks
Resolution: Fixed Votes: 2
Labels: crash, frontend, mysql, templates, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle Linux Server 7.6


Attachments: XML File Template_App_IBM_Spectrum_Protect_Client.xml    
Team: Team B
Sprint: Sprint 55 (Aug 2019), Sprint 52 (May 2019), Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
Story Points: 1

 Description   

Steps to reproduce:

Not sure if this reproducable without my data, but this is what I do to reproduce it:

  1. Edit template (which I created in v3.x, adapted to dependent items in 4.0)
  2. Open triggers-tab
  3. Edit trigger checking for nodata on master-item
  4. Change master-item into one of the dependent items (as master-item has history set to 0 so nodata triggers always..)
  5. Click on Apply

Result:

Empty webpage

error in Apache errorlogging:

PHP Fatal error: Uncaught TypeError: Argument 2 passed to dbConditionString() must be of the type array, null given, called in /usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php on line 1293 and defined in /usr/share/zabbix/include/db.inc.php:911\nStack trace:\n#0 /usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php(1293): dbConditionString('i.key_', NULL)\n#1 /usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php(1012): CTriggerGeneral->implode_expressions(Array, Array, Array, true)\n#2 /usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php(198): CTriggerGeneral->updateReal(Array, Array, true)\n#3 /usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php(76): CTriggerGeneral->inheritOnHost(Array, Array)\n#4 /usr/share/zabbix/include/classes/api/services/CTrigger.php(589): CTriggerGeneral->inherit(Array)\n#5 /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php(123): CTrigger->update(Array)\n#6 /usr/share/zabbix/include/classes/api/wrappers/CFrontendApiWrapper in /usr/share/zabbix/include/db.inc.php on line 911, referer: http://zabbixtstfe.uantwerpen.be/triggers.php?form=update&triggerid=18463

Expected:
Trigger being updated in template and on all hosts that have that template applied to.



 Comments   
Comment by Kaspars Mednis [ 2019 May 03 ]

Hello Robin,

can you explain how you did the 2nd and 3rd step ?

  1. Edit trigger checking for nodata on master-item
  2. Change master-item into one of the dependent items (as master-item has history set to 0 so nodata triggers always..)

I created trigger on master item, and then changed the key on that trigger to dependent item, and Zabbix successfully updated the trigger.

Have you used manual edit, expression constructor or other method ?

Comment by Robin Roevens [ 2019 May 06 ]

To be specific. Currently the trigger is defined as following:

{Template App IBM Spectrum Protect Client:tsm.node.backup.stats.nodata({$SPECTRUM_PROTECT_CLIENT_STATS_TIMEOUT})}=1

however tsm.node.backup.stats is now a master item with history storage period set to 0. (This was recently changed, after I learned the trick to set this to 0 to prevent the master item data from being saved to the database)

So now I want to change the trigger to check on one of the dependent items as the .nodata trigger function does not work on items with history storage set to 0. I change it manually (not using the expression editor) into:

{Template App IBM Spectrum Protect Client:tsm.node.backup.backup_successful.nodata({$SPECTRUM_PROTECT_CLIENT_STATS_TIMEOUT})}=1

where the item tsm.node.backup.backup_successful is a dependent item on tsm.node.backup.stats.

Then I press Update to save this change, and I get a blank frontend screen (zabbix logo and menu's are displayed, but in the main section of the screen, nothing is displayed) and I get the error as described above in the Apache log.

This specific template has a history of containing all the now dependent items as zabbix trapper items, but since v4 I changed this into one master zabbix trapper item and the other items as dependent items. At first the master item did have a history storage period > 0, but as said before, was changed to 0. Now I discovered the .nodata function to be not functional anymore on that item. Hence the change I now try to accomplish.

I don't know how you can reproduce this problem as I tried that myself by creating a similar template with a master item, a few dependent items and a trigger using the .nodata function on the master item. Then changing that trigger to point to one of the dependent items, and this just works. So I assume there is something 'wrong' with this Template App IBM Spectrum Protect template, causing this behavior, however, I don't see what might be the problem..

I don't know if it matters but, the template is currently connected to a bunch of hosts and a few of those hosts are disabled.

Comment by De Beuckelaer Donovan [ 2019 Jun 14 ]

Same problem here, rhel 7.6 nginx php7 zabbix 4.0

Downgrading php was the solution for me,

I setup a second zabbix-web environment :works without problems on rhel7.6 nginx php 5.4 zabbix 4.0

Comment by Ivo Kurzemnieks [ 2019 Aug 13 ]

RESOLVED in feature/ZBX-16072-4.0

Comment by Ivo Kurzemnieks [ 2019 Aug 16 ]

Fixed in:

Comment by Ivo Kurzemnieks [ 2019 Aug 29 ]

Documentation updated:

Generated at Thu Apr 25 20:11:16 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.