I have exactly the same stack trace as this poster back in July with v5.1.1: Site Heath crashes with Fail2ban
I’ve tried troubleshooting it but I guess that’s never going to help since it seems the error is to do with PHP versions? I’d prefer not to dive into the code to disable lines. Strange that it seems not very many people are being affected.
Here are the details from the troubleshooting email:
WordPress version 6.4.1
Active theme: Twenty Twenty-One (version 2.0)
Current plugin: WP fail2ban (version 5.2.1)
PHP version 8.1.26
Error Details
=============
An error of type E_ERROR was caused in line 470 of the file /home/carbonc/sites/wordpress/wp-content/plugins/wp-fail2ban/lib/site-health.php. Error message: Uncaught Error: Call to undefined function org\lecklider\charles\wordpress\wp_fail2ban\exec() in /home/carbonc/sites/wordpress/wp-content/plugins/wp-fail2ban/lib/site-health.php:470
Stack trace:
#0 /home/carbonc/sites/wordpress/wp-admin/includes/class-wp-site-health.php(194): org\lecklider\charles\wordpress\wp_fail2ban\SiteHealth->get_test_fail2ban_running()
#1 /home/carbonc/sites/wordpress/wp-admin/includes/class-wp-site-health.php(145): WP_Site_Health->perform_test()
#2 /home/carbonc/sites/wordpress/wp-includes/class-wp-hook.php(324): WP_Site_Health->enqueue_scripts()
#3 /home/carbonc/sites/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#4 /home/carbonc/sites/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
#5 /home/carbonc/sites/wordpress/wp-admin/admin-header.php(118): do_action()
#6 /home/carbonc/sites/wordpress/wp-admin/site-health.php(96): require_once(‘…’)
#7 {main}
thrown