• Resolved rabmcnab

    (@rabmcnab)


    I had to manually rename the wordfence plugin folder name for a large number of sites this morning.

    They are all on various DigitalOcean droplets running Centos 6.7 and Apache.

    White Screen of Death on frontend and backend of all sites.

    The stacktrace is;

    Fatal error: Uncaught exception 'wfWAFStorageFileException' with message 'Unable to open /var/www/vhosts/domain.com/public/wp-content/wflogs/ips.php for reading and writing.' in /var/www/vhosts/domain.com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:355 Stack trace: #0 /var/www/vhosts/domain.com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(452): wfWAFStorageFile->open() #1 /var/www/vhosts/domain.com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(409): wfWAFStorageFile->fetchConfigData() #2 /var/www/vhosts/domain.com/public/wp-content/plugins/wordfence/lib/wordfenceClass.php(729): wfWAFStorageFile->getConfig('wafStatus') #3 [internal function]: wordfence::enqueueAJAXWatcher('') #4 /var/www/vhosts/domain.com/public/wp-includes/plugin.php(525): call_user_func_array('wordfence::enqu...', Array) #5 /var/www/vhosts/domain.com/public/wp-includes/script-loader.php(1076): do_action('wp_enqueue_scri...') #6 [ in /var/www/vhosts/domain.com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 355

    I temporarily set the wflogs direcotory to 777 permissions it didn’t help.

    I’ve deactivated Wordfence on all blogs, interested to see if anyone else has this exact issue.

    https://wordpress.org/plugins/wordfence/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter rabmcnab

    (@rabmcnab)

    I can confirm this has been introduced in 6.1.9

    I download and manually uploaded 6.1.9 – same stack trace as above, site dysfunctional.

    Downloaded 6.1.8 and uploaded. Sites back up.

    https://downloads.wordpress.org/plugin/wordfence.6.1.8.zip

    Rollback manually and wait for 6.1.10.

    Thread Starter rabmcnab

    (@rabmcnab)

    Further to this. It’s the changes you’ve made to the following file that’s causing this issue;

    lib/wordfenceClass.php

    I cannot get into my site at all, so cannot disable Wordfence nor revert back to an earlier version. I have not made any changes to any Wordfence files:

    Fatal error: Uncaught exception ‘wfWAFStorageFileConfigException’ with message ‘Error reading Wordfence Firewall config data, configuration file could be corrupted or inaccessible. Path: /home/johnfle1/public_html/wp-content/wflogs/config.php’ in /home/johnfle1/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:465 Stack trace: #0 /home/johnfle1/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(409): wfWAFStorageFile->fetchConfigData() #1 /home/johnfle1/public_html/wp-content/plugins/wordfence/lib/wordfenceClass.php(729): wfWAFStorageFile->getConfig(‘wafStatus’) #2 [internal function]: wordfence::enqueueAJAXWatcher(”) #3 /home/johnfle1/public_html/wp-includes/plugin.php(525): call_user_func_array(‘wordfence::enqu…’, Array) #4 /home/johnfle1/public_html/wp-includes/script-loader.php(1076): do_action(‘wp_enqueue_scri…’) #5 [internal function]: wp_enqueue_scripts(”) #6 /home/johnfle1/public_html/wp-includes/plugin.php(525): call_user_func_ar in /home/johnfle1/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 465

    Help

    JohnF

    Thread Starter rabmcnab

    (@rabmcnab)

    The problem is this change to public static function enqueueAJAXWatcher in

    lib/wordfenceClass.php

    OLD

    public static function enqueueAJAXWatcher() {
        if (wfUtils::isAdmin()) {
            wp_enqueue_style('wordfence-colorbox-style', wfUtils::getBaseURL() . 'css/colorbox.css', '', WORDFENCE_VERSION);
            wp_enqueue_script('jquery.wfcolorbox', wfUtils::getBaseURL() . 'js/jquery.colorbox-min.js', array('jquery'), WORDFENCE_VERSION);
            wp_enqueue_script('wordfenceAJAXjs', wfUtils::getBaseURL() . 'js/admin.ajaxWatcher.js', array('jquery'), WORDFENCE_VERSION);
        }
    }

    And NEW which breaks the sites (and having seen a few threads on this it’s nothing to do with PHP version I think – I’ve seen PHP5.3.3 through to to versions of PHP 5.5). Users reporting this on shared hosting, VPS and dedicated.

    public static function enqueueAJAXWatcher() {
        $waf = wfWAF::getInstance();
        $config = $waf->getStorageEngine();
        $wafStatus = (!WFWAF_ENABLED ? 'disabled' : $config->getConfig('wafStatus'));
        if (wfUtils::isAdmin() && $wafStatus != 'disabled') {
            wp_enqueue_style('wordfenceAJAXcss', wfUtils::getBaseURL() . 'css/wordfenceBox.css', '', WORDFENCE_VERSION);
            wp_enqueue_script('wordfenceAJAXjs', wfUtils::getBaseURL() . 'js/admin.ajaxWatcher.js', array('jquery'), WORDFENCE_VERSION);
        }
    }
    Thread Starter rabmcnab

    (@rabmcnab)

    @fletj

    You’ll have to rename the wp-content/plugins/wordfence directory via FTP

    Same problem for me since latest version 6.1.9 on all my websites:

    Fatal error: Uncaught exception ‘wfWAFStorageFileException’ with message ‘Unable to open /www/wp-content/wflogs/ips.php for reading and writing.’ in /wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:355 Stack trace: #0 /www/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(452): wfWAFStorageFile->open() #1 /www/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(409): wfWAFStorageFile->fetchConfigData() #2 /www/wp-content/plugins/wordfence/lib/wordfenceClass.php(729): wfWAFStorageFile->getConfig(‘wafStatus’) #3 [internal function]: wordfence::enqueueAJAXWatcher(‘plugins.php’) #4 /www/wp-includes/plugin.php(525): call_user_func_array(‘wordfence::enqu…’, Array) #5 /www/wp-admin/admin-header.php(92): do_action(‘admin_enqueue_s…’, ‘plugins.php’) #6 /www/wp-admin/plugins.p in /www/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 355

    Same issue here, updating sites to version 6.1.9 gets me that uncaught exception. My fix was to update the permissions on all the files in the wp-content/wflogs directory to ensure that Apache has read/write access to them. Doing this fixed the white screen issue.

    Thread Starter rabmcnab

    (@rabmcnab)

    @braican

    Lol, I realise that I didn’t read the original stack properly and created the writable wflogs directory in the wrong place. D’oh.

    As it happens I didn’t need to have this file writable by apache, I set permissions and group to the chrooted user/group that the site runs under. Initially had to make it writable, after it had created the php files (php files in a logging directory in wp-content??) I could set it back to 755 and all seems fine.

    We’re working on a fix now that should be released later today.

    The white screen or wfWAFStorageFileException error means that wflogs or wflogs/config.php isn’t readable or doesn’t exist. The site can be fixed by adjusting file permissions so the web server can read/write those files, if possible, or by adding these two lines to the theme’s functions.php:

    remove_action(‘wp_enqueue_scripts’, ‘wordfence::enqueueAJAXWatcher’);
    remove_action(‘admin_enqueue_scripts’, ‘wordfence::enqueueAJAXWatcher’);

    The two lines can be removed after the new update is released.

    Thread Starter rabmcnab

    (@rabmcnab)

    OK, thanks @wfsupport

    Good luck today, might be quite a busy one for you I think πŸ˜‰

    [oops, ignore me]

    Thank you for quick patch, works perfectly now πŸ™‚

    This error was happening to me when the host ran out of disk and couldn’t write a temporary file.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘wfWAFStorageFileException’ is closed to new replies.