• Resolved buddywhatshisname

    (@vhmarkgmailcom)


    If the users have no Redis +info permission, the plugin fatals, taking down the WP. The easy fix is to check if the wp_object_cache is null:

    function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {
    global $wp_object_cache;
    if(is_null($wp_object_cache)) {
    return false;
    }

    return $wp_object_cache->get( $key, $group, $force, $found );
    }
    Predis\Response\ServerException: NOPERM User default has no permissions to run the 'info' command in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:416
    Stack trace:
    #0 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(385): Predis\Client->onErrorResponse()
    #1 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(336): Predis\Client->executeCommand()
    #2 wp-content/object-cache.php(1097): Predis\Client->__call()
    #3 wp-content/object-cache.php(563): WP_Object_Cache->fetch_info()
    #4 wp-content/object-cache.php(256): WP_Object_Cache->__construct()
    #5 wp-includes/load.php(897): wp_cache_init()
    #6 wp-settings.php(149): wp_start_object_cache()
    #7 wp-config.php(376): require_once('/home1l/wordpre...')
    #8 wp-load.php(50): require_once('/home1l/wordpre...')
    #9 wp-blog-header.php(13): require_once('/home1l/wordpre...')
    #10 index.php(17): require('/home1l/wordpre...')
    #11 {main}
    PHP Fatal error: Uncaught Error: Call to a member function get() on null in wp-content/object-cache.php:193
    Stack trace:
    #0 wp-includes/option.php(621): wp_cache_get()
    #1 wp-includes/option.php(164): wp_load_alloptions()
    #2 wp-includes/l10n.php(53): get_option()
    #3 wp-includes/l10n.php(166): get_locale()
    #4 wp-includes/l10n.php(798): determine_locale()
    #5 wp-content/object-cache.php(2951): load_textdomain()
    #6 wp-content/object-cache.php(2933): WP_Object_Cache->show_error_and_die()

    Also, if the redis goes offline or changes IP, the whole WP fatals — might want to add some try-catch safety

    Predis\Connection\ConnectionException: php_network_getaddresses: getaddrinfo failed: Name or service not known [tcp://redisdelv.comp.uvic.ca:6379] in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php:144
    Stack trace:
    #0 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(130): Predis\Connection\AbstractConnection->onConnectionError()
    #1 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(175): Predis\Connection\StreamConnection->createStreamSocket()
    #2 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(89): Predis\Connection\StreamConnection->tcpStreamInitializer()
    #3 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php(85): Predis\Connection\StreamConnection->createResource()
    #4 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(255): Predis\Connection\AbstractConnection->connect()
    #5 wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(231): Predis\Connection\StreamConnection->connect()
    #6 wp-content/object-cache.php(923): Predis\Client->connect()
    #7 wp-content/object-cache.php(549): WP_Object_Cache->connect_using_predis()
    #8 wp-content/object-cache.php(258): WP_Object_Cache->__construct()
    #9 wp-includes/load.php(897): wp_cache_init()
    #10 wp-settings.php(149): wp_start_object_cache()
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    NOPERM User default has no permissions to run the 'info' command

    If the user doesn’t have permission, this should crash as burn.

    Also, if the redis goes offline or changes IP, the whole WP fatals

    That’s also intentional. Otherwise you might loose data once it comes back online.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    If the user has no INFO permission you could simply not show the parts of the UI that depend on it — I have other Redis users who work just fine without. There is no need for it to take down the WP, and it’d make your plugin more robust. Maybe you disable caching in those cases.

    Same if the Redis goes offline, as happens for maintenance or unexpected outages. A bit of robustness would enhance WP admin confidence in using your plugin.

    Plugin Author Till Krüss

    (@tillkruess)

    If SQL is down, your site is down. If Redis is down, your site is down. I’ve explained this dozens of times, search the forums.

    Redis Server is extremely easy to keep up using supervisord.

    If Redis Object Cache doesn’t fit your needs and you can risk data loss, then use a different plugin.

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

You must be logged in to reply to this topic.