• Resolved imprepide

    (@imprepide)


    [06-Mar-2023 18:19:27 UTC] WordPress database error Commands out of sync; you can't run this command now for query SELECT *, CASE 
    WHEN type = 3 THEN 0
    WHEN type = 4 THEN 1
    WHEN type = 7 THEN 2
    WHEN type = 6 THEN 3
    WHEN type = 5 THEN 4
    WHEN type = 9 THEN 5
    WHEN type = 8 THEN 6
    WHEN type = 2 THEN 7
    WHEN type = 1 THEN 8
    ELSE 9999
    END AS typeSort, CASE 
    WHEN type = 3 THEN parameters
    WHEN type = 4 THEN parameters
    WHEN type = 1 THEN IP
    WHEN type = 9 THEN IP
    WHEN type = 5 THEN IP
    WHEN type = 6 THEN IP
    WHEN type = 7 THEN IP
    WHEN type = 2 THEN IP
    WHEN type = 8 THEN IP
    ELSE 9999
    END AS detailSort
     FROM wp_wfblocks7 WHERE type IN (7) AND (expiration = 0 OR expiration > UNIX_TIMESTAMP()) ORDER BY typeSort ASC, id DESC made by wfShutdownRegistry->handleShutdown, wfShutdownFunction->invoke, wfWAFIPBlocksController::synchronizeConfigSettings, wfBlock::lockouts, wfBlock::allBlocks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @imprepide, thanks for dropping us a message about this.

    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. If the database connection is lost during a request, this shutdown code still runs and reconnects to the database, which isn’t in a state where queries can be run. Such states include the database being unavailable due to shutting down, or a query limitation set by the hosting provider is reached.

    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 of 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. If they are willing to send us logs, including mysql/mariadb logs and the syslog, we may be able to help determine the cause.

    Thanks,
    Peter.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_wfblocks7’ is closed to new replies.