I saw this issue while searching so I thought I’d log my own investigation for anyone else who sees this.
tldr: woocommerce does have a feature to clear sessions under /wp-admin/admin.php?page=wc-status&tab=tools or if you can get the start of the problem session from the log you can track down and delete it in the woocommerce sessions table.
That’s a solution but not a full diagnosis of the root cause.
I am equally sure it isn’t an issue with this plugin as such.
The call stack looks fairly clear, and when I look at the call stack
WP_Object_Cache->add_or_replace(true, 'wc_cache_2_0880...', 'a:7:{s:4:"cart"...', 'wc_session_id', <strong>-10330591</strong>)
and the woocommerce code:
wp_cache_add( $this->get_cache_prefix() . $customer_id, $value, WC_SESSION_CACHE_GROUP, $this->_session_expiration - time() );
it looks like an old session is being picked up and then being requested to cache with a negative cache lifetime as the session has already expired.
[02-Jun-2019 04:21:59 UTC] Predis\Response\ServerException: ERR invalid expire time in setex in wp-content/plugins/redis-cache/includes/predis/src/Client.php:370
Stack trace:
#0 wp-content/plugins/redis-cache/includes/predis/src/Client.php(335): Predis\Client->onErrorResponse(Object(Predis\Command\StringSetExpire), Object(Predis\Response\Error))
#1 wp-content/plugins/redis-cache/includes/predis/src/Client.php(314): Predis\Client->executeCommand(Object(Predis\Command\StringSetExpire))
#2 wp-content/object-cache.php(621): Predis\Client->__call('setex', Array)
#3 wp-content/object-cache.php(564): WP_Object_Cache->add_or_replace(true, 'wc_cache_2_0b80...', 'a:7:{s:4:"cart"...', 'wc_session_id', -10330591)
#4 wp-content/object-cache.php(37): WP_Object_Cache->add('wc_cache_2_0880...', 'a:7:{s:4:"cart"...', 'wc_session_id', -10330591)
#5 wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(327): wp_cache_add('wc_cache_2_0880...', 'a:7:{s:4:"cart"...', 'wc_session_id', -10330591)
#6 wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(224): WC_Session_Handler->get_session('xxxxxxxxxx...', Array)
#7 wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(93): WC_Session_Handler->get_session_data()
#8 wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(69): WC_Session_Handler->init_session_cookie()
#9 wp-content/plugins/woocommerce/includes/class-woocommerce.php(747): WC_Session_Handler->init()
#10 wp-content/plugins/woocommerce/includes/wc-core-functions.php(2266): WooCommerce->initialize_session()
#11 wp-content/plugins/woocommerce/includes/class-woocommerce.php(549): wc_load_cart()
#12 wp-includes/class-wp-hook.php(286): WooCommerce->init('')
#13 wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#14 wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#15 wp-settings.php(525): do_action('init')
#16 wp-config.php(135): require_once('/xxxx/p...')
#17 wp-load.php(37): require_once('/xxxx/p...')
#18 wp-blog-header.php(13): require_once('/xxxx/p...')
#19 index.php(17): require('/xxxx/p...')