[ZBX-24657] HTTP Error 500 on Trigger Actions Menu Created: 2024 Jun 14  Updated: 2025 Mar 18  Resolved: 2024 Oct 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 7.0.0
Fix Version/s: None

Type: Problem report Priority: Major
Reporter: bonethugs test Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 12
Labels: None
Remaining Estimate: Not Specified
Time Spent: 5.5h
Original Estimate: Not Specified

Attachments: PNG File Zabbix Error (2)-1.png     PNG File Zabbix Error (2).png     PNG File Zabbix Error (3)-1.png     PNG File Zabbix Error (3).png     PNG File Zabbix Error (4)-1.png     PNG File Zabbix Error (4).png     PNG File Zabbix Error-1.png     PNG File Zabbix Error.png     File backup_process.log.gz     File configuration_backup.sql.gz     PNG File example1.png     PNG File example2.png     PNG File example3.png     PNG File image-2024-06-24-11-48-47-835.png     PNG File image-2024-06-24-11-49-10-444.png     PNG File image-2024-06-24-12-36-44-010.png     PNG File image-2024-08-29-18-31-22-451.png     PNG File image.png     PNG File screenshot-1.png    
Issue Links:
Duplicate
duplicates ZBX-23760 Disabled action can be enabled back w... Closed
duplicates ZBX-25228 Issue with Trigger actions page on Za... Closed
is duplicated by ZBX-24688 Trigger Actions HTTP Error 500 Closed
is duplicated by ZBX-24862 Frontend 500 http error at Trigger ac... Closed
is duplicated by ZBX-25185 deleting a discovery rules checks ite... Closed
is duplicated by ZBX-26190 Zabbix 7.2.0-HTTP 500 Internal Error ... Closed
Team: Team B
Sprint: S24-W38/39, S24-W40/41

 Description   

Steps to reproduce:

Going to "Alerts --> Actions --> Trigger Actions" causes HTTP Error 500 and the page never load.

I can see this kind of error in the apache logs:

PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, false given in /usr/share/zabbix/include/actions.inc.php:277\nStack trace:\n#0 /usr/share/zabbix/app/controllers/CControllerActionList.php(143): actionConditionValueToString()\n#1 /usr/share/zabbix/include/classes/mvc/CController.php(473): CControllerActionList->doAction()\n#2 /usr/share/zabbix/include/classes/core/ZBase.php(642): CController->run()\n#3 /usr/share/zabbix/include/classes/core/ZBase.php(228): ZBase->processRequest()\n#4 /usr/share/zabbix/include/config.inc.php(20): ZBase->run()\n#5 /usr/share/zabbix/zabbix.php(17): require_once('...')\n#6 {main}\n  thrown in /usr/share/zabbix/include/actions.inc.php on line 277, referer: https://mosprozab01.byl.local/zabbix/zabbix.php?action=action.list&eventsource=4

 

Result:
HTTP Error 500 after press the mentioned button

Expected:

Expected to load the trigger actions webpage



 Comments   
Comment by Michal Kudlacz [ 2024 Jun 17 ]

Unable to reproduce. Is this 7.0 LTS? Installed from fresh or upgraded from <= 6.4?

Comment by bonethugs test [ 2024 Jun 17 ]

I've upgraded from 6.0 but after upgrading I could not see any error.

The problem started after cleaning some unused templates.

I was doing some tests and I could solve this issue by removing one action via API. I think one of those trigger actions was pointing to an unexisting template (not sure why) and caused that issue.

After removing that trigger action, the HTTP Error 500 is not showing up and everything seems running fine.

Comment by Michal Kudlacz [ 2024 Jun 17 ]

Thank you for your comment.
I'm glad that removing action helped.

Closing the ZBX ticket for now. Feel free to reopen if the issue comes back.

Comment by Ruslan Aznabaev [ 2024 Jun 24 ]

mkudlacz please, reopen ticket. This is a bug.

2024/06/24 10:49:57 [error] 686316#0: *18357376 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "conditiontype" in /usr/share/zabbix/include/actions.inc.php on line 119; PHP message: PHP Warning:  Undefined array key "value" in /usr/share/zabbix/include/actions.inc.php on line 121; PHP message: PHP Warning:  Undefined array key "value" in /usr/share/zabbix/include/actions.inc.php on line 121; PHP message: PHP Warning:  Undefined array key "conditiontype" in /usr/share/zabbix/include/actions.inc.php on line 119; PHP message: PHP Warning:  Undefined array key "value" in /usr/share/zabbix/include/actions.inc.php on line 121; PHP message: PHP Warning:  Undefined array key "value" in /usr/share/zabbix/include/actions.inc.php on line 121; PHP message: PHP Warning:  Undefined array key "value" in /usr/share/zabbix/include/actions.inc.php on line 273; PHP message: PHP Warning:  Undefined array key "conditiontype" in /usr/share/zabbix/include/actions.inc.php on line 275; PHP message: PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /usr/share/zabbix/include/actions.inc.php:277Stack trace:#0 /usr/share/zabbix/app/controllers/CControllerActionList.php(143): actionConditionValueToString()#1 /usr/share/zabbix/include/classes/mvc/CController.php(473): CControllerActionList->doAction()#2 /usr/share/zabbix/include/classes/core/ZBase.php(642): CController->run()#3 /usr/share/zabbix/include/classes/core/ZBase.php(228): ZBase->processRequest()#4 /usr/share/zabbix/include/config.inc.php(20): ZBase->run()#5 /usr/share/zabbix/zabbix.php(17): require_once('...')#6 {main}  thrown in /usr/share/zabbix/include/actions.inc.php on line 277" while reading response header from upstream, client: 127.0.0.1, server: zabbix.local, request: "GET /zabbix.php?action=action.list&eventsource=0 HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix.local", referrer: "https://zabbix.local/za 

