Support » Plugin: Redis Object Cache » Status: Not Connected

  • Resolved PanjiNamjaElf

    (@panjinamjaelf)


    I use PhpRedis (v4.3.0) but when i enable Redis Object Cache status display not connected

    Here diagnostic log:

    Status: Not Connected
    Redis Version: Unknown
    Client: PhpRedis (v4.3.0)
    Drop-in: Valid
    Connection Exception: php_network_getaddresses: getaddrinfo failed: Name or service not known (RedisException)
    Redis Extension: 4.3.0
    Predis Client: 1.1.1
    PHP Version: 7.2.17
    Multisite: No
    Global Prefix: "wp_"
    Blog Prefix: "wp_"
    WP_REDIS_HOST: "redis"
    WP_REDIS_MAXTTL: "14400"
    WP_CACHE_KEY_SALT: "example.com_obj:"
    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"
    ]
    Ignored Groups: [
        "counts",
        "plugins",
        "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",
        "blog_meta",
        "themes"
    ]
Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Your “host” isn’t reachable.

    How to make it reachable ?

    This line is causing issue when your redis is in master/slave replication mode. Command INFO is not allowed in replication mode.

    
    $server_info = $this->redis->info( 'SERVER' );
    

    Temporary fix.

    
    @@ -572,11 +572,14 @@ class WP_Object_Cache
                     $this->redis->ping();
                 }
    
    -            $server_info = $this->redis->info( 'SERVER' );
    -            if (isset($server_info['redis_version'])) {
    -                $this->redis_version = $server_info['redis_version'];
    -            } elseif (isset( $server_info['Server']['redis_version'])) {
    -                $this->redis_version = $server_info['Server']['redis_version'];
    +            // If not in replication mode.
    +            if ( ! $options['replication'] ) {
    +                $server_info = $this->redis->info( 'SERVER' );
    +                if (isset($server_info['redis_version'])) {
    +                    $this->redis_version = $server_info['redis_version'];
    +                } elseif (isset( $server_info['Server']['redis_version'])) {
    +                    $this->redis_version = $server_info['Server']['redis_version'];
    +                }
                 }
    
    Plugin Author Till Krüss

    (@tillkruess)

    Would you mind submitting a PR on GitHub with you fix?

    Hi,

    I am having the same issue.

    I have replaced the lines that, according to Bernard Traquena, cause this error in the plugins folder>includes/object-cache.php

    See how it now looks after I made the changes in my screenshot:

    12.15.2019-18.13.56

    However it still does not connect to my hosting’s server.
    I cleared all cache and my host restarted Redis, but it keeps telling me it is “not connecting”.

    Any idea’s what to do please?

    Thanks,
    Annie

    • This reply was modified 5 months, 2 weeks ago by LogoLogics.
    Plugin Author Till Krüss

    (@tillkruess)

    Hi Annie, please post the diagnostics from the settings.

    Hi,

    Thanks for reaching out!

    Just recently, I got it connected.
    I think I placed the code in the wrong place (below instead of above the Thats it happy blogging).

    Have a great day,
    Annie

    I got the same issue.

    Status: Not Connected
    Redis Version: Unknown
    Client: PhpRedis (v5.1.1)
    Drop-in: Valid
    Connection Exception: Connection refused (RedisException)
    Redis Extension: 5.1.1
    Predis Client: 1.1.1
    PHP Version: 7.2.26
    Multisite: No
    Global Prefix: "wp_"
    Blog Prefix: "wp_"
    WP_CACHE_KEY_SALT: "exemple.com_"
    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"
    ]
    Ignored Groups: [
        "counts",
        "plugins",
        "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",
        "blog_meta",
        "themes"
    ]
    Unflushable Groups: []
    Dropins: 
     - advanced-cache.php v by 
     - Redis Object Cache Drop-In v1.5.5 by Till Kr���ss
    Plugins: 

    Before that I could use the Redis well, But after a while I got 500 Error, so I tried to disable the Redis Plugin and the website work agian, when I checked the server I found that Redis process use 90% from CPU. And Now when I try to active Object Caches I got Status: Not Connected.

    Plugin Author Till Krüss

    (@tillkruess)

    What’s your connection exception? Still “refused”?

    I have no idea

    When I Verify Redis is Working with redis-cli ping
    I got PONG but I can’t find anything about it in the server.I can’t find sudo nano /etc/redis/redis.conf.

    When I run redis-server command I got

    redis-server
    15991:C 04 Jan 02:26:46.926 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    15991:M 04 Jan 02:26:46.928 * Increased maximum number of open files to 10032 (it was originally set to 1024).
    15997:C 04 Jan 02:26:56.709 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    15991:M 04 Jan 02:26:46.928 # Creating Server TCP listening socket *:6379: bind: Address already in use
    15997:M 04 Jan 02:26:56.712 * Increased maximum number of open files to 10032 (it was originally set to 1024).
    15997:M 04 Jan 02:26:56.713 # Creating Server TCP listening socket *:6379: bind: Address already in use
    

    When I run service redis status I got

    service redis status
    Redirecting to /bin/systemctl status redis.service
    ● redis.service - Redis persistent key-value database
       Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/redis.service.d
               └─limit.conf
       Active: failed (Result: exit-code) since Sat 2019-12-28 17:25:34 PST; 6 days ago
      Process: 4463 ExecStop=/usr/libexec/redis-shutdown (code=exited, status=1/FAILURE)
      Process: 387 ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd (code=killed, signal=KILL)
     Main PID: 387 (code=killed, signal=KILL)
    
    Dec 28 17:25:34 vps****.inmotionhosting.com systemd[1]: redis.service: main ...
    Dec 28 17:25:34 vps****.inmotionhosting.com systemd[1]: redis.service: contr...
    Dec 28 17:25:34 vps****.inmotionhosting.com systemd[1]: Unit redis.service e...
    Dec 28 17:25:34 vps****.inmotionhosting.com systemd[1]: redis.service failed.
    Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
    Hint: Some lines were ellipsized, use -l to show in full.
    
    Status: Connected
    Redis Version: 3.2.12
    Client: PhpRedis (v5.1.1)
    Drop-in: Valid
    Ping: 1
    Redis Extension: 5.1.1
    Predis Client: 1.1.1
    PHP Version: 7.2.26
    Multisite: No
    • This reply was modified 4 months, 4 weeks ago by hassadr.

    Just I want to know why I got Active: failed (Result: exit-code) when I run redis-server status command.

    Thnak you.

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