• Resolved net

    (@krstarica)


    After upgrading from 22.0 to to 22.1 started seeing dozens of “Predis\Connection\ConnectionException: Error while reading line from the server” errors every 15-20 minutes:

    [23-Feb-2024 19:04:47 UTC] Predis\Connection\ConnectionException: Error while reading line from the server. [unix:/var/run/redis/redis.sock] in /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php:131
    Stack trace:
    #0 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(286): Predis\Connection\AbstractConnection->onConnectionError()
    #1 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php(119): Predis\Connection\StreamConnection->read()
    #2 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php(111): Predis\Connection\AbstractConnection->readResponse()
    #3 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(232): Predis\Connection\AbstractConnection->executeCommand()
    #4 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(225): Predis\Connection\StreamConnection->connect()
    #5 /home/wordpress/wp-content/object-cache.php(924): Predis\Client->connect()
    #6 /home/wordpress/wp-content/object-cache.php(546): WP_Object_Cache->connect_using_predis()
    #7 /home/wordpress/wp-content/object-cache.php(256): WP_Object_Cache->__construct()
    #8 /home/wordpress/wp-includes/load.php(856): wp_cache_init()
    #9 /home/wordpress/wp-settings.php(131): wp_start_object_cache()
    #10 /home/wordpress/wp-config.php(128): require_once('...')
    #11 /home/wordpress/wp-load.php(50): require_once('...')
    #12 /home/wordpress/wp-blog-header.php(13): require_once('...')
    #13 /home/wordpress/index.php(17): require('...')
    #14 {main}

    When rollback to 22.0 the errors are gone.

    Using Redis Object Cache plugin: https://wordpress.org/plugins/redis-cache/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @krstarica,

    Thanks for reaching out, but I’m unsure how to reproduce this since the errors don’t relate to Yoast SEO. It mentions the Redis Object Cache plugin is reading a line from the server, and the line still points to that plugin. We highly recommend reporting plugin conflicts to the developer of the conflicting plugin as they may have additional information vital to providing a resolution. .

    Thread Starter net

    (@krstarica)

    I have reached out to Redis Object Cache plugin developer, but obviously there is some code change introduced in Yoast SEO version 22.1 that has something to do with this?

    @maybellyne: Our plugin has not changed in months. You might be pushing too much data through the WordPress object cache API, or fire too many commands at once.

    Thread Starter net

    (@krstarica)

    The new wp_cache_flush_group() call could indeed be causing these timeouts.

    @krstarica: Can you try increasing the WP_REDIS_READ_TIMEOUT and see if that resolves it?

    Thread Starter net

    (@krstarica)

    The situation with Yoast SEO version 22.2 is even worse:

    [05-Mar-2024 09:36:46 UTC] RedisException: read error on connection to /var/run/redis/redis.sock in /home/wordpress/wp-content/object-cache.php:743
    Stack trace:
    #0 /home/wordpress/wp-content/object-cache.php(743): Redis->select()
    #1 /home/wordpress/wp-content/object-cache.php(536): WP_Object_Cache->connect_using_phpredis()
    #2 /home/wordpress/wp-content/object-cache.php(256): WP_Object_Cache->__construct()
    #3 /home/wordpress/wp-includes/load.php(856): wp_cache_init()
    #4 /home/wordpress/wp-settings.php(131): wp_start_object_cache()
    #5 /home/wordpress/wp-config.php(128): require_once('...')
    #6 /home/wordpress/wp-load.php(50): require_once('...')
    #7 /home/wordpress/wp-blog-header.php(13): require_once('...')
    #8 /home/wordpress/index.php(17): require('...')
    #9 {main}
    
    [05-Mar-2024 09:42:21 UTC] RedisException: socket error on read socket in /home/wordpress/wp-content/object-cache.php:1830
    Stack trace:
    #0 /home/wordpress/wp-content/object-cache.php(1830): Redis->eval()
    #1 /home/wordpress/wp-content/object-cache.php(1730): WP_Object_Cache->{closure}()
    #2 /home/wordpress/wp-content/object-cache.php(162): WP_Object_Cache->flush_group()
    #3 /home/wordpress/wp-content/plugins/wordpress-seo/src/builders/indexable-link-builder.php(710): wp_cache_flush_group()
    #4 /home/wordpress/wp-content/plugins/wordpress-seo/src/builders/indexable-link-builder.php(623): Yoast\WP\SEO\Builders\Indexable_Link_Builder->update_incoming_links_for_related_indexables()
    #5 /home/wordpress/wp-content/plugins/wordpress-seo/src/builders/indexable-link-builder.php(136): Yoast\WP\SEO\Builders\Indexable_Link_Builder->update_related_indexables()
    #6 /home/wordpress/wp-content/plugins/wordpress-seo/src/actions/indexing/abstract-link-indexing-action.php(65): Yoast\WP\SEO\Builders\Indexable_Link_Builder->build()
    #7 /home/wordpress/wp-content/plugins/wordpress-seo/src/integrations/admin/background-indexing-integration.php(221): Yoast\WP\SEO\Actions\Indexing\Abstract_Link_Indexing_Action->index()
    #8 /home/wordpress/wp-includes/class-wp-hook.php(324): Yoast\WP\SEO\Integrations\Admin\Background_Indexing_Integration->index()
    #9 /home/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #10 /home/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action()
    #11 phar:///home/wp/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(364): do_action_ref_array()
    #12 phar:///home/wp/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(286): Cron_Event_Command::run_event()
    #13 [internal function]: Cron_Event_Command->run()
    #14 phar:///home/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
    #15 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()
    #16 phar:///home/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
    #17 phar:///home/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(431): WP_CLI\Dispatcher\Subcommand->invoke()
    #18 phar:///home/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(454): WP_CLI\Runner->run_command()
    #19 phar:///home/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1269): WP_CLI\Runner->run_command_and_exit()
    #20 phar:///home/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
    #21 phar:///home/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()
    #22 phar:///home/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
    #23 phar:///home/wp/php/boot-phar.php(20): include('...')
    #24 /home/wp(4): include('...')
    #25 {main}
    
    [05-Mar-2024 09:42:21 UTC] RedisException: read error on connection to /var/run/redis/redis.sock in /home/wordpress/wp-content/object-cache.php:743
    Stack trace:
    #0 /home/wordpress/wp-content/object-cache.php(743): Redis->select()
    #1 /home/wordpress/wp-content/object-cache.php(536): WP_Object_Cache->connect_using_phpredis()
    #2 /home/wordpress/wp-content/object-cache.php(256): WP_Object_Cache->__construct()
    #3 /home/wordpress/wp-includes/load.php(856): wp_cache_init()
    #4 /home/wordpress/wp-settings.php(131): wp_start_object_cache()
    #5 /home/wordpress/wp-config.php(129): require_once('...')
    #6 /home/wordpress/wp-load.php(50): require_once('...')
    #7 /home/wordpress/wp-blog-header.php(13): require_once('...')
    #8 /home/wordpress/index.php(17): require('...')
    #9 {main}

    @tillkruess define( 'WP_REDIS_READ_TIMEOUT', 2 ); didn’t help.

    Try using WP_REDIS_READ_TIMEOUT up to 10, because the default is 5s in Redis I believe.

    If you want to follow this closely, you can watch this thread: https://github.com/rhubarbgroup/redis-cache/issues/508

    Thread Starter net

    (@krstarica)

    Default WP_REDIS_READ_TIMEOUT is 1 second:
    https://github.com/rhubarbgroup/redis-cache/#configuration:~:text=WP_REDIS_READ_TIMEOUT

    Don’t see any read timeout in redis.conf:
    https://github.com/redis/redis/blob/unstable/redis.conf

    PhpRedis default read timeout is 0 (disabled):
    https://github.com/phpredis/phpredis?tab=readme-ov-file:text=readTimeout#:~:text=in%20milliseconds%20(optional)-,readTimeout,-%3A%20float%2C%20value%20in

    What are the other consequences of raising WP_REDIS_READ_TIMEOUT to 10 seconds?

    The default WP_REDIS_READ_TIMEOUT is 1s correct. Most Redis commands respond within 1ms so the timeout of 1000x is reasonable.

    Changing WP_REDIS_READ_TIMEOUT to 10s means if a Redis command fails, your site will hang/wait for 10 seconds.

    We’re working on separating the flush and read timeouts for LUA closures in this PR: https://github.com/rhubarbgroup/redis-cache/pull/509

    Because it’s better to keep WP_REDIS_READ_TIMEOUT at 1 and bump WP_REDIS_FLUSH_TIMEOUT to 10s by default inside the plugin.

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