Magento2: Redis Cache error

Created on 8 Jun 2017  路  18Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.1.4 / 2.1.7
  2. Default store

Steps to reproduce

  1. Use redis server to cache

Expected result

  1. Redis cache shoud work good.

Actual result

  1. Page not working
  2. [2017-06-08 10:22:47] main.CRITICAL: exception 'Exception' with message 'Warning: Redis::pipeline(): Already in pipeline mode in /vendor/colinmollenhour/credis/Client.php on line 1037'

Format is valid

All 18 comments

So where is the problem in Redis serwer or Magento configuration?

I didn't analyze the code at all, it looks to me that bug is in Magento code or code of colinmollenhour/credis/Client.php, maybe it occurs only in some specific configuration.

Yeap, on my local server everything work perfect, on test/production server no. Locally I have Ubuntu, test/production CentOS.

@MarekKarmelski Do you have the php-redis extension installed? We deploy to CentOS / RHEL using redis with no trouble here.

@davidalger yeap, I have. I found what was the problem, our server administrator set autoupdating, and dwo days ago wird extension, was installed to redis server. When he removed and reinstalled redis one more time, the problem has disappeared. I thin that we can close this ticket.

Cool, thanks for the quick investigation on your side :+1:

Getting the same issue on many centos7 servers right now.
On one redis had been working for months and after I refreshed the caches it stopped working with this particular issue.
On another, I just tried to do a "magento setup:backup --db" and I got the error only there but the site was working, haven't tried clearing all the caches on that one yet.

All servers do have autoupdating on and I have tried reinstalling redis as well as manually installing redis 4 but the problem remains.

The only solution I have so far is to remove redis from the magento 2 configuration. Effectively running without redis.

I found the issue.
2017-07-18 04:22 there was an automatic update for php-redis.
Package php-pecl-redis.x86_64 0:3.1.2-1.el7.remi.7.0
upgraded to
Package php-pecl-redis.x86_64 0:3.1.3-1.el7.remi.7.0

Maybe this only happens to systems running the remi repository on centos7?

I downgraded php-pecl-redis and now it works again.

We ran into the same problem after an automatic update to phpredis 3.1.3. @yatsukhnenko mentions over there that it was a purposeful change that caused side effects, may get removed in next phpredis. If not, may need an update in https://github.com/colinmollenhour/credis/blob/master/Client.php

The error was solved for me with the lastest Credis Client @chaohe linked, thanks !

I faced the same issue. Php Redis Upgraded automatically from 3.1.2 to 3.1.3 and as the PHP-FPM was not restarted, so in phpinfo it was showing 3.1.2 version. Then I restarted PHP-FPM then it shows 3.1.3 version, then I downgraded it to 3.1.2 and issue resolved.

Faced the same issue. For a hotfix use this commit
or upgrade credis if possible

This is Credis bug: 2 times calling the pipeline method. Please, patche the file vendor/colinmollenhour/credis/Client.php by the code:

            // Proxy pipeline mode to the phpredis library
            if($name == 'pipeline' || $name == 'multi') {
                if($this->isMulti) {
                    return $this;
                } else {
                    $this->isMulti = TRUE;
                    $this->redisMulti = call_user_func_array(array($this->redis, $name), $args);
                    //CUSTOM CODE!!!
                    //Credis bug fix: 2 times pipeline() calls below.
                    return $this;
                    //custom code ends
                }
            }

in lines 1013-1025

@patsky1980 patching vendors is (almost) never a good idea, are there any issues if upgrade to 1.7 colinmollenhour/credis version (the one containing commit with fix)?

We can still reproduce this in 2.2

@EliasKotlyar fix is already in 2.2-develop but not released yet.

Was this page helpful?
0 / 5 - 0 ratings