• Resolved Matt

    (@emkadia)


    Hi All, what could be the possible cause of the following ‘WordPress database error Commands out of sync; you can’t run this command now for query SELECT *, CASE’ error in our error log?

    [04-Nov-2019 15:43:32 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 (1, 8, 9, 2, 5, 6) AND (expiration = 0 OR expiration > UNIX_TIMESTAMP()) ORDER BY typeSort ASC, id DESC made by wfWAFIPBlocksController::synchronizeConfigSettings, wfBlock::ipBlocks, wfBlock::allBlocks
    [04-Nov-2019 15:43:32 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 wfWAFIPBlocksController::synchronizeConfigSettings, wfBlock::lockouts, wfBlock::allBlocks

    Thanks
    Matt

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support wfphil

    (@wfphil)

    Hi Matt,

    The MySQL documentation say that this error is caused by incorrectly using a couple functions that Wordfence doesn’t use:

    https://dev.mysql.com/doc/refman/8.0/en/commands-out-of-sync.html

    Therefore it could be being caused by the following:

    1) Your theme or another plugin is using one of those functions.

    2) Also, mysql_use_result() is used internally in PHP (in the C source) and not necessarily as a PHP function. It’s possible certain PHP versions have a bug that may call it when it shouldn’t happen so the version of PHP your site is running under could be the cause.

    I would like to have a look at your Wordfence diagnostics report. Please go to the top of the “Diagnostics” tab on the Wordfence “Tools” page. There will be a “SEND REPORT BY EMAIL” button to send the diagnostics report. Enter wftest [at] wordfence [dot] com as the email and @emkadia as the forum username please.

    Once you have emailed me the diagnostics report can you reply here to let me know that it has been sent. This is important in the unlikely event that your installation of WordPress is having an issue with sending mail.

    Plugin Support wfphil

    (@wfphil)

    Hi @wfphil

    Also with regards my reply earlier today can you send us your raw access logs between these times please:

    04-Nov-2019 14:45 UTC to 04-Nov-2019 16:45 UTC

    Send to the same email address and put @emkadia in the subject field so that we know it is from you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress database error Commands out of sync;’ is closed to new replies.