Title: wp_wfblocks7
Last modified: March 7, 2023

---

# wp_wfblocks7

 *  Resolved [imprepide](https://wordpress.org/support/users/imprepide/)
 * (@imprepide)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wp_wfblocks7/)
 *     ```wp-block-code
       [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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwp_wfblocks7%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wp_wfblocks7/#post-16537198)
 * Hi [@imprepide](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/wp_wfblocks7/#post-16537198)
 * Status: resolved