Comment by Ruslan Aznabaev [ 2024 Jun 24 ]

Steps to reproduce:
1. Create trigger action.
2. Add 2 any conditions.
3. Set formula A and B.
4. Open actions table and change numbers in formula to something else.

Comment by Harrison Glotz [ 2024 Jul 05 ]

We encountered this bug in our instance after upgrading to 7.0.0. In our case, we believe the culprit was a trigger action that excluded a specific host. After the host was deleted, the bug was triggered.

 

I found that the trigger action page could still be loaded without error if you had a filter that excluded the problem trigger. I used this to narrow down which one was causing the issue and deleted it via API. Afterwards, we haven't had any issues. 

Comment by Landon Lengyel [ 2024 Jul 15 ]

Encountered this as well on 7.0.

In our case I believe it was due to a deleted Host Group that was still being utilized by a Trigger Action. Somewhat similar to harrison.glotz situation. What I did to solve it without the API was to open our individual Trigger Actions, find the one that wouldn't load the names once it was loaded (others would), that is the one that contains the removed Host Group. Then I removed all the Host Groups and Hosts and rebuilt it. Once I did that, all other Trigger Actions appeared normally and the error went away.

Many actions in Zabbix throw alerts like "You can't delete X because it is being utilized by Y" and perhaps this is a situation where the Zabbix team should add such an alert for deleting host groups/hosts that are being used by Trigger Actions. At least in the meantime until a more user friendly solution could be implemented.

 

The error - buried amongst PHP nonsense, it does say that the issue is that /groupids/35 has a problem. I did verify with the API that there is no groupid 35 any longer:

Error text:

Undefined array key "conditiontype" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:119]
    Undefined array key "value" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:121]
    Undefined array key "value" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:121]
    Undefined array key "conditiontype" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:119]
    Undefined array key "value" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:121]
    Undefined array key "value" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:121]
    Undefined array key "conditiontype" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:119]
    Undefined array key "value" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:121]
    Undefined array key "value" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerActionList->doAction() → actionConditionValueToString() in include/actions.inc.php:121]
    Invalid parameter "/groupids/35": a number is expected.
    Undefined array key "conditiontype" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:124]
    Undefined array key "operator" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:124]
    Undefined array key "value2" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:125]
    Undefined array key "conditiontype" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:124]
    Undefined array key "operator" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:124]
    Undefined array key "value2" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:125]
    Undefined array key "conditiontype" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:124]
    Undefined array key "operator" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:124]
    Undefined array key "value2" [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() in app/views/action.list.php:125] 

What all Trigger Actions look like:

After clicking on them individually, this is a "good" Trigger Action looks like. No need to re-create this:

And this is what the "bad" Trigger Action looks like. All conditions must be recreated:

Once I re-created the conditions on the "bad" Trigger Action, everything was happy once again.

Comment by Michael P [ 2024 Aug 29 ]

Here is how i fixed it (be aware that this is ONLY FOR DEBUGGING/FIXING! you might break stuff if you don't know what you do!)

 

My error Message pointed me to "Got error 'PHP message: PHP Warning:  Undefined array key "conditiontype" in /usr/share/zabbix/include/actions.inc.php on line 119"

 

So I opened up /usr/share/zabbix/include/actions.inc.php
and inserted the folowing code in line 118 (this line is normaly empty):

{{if (!isset($condition['conditiontype'])){ 
    error_log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>".json_encode($action)); 
    continue; 
}}

After that I reloaded the page and looked in my Apache Logs again and found the following:

AH01071: Got error 'PHP message: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>{"actionid":"137","name":"NAMEOFTHEBROKENACTION","status":"1","filter":{"conditions":[
{"conditiontype":"16","operator":"11","value":"","value2":"","formulaid":"A"}
,{"conditiontype":"2","operator":"0","value":"204904","value2":"","formulaid":"B"},...

 

Now i went to the actions tab and opened up the action named "NAMEOFTHEBROKENACTION" and imediately saw:

Now i knew what I had to delete.
Afterwards everything went back to normal again and I could remove my code from the PHP file again (to not mess with anything...)

 

I hope this helps someone

Comment by seregasoft [ 2024 Oct 02 ]

Daywalker , thank you! It's worked for me! One remark: this block worked('{if' instead of doble brackets: '{{if') 

{if (!isset($condition['conditiontype'])){ 
    error_log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>".json_encode($action)); 
    continue; 
}}
Comment by Tibor Volanszki [ 2024 Oct 07 ]

Dear All,

I can confirm that the same issue happened with me after upgrading from 6.4.latest to 7.0.3, then to 7.0.4.

I am not sure which step caused the issue, but with the above workaround from seregasoft & Daywalker I was able to bypass the error and locate one single bad entry with "Unknown" error. After removing it all went back to normal.

Many thx for the professional and quick assistance from the Zabbix Community!  

Regards,
Tibor

PS: Dear Zabbix Support, the issue really exist, please take it more seriously, thank you!

Comment by Alexander Vladishev [ 2024 Oct 08 ]

This will be fixed in scope of ZBX-23760. Please follow updates there.

Generated at Thu May 29 11:49:54 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.