[ZBX-22729] PHP Warning 'Undefined array key' error appears if passed non-existent dcheckid Created: 2023 Apr 25  Updated: 2024 Apr 10  Resolved: 2023 Apr 26

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 5.0.34, 6.0.17, 6.4.2rc2, 7.0.0alpha1
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Kirils Seve Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 0
Labels: api, phpwarning
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screenshot-1.png    
Issue Links:
Sub-task
part of ZBXNEXT-8351 Implement audit for frontend (Discove... Ready for QA
Team: Team B

 Description   

Steps to reproduce:

  • Create drule with dcheck e.g. :
    -) FTP port 21
  • Update drule FTP check via API request using dcheckid param with non-existent id:
{
    "jsonrpc": "2.0",
    "method": "drule.update",
    "params": {
        "druleid": "3",        
         "dchecks": [
         	{
                 "dcheckid": "{NON_EXISTENT_ID}",
            	 "type": "3",
                 "ports": "21"
                }
        ]
    },
    "id": 1
}
  • Check apache2 error.log

Result: An error appears in apache2 error.log:

 [Tue Apr 25 13:36:59.256219 2023] [php:warn] PHP Warning:  Undefined array key 777 in /home/zabbix/workspace/master/ui/include/classes/db/DB.php on line 787

and no validation error in API:

Expected: No php warning should appear. The validation error should appear on API.



 Comments   
Comment by Alexander Vladishev [ 2023 Apr 26 ]

Will be fixed in scope of ZBXNEXT-8351.

Generated at Wed May 21 06:37:51 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.