zabbix / zabbix-docker

Official Zabbix Dockerfiles
https://www.zabbix.com
GNU Affero General Public License v3.0
2.34k stars 1.36k forks source link

Regular Expressions - Incorrect regular expression: Passing null to parameter #2 ($subject) of type string is deprecated" #1006

Closed locrianbb7 closed 2 years ago

locrianbb7 commented 2 years ago
SUMMARY

When accessing the "Regular expressions" page at "Administration" -> "General" -> "Regular Expressions", selecting one of the pre-defined regexps like "File systems for discovery" and going to the "Test" tab it immediately shows the following error in the Result column.

Incorrect regular expression "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$": "Passing null to parameter #2 ($subject) of type string is deprecated"

image

This makes checking new regular expressions or modificated ones impossible, but it also seems to not evaluate them correctly during service discovery. For example adding another Windows service name in the "Windows service names for discovery" regexp as an additional expression for excluding from discovery doesn't seem to work.

OS / ENVIRONMENT / Used docker-compose files

Docker/Container versions:

zabbix/zabbix-server-mysql:ubuntu-6.0.7 / 6.2.1 zabbix/zabbix-web-apache-mysql:ubuntu-6.0.7 / 6.2.1

OS:

Ubuntu 20.04.4 LTS

STEPS TO REPRODUCE
Go to "Administration" -> "General" -> "Regular Expressions"
Select any Regexp entry
Select the "Test" tab
EXPECTED RESULTS

When entering a Test string it should evaluate it correctly according to the regexp, for example returning TRUE, when the regexp matches, also see the screenshot listed below (taken from an older Zabbix non-docker version 4.0.0).

image

ACTUAL RESULTS

When entering any Test string it always results into the error "Passing null to parameter #2 ($subject) of type string is deprecated", also see the screenshot listed below. After some research I figured out that this error seems to be a PHP 8.x related error, due to changes in parametrization of a certain function not accepting the "null" value anymore.

image

dotneft commented 2 years ago

Hello! Please register issue in our bug tracker: https://support.zabbix.com/

dotneft commented 2 years ago

Registered https://support.zabbix.com/browse/ZBX-21476