rhubarbgroup / redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
https://wordpress.org/plugins/redis-cache/
GNU General Public License v3.0
425 stars 148 forks source link

Critical Error When Updating Posts with UX Builder Due to Redis Connection Issues #538

Closed vinitgoswamireact closed 1 month ago

vinitgoswamireact commented 1 month ago

Description

When updating a post using UX Builder on my production site, I encounter a critical error. This issue does not occur on my staging site. The error message suggests a Redis connection problem, specifically an error reading a line from the server.

Expected Behavior

The post should update without causing any errors or interruptions to the site.

Actual Behavior

Upon updating a post with UX Builder, a critical error occurs, and the following Redis-related error message is logged:

Predis\Connection\ConnectionException: Error while reading line from the server. [tcp://127.0.0.1:6379] in /bitnami/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php:131

This leads to site-wide disruptions.

Possible Fix

The issue may be due to a conflict between Redis and another plugin, a configuration issue with Redis, or memory fragmentation. Disabling Redis temporarily resolves the issue, suggesting that Redis is involved in the problem.

Steps to Reproduce

  1. Log in to the WordPress admin area on the production site.
  2. Edit a post using UX Builder.
  3. Click the "Update" button.
  4. Observe the critical error message.

Additional Context

This issue has significantly affected my site's stability, causing disruptions whenever content is updated with UX Builder. The issue is isolated to the production environment; the staging site does not exhibit this problem.

Environment

Debugging Steps Taken

  1. Redis Status Check:

    • Verified that the Redis server is running and accessible.
    • Restarted the Redis server to resolve transient connection issues.
  2. Cleared Redis Cache:

    • Manually cleared the Redis cache using redis-cli FLUSHALL.
  3. Plugin Conflict Check:

    • Disabled all plugins except Redis to check for conflicts.
    • Re-enabled plugins one by one to identify any conflicting plugins.
  4. Error Log Monitoring:

    • Monitored debug.log for relevant errors and logs.
    • Identified repeated Redis connection errors during the issue.

Temporary Workaround

Disabling Redis using WP-CLI has temporarily resolved the issue, but a permanent solution is needed to ensure Redis can be used without causing errors.

appcheap-staranddaisy commented 1 month ago

m facing the same issue with the Flatsome, when I update the page from UX-builder on my whole website its shows me critical error

tillkruss commented 1 month ago

What do you have your WP_REDIS_READ_TIMEOUT set to?

vinitgoswamireact commented 1 month ago

Redis Configuration Update

I made some updates to the Redis configuration to resolve the issue:

Current Redis Status:

Global Groups:

[
    "blog-details",
    "blog-id-cache",
    "blog-lookup",
    "global-posts",
    "networks",
    "rss",
    "sites",
    "site-details",
    "site-lookup",
    "site-options",
    "site-transient",
    "users",
    "useremail",
    "userlogins",
    "usermeta",
    "user_meta",
    "userslugs",
    "redis-cache",
    "blog_meta",
    "network-queries",
    "site-queries",
    "theme_files",
    "translation_files",
    "user-queries"
]

Ignored Groups:

[
    "counts",
    "plugins",
    "theme_json",
    "themes",
    "wordfence",
    "wordfence-ls"
]

Unflushable Groups:

[]

Groups Types:

{
    "blog-details": "global",
    "blog-id-cache": "global",
    "blog-lookup": "global",
    "global-posts": "global",
    "networks": "global",
    "rss": "global",
    "sites": "global",
    "site-details": "global",
    "site-lookup": "global",
    "site-options": "global",
    "site-transient": "global",
    "users": "global",
    "useremail": "global",
    "userlogins": "global",
    "usermeta": "global",
    "user_meta": "global",
    "userslugs": "global",
    "redis-cache": "global",
    "blog_meta": "global",
    "network-queries": "global",
    "site-queries": "global",
    "theme_files": "global",
    "translation_files": "global",
    "user-queries": "global",
    "counts": "ignored",
    "plugins": "ignored",
    "theme_json": "ignored",
    "themes": "ignored",
    "wordfence": "ignored",
    "wordfence-ls": "ignored"
}

Drop-ins:

[
    "advanced-cache.php v by ",
    "Redis Object Cache Drop-In v2.5.2 by Till Krüss"
]
tillkruss commented 1 month ago

Great, let us know if it occurs again.