• Resolved danielbmxd

    (@danielbmxd)


    Hi,
    The following logs are generated in my error.log file:
    [20-Oct-2020 22:35:28 UTC] Error Commands out of sync; you can’t run this command now de la base de datos de WordPress para la consulta 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 (4) AND (expiration = 0 OR expiration > UNIX_TIMESTAMP()) ORDER BY typeSort ASC, id DESC realizada por wfWAFIPBlocksController::synchronizeConfigSettings, wfBlock::patternBlocks, wfBlock::allBlocks
    [20-Oct-2020 22:35:28 UTC] Error Commands out of sync; you can’t run this command now de la base de datos de WordPress para la consulta SELECT *, CASE

    How could I solve it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support WFAdam

    (@wfadam)

    Hello @danielbmxd and thanks for reaching out to us!

    Can you send a diagnostic report 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.

    Thanks!

    Thread Starter danielbmxd

    (@danielbmxd)

    Hi, I already sent it

    Plugin Support WFAdam

    (@wfadam)

    Thanks for sending those reports!

    The MySQL documentation says that this error is caused by incorrectly using two functions that Wordfence doesn’t use.

    We are only seeing this on sites that are on a LiteSpeed web server. Looks like you are on a LiteSpeed web server it might not be LiteSpeed itself, but something about the configuration on servers in a certain distribution with LiteSpeed.

    We recommend that you ask your hosting provider to see if they can find anything in the MySQL logs, LiteSpeed’s logs, or syslog around the same time that the errors occur.

    We did see one user who saw an improvement when their hosting provider applied some MySQL tuning but I have also seen cases of this that took some additional work.

    Let me know what you do find!

    Thanks!

    Thread Starter danielbmxd

    (@danielbmxd)

    My hosting (banahosting) uses litespeed and mariadb, but they tell me the following
    “Regarding the Wordfence errors, we have checked the MySQL and Apache error logs, couldn’t find anything specific.”
    Additionally, is it possible that it is related to a report from the live traffic tool where it shows me “blocked by firewall for LFI: Local File Inclusion” but to the ip of my server?
    “United States left /wp-admin/admin-post.php and was blocked by firewall for LFI: Local File Inclusion in POST body: filepath =% 2Fhome% 2Fxxxxx% 2Fpublic_html% 2Fwp-content% 2Fuploads% 2F2020% 2F04% 2Ftop- e1604610306565.jpg at /wp-admin/admin-post.php
    11/5/2020 16:05:06 (22 hours 24 mins ago)
    IP: 50.31.1 …. Hostname: xxx.banahosting.com
    Human / Bot: Bot
    WordPress / 5.5.3; https: // … “

    Plugin Support WFAdam

    (@wfadam)

    That is strange. Could you send a screenshot of that to wftest @ wordfence . com? Put your forum username as the subject and let me know when you have sent it.

    I would like to review it.

    Thanks!

    • This reply was modified 4 years, 4 months ago by WFAdam.
    Thread Starter danielbmxd

    (@danielbmxd)

    Sent

    Plugin Support WFAdam

    (@wfadam)

    I think the different IP in a blocked hit in Live Traffic is unrelated to the MySQL commands out of sync error.

    If IPs are normally correct in Live Traffic, but blocks by the WAF have the wrong IP, that usually means that the site either has something in a plugin, in theme’s functions.php, or in wp-config.php that’s “fixing” the IP address after the WAF has run. (e.g., if the correct IP is in X-Forwarded-For, but they use a few lines of code to put it in REMOTE_ADDR and clear the X-Forwarded-For header.)

    This query of ours is run in the PHP shutdown handler. I’m fairly sure the commands out of sync error is really because the database has been disconnected, which caused the WP hit to be interrupted when a query failed (but the shutdown handlers still run), and PHP’s shutdown handler is running with a reconnected database.

    Your host did say they checked the MySQL and Apache error logs, couldn’t find anything specific, so it might be helpful if they also check the syslog around the time of one of these messages, or mysql/mariadb general log, to see if the DB server restarted around that time or anything, which might not be in the error log.

    I’d also like to mention that in the other cases where we’ve seen this, additional plugins were also causing commands out of sync messages intermittently, this isn’t specific to Wordfence, but any plugins that are using the database in the shutdown handler.

    Let me know what you find!

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error Commands out of sync’ is closed to new replies.