Support » Plugin: Redis Object Cache » Redis Object cache could not be flushed

  • Resolved Shillongtitude

    (@shillongtitude)


    I just installed the Redis Object Cache in a new WordPress site and it seems to be connected and working but whenever I try to flush cache, I get the following error:

    Object cache could not be flushed

    And my nginx error log shows the following:

    [error] 22151#22151: *59 connect() failed (111: Connection refused) while connecting to upstream, client: [IP Address], server: example.com, request: "GET /wp-admin/options-general.php?page=redis-cache&action=flush-cache&_wpnonce=fc5d93dca9 HTTP/1.1", upstream: "fastcgi://127.0.0.1:8001", host: "example.com", referrer: "https://example.com/wp-admin/options-general.php?page=redis-cache"

    Diagnostics shows:

    Status: Connected
    Client: PhpRedis (v5.3.4)
    Drop-in: Valid
    Disabled: No
    Ping: 1
    Errors: []
    PhpRedis: 5.3.4
    Predis: Not loaded
    Credis: Not loaded
    PHP Version: 8.0.3
    Plugin Version: 2.0.18
    Redis Version: 5.0.7
    Multisite: No
    Filesystem: Working
    Global Prefix: "wp_"
    Blog Prefix: "wp_"
    WP_REDIS_HOST: "127.0.0.1"
    WP_REDIS_PORT: 6379
    WP_REDIS_PASSWORD: ••••••••
    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"
    ]
    Ignored Groups: [
        "counts",
        "plugins",
        "themes"
    ]
    Unflushable Groups: []
    Drop-ins: [
        "Redis Object Cache Drop-In v2.0.18 by Till Krüss"
    ]
Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Shillongtitude

    (@shillongtitude)

    UPDATE:

    I uninstalled the plugin and reinstalled it again but now whenever I click “ENABLE OBJECT CACHE”, the wordpress dashboard randomly logs out and when I try to login again, the wordpress password doesn’t work. When I delete the object-cache.php file from wp-content, I can login to wordpress again.

    tldr: WordPress keeps logging me out if the “object-cache.php” file exists in wp-content.

    Thread Starter Shillongtitude

    (@shillongtitude)

    Not sure if this could be the reason but according to a security-hardening guide online, I have renamed the following redis commands using rename-command before installing the plugin or even WordPress:

    FLUSHDB, FLUSHALL, KEYS, PEXPIRE, DEL, CONFIG, SHUTDOWN, BGREWRITEAOF, BGSAVE, SAVE, SPOP, SREM, RENAME, and DEBUG

    If the redis object cache plugin requires any of the above to not be renamed, can you kindly point them out so I can revert them back.

    Plugin Author Till Krüss

    (@tillkruess)

    You can’t rename Redis commands. That will break this plugin.

    Make sure you flush the cache after re-enabling it. That will fix your login issues.

    Thread Starter Shillongtitude

    (@shillongtitude)

    @tillkruess Should I revert all of the following commands or are there specific commands from the following that I should revert?

    FLUSHDB -- FLUSHALL -- KEYS -- PEXPIRE -- DEL -- CONFIG -- SHUTDOWN -- BGREWRITEAOF -- BGSAVE -- SAVE -- SPOP -- SREM -- RENAME -- DEBUG

    Plugin Author Till Krüss

    (@tillkruess)

    I’d suggest using default commands.

    Thread Starter Shillongtitude

    (@shillongtitude)

    @tillkruess Changed the commands to their default and everything is working as it should now. Thank you man.

    Thread Starter Shillongtitude

    (@shillongtitude)

    Just a side-note question, if I want to use custom command names, is there any way I could manually configure the plugin to run redis commands with the custom renamed commands?

    Plugin Author Till Krüss

    (@tillkruess)

    You could submit a PR on GitHub with that feature 👍

    You’d likely need to use rawCommand for everything because Predis/PhpRedis won’t support your custom methods.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.