Description of the problem and how to reproduce.
I reproduced the steps and encountered the same error:
The page being monitored (for which this error occurs) is encoded with the character set ISO-8859-1 and also includes that character set’s non-breaking space character (hex a0) as a literal (i.e. not via a HTML entity).
I’ve attached a tar.gz archive containing a simple HTML file (example.html) which is encoded with the character set ISO-8859-1 and which contains, between <p> and </p> elements (within its <body>) the character set’s non-breaking space character (hex a0).
When the the web server is ready, following the below steps in Zabbix 6.0(.4) to reproduce the issue:
- In Configuration > Hosts, select Web scenarios for a host of your choice
- Click Create web scenario
- On the Scenario tab, set Name to Example
- In the Steps of web scenario , set Required string to Page title
- In the Steps of web scenario , set Required status codes to 200
- In the Steps of web scenario , click Add
- Click Add (the 'main' Add button)
- View Monitoring > Latest data for the same host and await execution of the web scenario after which Failed step of scenario "Example" should have value 1 and Last error message of scenario "Example" should have value
- Also review the zabbix_server log file which should have message(s) ending regexp_exec() failed with error -22
I’ve also tried increasing the verbosity of http poller logs by running this command several times:
After that’s been done, I’ve reviewed log messages from executions of the web scenario. The regexp_exec() failed with error -22 messages are display shortly after logging of the retrieved page data. I’ve noticed the logged page data (page.data) omits the line which contains the ISO-8859-1 character set's non-breaking space character (hex a0). See the below from the zabbix_server log file (for comparison with example.html from the tar.gz archive):
This behaviour is a regression from previous Zabbix releases, including 5.4(.11). Indeed if the same web scenario detailed above is setup with Zabbix 5.4(.11) the issue does not occur (i.e. the web scenario completes successfully). We have several crucial internal websites which are monitored with Zabbix web scenarios that are affected by the issue and therefore we cannot upgrade to Zabbix 6.0.x until this is fixed.