• Resolved kikpartners

    (@kikpartners)


    WP install appears to be operating without crashing on the front end, however WP CLI just keeps hanging up. I was talking with WPEngine support and we isolated it to the WordFence plugin (switched to twenty twenty theme, only plugin active).

    WP Core and WordFence are at their latest versions at time of writing.

    I have tried:

    • turning the plugin off/on
    • uninstalling the plugin while keeping settings and reinstalling
    • uninstalling the plugin while purging settings and reinstalling

    They sent me the following Error that they were seeing on their end during the investigation:

    PHP Warning:  fopen(/nas/content/live/--redacted--/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332
    Warning: fopen(/nas/content/live/--redacted--/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332
    PHP Warning:  include(/nas/content/live/--redacted--/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
    5:38 pm
    Warning: include(/nas/content/live/--redacted--/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
    PHP Warning:  include(): Failed opening '/nas/content/live/--redacted--/wp-content/wflogs/rules.php' for inclusion (include_path='.:/usr/share/php') in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
    Warning: include(): Failed opening '/nas/content/live/--redacted--/wp-content/wflogs/rules.php' for inclusion (include_path='.:/usr/share/php') in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
    Error reading Wordfence Firewall config data, configuration file could be corrupted or inaccessible. Path: /nas/content/live/--redacted--/wp-content/wflogs/config.php
    PHP Fatal error:  Uncaught InvalidArgumentException: wfWAFAttackDataStorageFileEngine::unpackMicrotime $binary expected to be string with length of 8, received string of length 0 in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:964
    Stack trace:
    #0 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(1172): wfWAFAttackDataStorageFileEngine::unpackMicrotime()
    #1 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(1270): wfWAFAttackDataStorageFileEngine->unpackHeader()
    #2 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(1375): wfWAFAttackDataStorageFileEngine->getRowCount()
    #3 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(177): wfWAFAttackDataStorageFileEngine->getNewestTimestamp()
    #4 /nas/content/live/--redacted--/wp-conten in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 964
    Fatal error: Uncaught InvalidArgumentException: wfWAFAttackDataStorageFileEngine::unpackMicrotime $binary expected to be string with length of 8, received string of length 0 in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:964
    Stack trace:
    #0 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(1172): wfWAFAttackDataStorageFileEngine::unpackMicrotime()
    #1 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(1270): wfWAFAttackDataStorageFileEngine->unpackHeader()
    #2 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(1375): wfWAFAttackDataStorageFileEngine->getRowCount()
    #3 /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(177): wfWAFAttackDataStorageFileEngine->getNewestTimestamp()
    #4 /nas/content/live/--redacted--/wp-conten in /nas/content/live/--redacted--/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 964
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

    Please assist.

Viewing 8 replies - 1 through 8 (of 8 total)
  • wfjoshc

    (@wfjoshc)

    Hi @kikpartners

    I took a look at the error log and I can see there has been a critical error.

    Would it be possible to reach out to Wp Engine and ask if they can increase your memory limit?

    Let me know if that resolves it!

    Thanks,

    Joshua

    Thread Starter kikpartners

    (@kikpartners)

    Hello Josh,

    The error log states that it’s looking for a file that does not exist on lines 1, 2, 3 and 5:

    "... failed to open stream: No such file or directory in ..."

    Rather than attempting to allocate x number of bytes of memory and running out. Additionally, the following portion on line 8:

    "Error reading Wordfence Firewall config data, configuration file could be corrupted or inaccessible."

    Very much makes it look like Wordfence is looking for a file that is not there, and this file is for some reason not being generated when reinstalling the plugin.

    wfjoshc

    (@wfjoshc)

    Hi @kikpartners

    Have you done a complete reinstall following this guide?

    This will remove all settings too so if you want, export them (Wordfence Tools > Import/Export Options) and save the provided key so you can import them later.

    1. On the Wordfence Dashboard > Global Options page in the section General Wordfence Options select “Delete Wordfence tables and data on deactivation?” and click “Save Changes” 
    2. On the Wordfence > Login Security > Settings page select “Delete Login Security tables and data on deactivation” and click “Save Changes”  
    3. Uninstall the Wordfence plugin normally through WordPress admin  
    4. If you didn’t copy your premium license before, login to wordfence.com, click the Licenses link in the top navigation menu, find your license and copy it 
    5. Wait about 10 minutes (not really necessary but I always like to give a system more time than it needs) 
    6. Reinstall Wordfence from the WordPress admin ?

    Thanks,

    Joshua

    kjetilb

    (@kjetilb)

    I’m having the same issue. I tried the fix provided above, but it didn’t work for me. Is there another fix for this?

    yourfriendpete

    (@yourfriendpete)

    Same problem here. I’m having to disable Wordfence to run WP CLI commands which is obviously not idea. Any updates?

    kjetilb

    (@kjetilb)

    To follow up on this, this issue occurs on every environment with wordfence installed both on the current version as well as 7.8.2/7.8.1.

    My “manual” fix is to run wp-cli commands with the “–skip-plugins=wordfence” flag to skip wordfence.

    Would be nice to know what is causing the issue. WPengine supports say that they cannot find any errors on their part and that it is likely a issue with wordfence.

    I’m pretty confident this is a WPE issue because it doesn’t seem to affect all sites in the same manner. It only seems to be affecting our clients on the dedicated plans. All clients on the cheaper shared plans do not seem to have this same issue even though they are running the same version of wordfence 7.9.2. All clients on the more expensive dedicated plans are experiencing this issue.

    I’m not experiencing any issues locally with the same codebase that I have on WPE. and I’m getting the error on WPE dedicated plans without other plugins (wordfence is the only plugin activated) and using a default WP theme.

    I don’t know if anyone else is having the same issue but WPE support seems to be able to run wpcli just fine from their end. so I’m not sure what’s up with that. For the record if anyone is thinking this might just be wordfence’s FW, I have my IP in the allow list and even with the firewall disabled I get the same behavior (commands just hang until I close the terminal window).

    Anyway, I hope people keep contacting WPE until this is resolved. the other thing I’d mention is using the “–skip-plugins=wordfence” flag will allow you to work around this issue. I’d recommend creating a wp-cli.yml in your root and paste:

    skip-plugins:
    	- wordfence

    this should allow you to run wpcli without having to type the flag out everytime.

    I placed a ticket in and WPE and got a response

    Hi pm1932,

    I’ve just heard back from our engineering team and they confirmed that this does appear to be an issue on our end as we also had another report of a similar issue previously. Thankfully they already have a fix that’s being worked on that should hopefully be going out soon so we can update you when that’s been done and have you test on your end.

    Regards,

    …., Technical Support Specialist

    WP Engine, Inc.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP CLI not working with wordfence installed on WPEngine’ is closed to new replies.