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"
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.
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).
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.
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"
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
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).
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.