Title: WordPress database error Deadlock
Last modified: April 27, 2025

---

# WordPress database error Deadlock

 *  Resolved [Kramarz](https://wordpress.org/support/users/kramarz/)
 * (@kramarz)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/)
 * Any idea how to get rid of this error? I believe it’s related to automatic checks
   for updates on paid WooCommerce extensions?
 * `[27-Apr-2025 13:24:40 UTC] WordPress database error Deadlock found when trying
   to get lock; try restarting transaction for query INSERT INTO aaa_options (option_name,
   option_value, autoload) VALUES ('_transient_timeout_jetpack_update_remote_package_last_query','
   1745760340', 'off') ON DUPLICATE KEY UPDATE option_name = VALUES(option_name),
   option_value = VALUES(option_value), autoload = VALUES(autoload) made by shutdown_action_hook,
   do_action('shutdown'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\
   Jetpack\Connection\Package_Version_Tracker->maybe_update_package_versions, Automattic\
   Jetpack\Connection\Package_Version_Tracker->is_rate_limiting, set_transient, 
   add_option`

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Ahir Hemant](https://wordpress.org/support/users/hemant-ahir/)
 * (@hemant-ahir)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18438302)
 * Hi [@kramarz](https://wordpress.org/support/users/kramarz/) 
   You’re absolutely
   right — this _is_ related to automatic update checks (especially for WooCommerce-
   paid extensions managed by Jetpack or WooCommerce.com connections).
 * **The problem:**
   The error `WordPress database error Deadlock found when trying
   to get lock; try restarting transaction` happens when two database operations
   clash — both trying to **write to `wp_options` (or in your case `aaa_options`)**
   at the same time, causing MySQL to _deadlock_.
 * Jetpack’s `Package_Version_Tracker` is trying to `set_transient()` to cache the
   results of a plugin update check (e.g., to avoid hitting WooCommerce.com servers
   too often). It writes a transient like `_transient_timeout_jetpack_update_remote_package_last_query`
   in `options` table — and if your site is under heavy load (like during a shutdown
   hook), multiple processes might try to write/update this at the same time → **
   deadlock**.
 *  Thread Starter [Kramarz](https://wordpress.org/support/users/kramarz/)
 * (@kramarz)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18438320)
 * [@hemant-ahir](https://wordpress.org/support/users/hemant-ahir/) 
   Cheers for 
   confirming.I’m rather looking for anything that I can do to prevent that error
   from happening though.Or is it “safe to ignore” kind of error?
 *  [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * (@lovingbro)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18438436)
 * Hi [@kramarz](https://wordpress.org/support/users/kramarz/),
 * Welcome to the WooCommerce support forum. I completely understand wanting to 
   find a way to prevent this from happening, rather than just accepting it.
 * Deadlock errors like the one you’re seeing are usually the result of high concurrency;
   two or more processes trying to update the same part of the database (in this
   case, the options table) at exactly the same time. This tends to happen during
   busy moments like shutdown hooks when WordPress is saving transient data related
   to plugin updates, including WooCommerce extensions managed via Jetpack.
 * At the moment, there isn’t a direct setting within WooCommerce or Jetpack to 
   completely prevent this. However, the good news is that this specific deadlock
   during a transient update is generally **safe to ignore**; it doesn’t impact 
   order processing, customer activity, or plugin functionality. WordPress simply
   retries the transient update later.
 * That said, if you want to reduce the chance of it happening, here are a few tips:
    - Make sure your site’s database is optimized regularly.
    - Use an object caching system like Redis or Memcached if your hosting supports
      it, which can reduce direct database writes.
    - Review and minimize any unnecessary plugins that might also be writing to 
      transients at shutdown.
 * If the errors are frequent and you’re seeing any performance impacts, it might
   be worth reaching out to your host to review database performance settings like
   InnoDB lock wait timeouts.
 * Feel free to let us know if you need any more help.
 *  Plugin Support [Kay U a11n](https://wordpress.org/support/users/kingsleyinfo/)
 * (@kingsleyinfo)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18457321)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved.
 * If you have a few minutes, we’d love if you could leave us a review: [https://wordpress.org/support/plugin/woocommerce/reviews/](https://wordpress.org/support/plugin/woocommerce/reviews/)
 *  Thread Starter [Kramarz](https://wordpress.org/support/users/kramarz/)
 * (@kramarz)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18457376)
 * Oh yea, sorry. Solved it by increasing some server side parameters. Cheers.
 *  [Zee](https://wordpress.org/support/users/doublezed2/)
 * (@doublezed2)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18457892)
 * Hello [Kramarz](https://wordpress.org/support/users/kramarz/),
 * Thank you for your reply.
 * I’m glad to hear you’ve resolved the issue, and I truly appreciate you taking
   the time to share the solution here. Your input may help others facing the same
   problem.
 * Have a great day!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘WordPress database error Deadlock’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [Zee](https://wordpress.org/support/users/doublezed2/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-deadlock-8/#post-18457892)
 * Status: resolved