• Resolved susanwrotethis

    (@susanwrotethis)


    I’m running Wordfence 7.5.9 on WordPress 5.9.3. I check the PHP error log fairly regularly, and today I noticed an unusual number of errors related to Wordfence.

    All of them are essentially the same (the actual path/domain name replaced with “redacted”):

    PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /nas/content/live/redacted/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/mysql.php:144\nStack trace:\n#0 
    
    /nas/content/live/redacted/wp-content/plugins/wordfence/lib/wordfenceClass.php(8661): wfWAFStorageMySQL->getNewestAttackDataArray(1649382099.01)\n#1 
    
    /nas/content/live/redacted/wp-includes/class-wp-hook.php(305): wordfence::syncAttackData()\n#2
    
    /nas/content/live/redacted/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)\n#3 
    
    /nas/content/live/redacted/wp-includes/plugin.php(474): WP_Hook->do_action(Array)\n#4 
    
    /nas/content/live/redacted/wp-settings.php(587): do_action('init')\n#5 
    
    /nas/content/live/redacted/wp-config.php(128): require_once('/nas/content/li...')\n#6 
    
    /nas/content/live/redacted/wp-load.php(50): require_once('/nas/content/li...')\n#7 
    
    /nas/content/live/redacted/wp-blog-header.php(13): require_once('/nas/content/li...')\n#8
    
    /nas/content/live/redacted/index.php(17): require('/nas/content/li...')\n#9 
    
    {main}\n thrown in /nas/content/live/redacted/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/mysql.php on line 144, referer: https://www5.redacted.org/customer-service/customer-connect/

    There are nearly 900 of these in the log from the past two days, with only the referer being different. I don’t know exactly when the problem started, but I’m pretty sure it’s recent. The last time I know I checked the log was around 9 pm Thursday, April 7, after I ran a number of updates, and there were no such errors at that time.

    The function throwing the error seems to be getAttackData(), at the point it starts parsing the $actionData array. I looked in the wfhits table and see that a fair number of the log entries have no actionData stored (none for loginOK, logout, loginFailValidUsername, lostPassword, scan:detectproxy and possbly others). So it may be an empty field where an array is expected. Don’t know if that’s the issue or if there is something deeper beyond my understanding.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @susanwrotethis, thanks for your detailed message looking into this issue.

    We have recently seen this error crop up for another Wordfence customer and managed to get the necessary error logs to diagnose it and organize a fix, which will be coming in an upcoming plugin release. Keep an eye on our changelog.

    Clearing the wfhits table manually fixes the issue temporarily, since it occurs when long requests hit a firewall rule when running the MySQLi storage engine on PHP 8.0+. This error message can also be remedied in the mean time by temporarily switching back to PHP 7.4 if you’re able. PHP7 will be supported until November this year, so is still suitable to be in use.

    I hope that helps you out,

    Peter.

    Thread Starter susanwrotethis

    (@susanwrotethis)

    Thank you! It does. I appreciate your timely help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WF-Related Fatal Errors in PHP Log’ is closed to new replies.