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

    (@wfpeter)

    Hi @bjf2000, thanks for your message.

    The forum guidelines require us to use one topic per user for an issue/request, so older cases that receive new replies from different users can’t be tracked easily as there’s no detailed ticketing system behind the scenes. www.remarpro.com provide the forums as community support, but we still endeavour to do as best we can for our free customers by being present here ourselves.

    When you see a “Commands out of sync” database error in your logs there are often other plugins getting the same error as well.?The issue happens because some plugins, including Wordfence, use PHP’s “shutdown handler” to run some code after the rest of a database request has finished. But if the database connection is lost during a request, this shutdown code still runs and triggers reconnecting to the database, but the database isn’t in a state where queries can be run, if the database is unavailable due to shutting down or if a query limitation set by the hosting provider is reached for example. The ‘commands out of sync’ errors are not the actual cause of a problem, but rather side-effects of the database getting disconnected. When this error is logged, it’s because something else already failed, but it isn’t visible in PHP’s error log.

    If you have WP-CLI you can run a query like
    wp db query ‘\s’
    …which should show you the database server’s uptime. The same can be done on the mysql command line by just typing?\s. In a couple cases reported to us where users had the access to do this, they did find that the database server had recently restarted when they saw these errors. Generally, your hosting provider will need to look into the problem with the database, though with the few sites where we’ve seen this problem, we have not heard back about the host’s solution if they were able to fix it. If your host is willing to send us logs, including?mysql/mariadb logs?and the?syslog, we may be able to help determine the cause.

    In your diagnostic report, there is a cURL error 7 message under our IPv6 check, but this is totally normal to see when Cloudflare assigns an IPv6 address to your site even if your host doesn’t give you an IPv6 address.

    Thanks,
    Peter.

    Thread Starter bjf2000

    (@bjf2000)

    While I do occasionally see some associated with other tables, they’re dwarfed by the ones associated with Wordfence, and the others are much less verbose than the Wordfence ones for whatever reason. Perhaps the frequency is reflective of Wordfence being much more active in WordPress and therefore susceptible to the condition. or at least wfblocks7 is. So, I’m not entirely convinced by the “other plugins suffer from the same errors” reasoning if the scale between the two is completely different.

    What is wfblocks7 used for, exactly? It must be what everyone mentions for a reason.

    What about the earlier idea that it’s related to Litespeed caching, or at least doesn’t happen when there is no caching? Our host uses Litespeed (uncached, AFAIK), so we have no choice in the matter about Litespeed itself, but they always have and we didn’t have this problem in the initial years of using Wordfence. We didn’t always use Super Page Cache for Cloudflare though, as we have since around when this problem began. The other post mentioned only seeing the problem when they enabled Litespeed caching (via whatever means they used to do that). So, the common denominator might be caching, but that didn’t come up in your response. We can’t plausibly disable caching for any length of time, and that’s not really a solution anyway, but it seems like a big clue if you’re seeing prevalent use of caching among those who’ve reported the issue.

    It really doesn’t seem to be associated with db uptime per se since phpMyAdmin says: “This MySQL server has been running for 8 days, 22 hours, 13 minutes and 47 seconds. It started up on May 18, 2023 at 02:03 AM.” The problem has certainly showed many times within that period, but I don’t think an uptime figure is necessarily indicative of connectivity with the database, which is what you were talking about. That might be something only reflected in the types of logs you mentioned, which I’ll ask the host about to see if they’ll send them to me.

    Thanks

    Thread Starter bjf2000

    (@bjf2000)

    Logs? Yea or nay? And if so, where should they be sent?

    Thread Starter bjf2000

    (@bjf2000)

    That’s a good question, bjf2000. Inquiring minds.

    Thread Starter bjf2000

    (@bjf2000)

    Glad to have maybe played a small role in encouraging this to be fixed after all this time, which it seems to have been as of 7.10.0.

    BTW. per another thread, in case anyone is wondering, logs should go here, which I only learned today via another thread: wftest @ wordfence . com

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not resolved, obviously (database error Commands out of sync’ is closed to new replies.