Support » Plugin: Wordfence Security - Firewall, Malware Scan, and Login Security » error_log with WordFence errors

  • Hello,

    I keep seeing the following error on Multiple websites in an error_log file in the root of the WP installation.

    [14-Oct-2022 15:48:30 UTC] WordPress databasefout Commands out of sync; you can't run this command now bij query SELECT *, CASE 
    WHEN <code>type</code> = 3 THEN 0
    WHEN <code>type</code> = 4 THEN 1
    WHEN <code>type</code> = 7 THEN 2
    WHEN <code>type</code> = 6 THEN 3
    WHEN <code>type</code> = 5 THEN 4
    WHEN <code>type</code> = 9 THEN 5
    WHEN <code>type</code> = 8 THEN 6
    WHEN <code>type</code> = 2 THEN 7
    WHEN <code>type</code> = 1 THEN 8
    ELSE 9999
    END AS <code>typeSort</code>, CASE 
    WHEN <code>type</code> = 3 THEN <code>parameters</code>
    WHEN <code>type</code> = 4 THEN <code>parameters</code>
    WHEN <code>type</code> = 1 THEN <code>IP</code>
    WHEN <code>type</code> = 9 THEN <code>IP</code>
    WHEN <code>type</code> = 5 THEN <code>IP</code>
    WHEN <code>type</code> = 6 THEN <code>IP</code>
    WHEN <code>type</code> = 7 THEN <code>IP</code>
    WHEN <code>type</code> = 2 THEN <code>IP</code>
    WHEN <code>type</code> = 8 THEN <code>IP</code>
    ELSE 9999
    END AS <code>detailSort</code>
     FROM <code>wp_wfBlocks7</code> WHERE <code>type</code> IN (7) AND (<code>expiration</code> = 0 OR <code>expiration</code> > UNIX_TIMESTAMP()) ORDER BY <code>typeSort</code> ASC, <code>id</code> DESC gemaakt door wfShutdownRegistry->handleShutdown, wfShutdownFunction->invoke, wfWAFIPBlocksController::synchronizeConfigSettings, wfBlock::lockouts, wfBlock::allBlocks

    Thanks for looking into this.

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


    Hi @jpnl, thanks for your detailed message.

    We have seen this on various sites in the past, but almost always Litespeed if you’re running on that environment.

    That said, Litespeed runs fine for plenty of sites also running Wordfence so your host will need to troubleshoot why this is happening. We believe that the issue is related to the database itself where MySQL/MariaDB is stopping, reconnecting and leaving the connection in a state that somehow causes this query error to appear.

    We usually request that you or your host check the database server logs and other logs for the website(s) on the server such as syslog etc. to see what else is going on with the server at the timestamp of these issues. I would expect the database to be unavailable temporarily, either because it is restarting or has crashed.



    Ok, I will look into it and get back, thanks.

    Plugin Support wfpeter


    Thanks @jpnl, let us know if you discover anything new!


    Hi @wfpeter,

    I did some investigation and I can confirm that the error only happens on websites that are hosted on a LiteSpeed server. From the websites that run on the LiteSpeed server, there are only 7 out of 20 websites that get this error on a regular bases. The others don’t have this error. All these websites are on the same server in a WHM reseller account and each site has it’s own cPanel account. I don’t see any pattern between the sites with/without the error. That seems like it is not server related.

    The most recent error was today and there was no error in the server log around the same time. There were also no issues with resource usages.

    Do you gave any other idea what can be checked?


    Also, hosting party says:

    In LiteSpeed or MariaDB logs, we see no issues that would lead to website limitations.

    And also

    The error messages that do occur are mainly about the Wordfence plugin, which is also not recommended for use on our servers. The reason for this is that we already provide additional software at server level for website security, including Imunify360, which we use in addition to monitoring.

    What’s your take on both statements?


    I checked 31 sites today who are in the same whm account on the same litespeed server. 6 of them repeatedly have this error and the 31 sites are more or less identical in theme and plugins configuration.

    Since it doesn’t happen on all sites, it’s hard to believe it’s caused by a wrong database/litespeed configuration.

    What is the wp_wfBlocks7 table for? I checked and it’s empty.

    Shouldn’t there be some sort of error handling to get around this and not write a errors_log file?


    Plugin Support wfpeter


    Hi @jpnl, thanks for looking into this.

    The wp_wfBlocks7 table stores currently blocked IPs on your site. Having 0 rows just mean blocks have expired and removed. If there is data in any of the sites you’ve been testing, you could try exporting data from wp_wfblocks7 to confirm there are no copies of post data somehow in that table, but we expect the issue you’re seeing is a problem when the query is being processed. Some queries we do are designed to fail silently, but will still produce some log information in the background.

    Just in case there is something wrong in wp_wfblocks7, you could also try repairing it. It’s less likely that an issue like that could affect 6 websites but not impossible if they’re using similar configurations and something common across all sites is affecting the table.

    Some hosts may have professional associations or preferences when it comes to security plugins on WordPress, but we understand that many individuals installing Wordfence or another security plugin just want to be able to choose their preferred one too. We usually work with hosts to keep a good relationship and troubleshoot any cases where a host is having particular problems with Wordfence.

    For this reason, you could drop us a diagnostics report so we can try looking a bit more closely at your configuration to wftest @ wordfence . com. You can find the link to do so at the top of the Wordfence > Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    NOTE: It should look as follows – Screenshot of Tools > Diagnostic > Send by Email

    Thanks again,


    Thanks for explaining @wfpeter

    I checked the sites in question again (it’s 2 weeks later). From the sites I checked before:
    – 4 who had the error before have it again
    – 2 who had the error before doesn’t have it now
    – 2 who didn’t have it before do have it now

    Did repair these databases now and will see again how that goes.

    I have also sent the diagnostic report.


    Any news on this?

    See also this ticket with more errors coming from Wordfence.


    This is still an issue!
    When will there be a fix?

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.