Array to string conversion in [...]/wp-content/plugins/wp-fail2ban/lib/loader.php

As per title, the plugin filles up the error_log of the webserver with the following message:

PHP message: PHP Warning:  Array to string conversion in [...]/wp-content/plugins/wp-fail2ban/lib/loader.php

This is with PHP-FPM 8.0.16 and Wordpress 5.9.1, with WP-Fail2Ban 4.4.0.3.

Thanks for the report.

Could you submit the rest of the error message please?

Which “rest” are you referring to?

There should be a line number at the end of the message, e.g:

PHP Warning: end of world in /wp-content/apocalypse.php on line 666

Oh, I’m sorry, I thought I did and I was confused as to why you’re asking for a full error message :slight_smile:

2022/02/28 15:33:08 [error] 30765#0: *72204591 FastCGI sent in stderr: "PHP message: PHP Warning:  Array to string conversion in [...]/www/wp-content/plugins/wp-fail2ban/lib/loader.php on line 597" while reading response header from upstream, client: 185.53.XXX.XXX, server: [...], request: "GET / HTTP/3", upstream: "fastcgi://unix:/var/run/php/[...]:", host: "[...]"

OK, that’s what I needed.

Could you post a list of your WP_FAIL2BAN_xxx defines please?

One of those is an array that’s expected to be a string, but without knowing what you’ve defined I don’t know if it’s a bug or just that the define should be a string instead.

define('WP_FAIL2BAN_BLOCKED_USERS', ['admin', 'user', 'guest_author']);
define('WP_FAIL2BAN_LOG_SPAM', false);
define('WP_FAIL2BAN_BLOCK_USER_ENUMERATION', true);
define('WP_FAIL2BAN_DISABLE_LAST_LOG', true);
define('WP_FAIL2BAN_FREE_ONLY', true);

Thanks for that - it is indeed a bug.

4.4.0.4 will be released later today with a fix.