I've installed PhpRedis and verified Redis is working with redis-server PING
When I use the lock backend I get:
$ drush cc all
PHP Fatal error: Call to a member function incr() on a non-object in /sites/all/modules/contrib/redis/lib/Redis/Lock/Backend/PhpRedis.php on line 54
When I disable the lock backend I get:
$ drush cc all
' as reply type byte [error]
in Redis->exec() (line 96 of sites/all/modules/contrib/redis/lib/Redis/Cache/PhpRedis.php).
WD php: Warning: Cannot modify header information - headers already sent by (output started at [warning]
/usr/share/drush/includes/drush.inc:820) in drupal_send_headers() (line 1239 of
bootstrap.inc).
' as reply type byteerror, got '
in Redis->exec() (line 96 of sites/all/modules/contrib/redis/lib/Redis/Cache/PhpRedis.php).
Comments
Comment #1
pounardThanks for reporting.
Working with Drush only? You don't have any problems while browsing the site?
Comment #2
aidanlis commentedWebsite produces the same,
RedisException: protocol error, got ' ' as reply type byte in Redis->exec() (line 96 of sites/all/modules/contrib/redis/lib/Redis/Cache/PhpRedis.php).
Running redis-server on Debian, 2:1.2.6-1
Cheers,
Comment #3
pounardThanks you very much.
I will try to reproduce it but I'll need a few more details:
Comment #4
aidanlis commentedPHP: 5.3.3-7+squeeze14
PhpRedis: Redis Version => 2.2.1
Redis: 2:1.2.6-1
The relevant bits of settings.php (everything else is stock standard):
Comment #5
pounardThank you very much, I will try this as soon as I have time.
Comment #6
pounardI'm not forgetting you, I still don't have an environment where I can work this out @work. This would be a good idea to test again thought because I fixed some bugs recently.
Comment #7
pounardHello again, I did a quick and dirty test on by box, a freshly installed Drupal 7 (latest stable).
I'm using this software version:
- Drush 7.x-5.7
- Redis server 2.2.14
- An rather old version of PhpRedis (I'm trying to update it right now)
- Drupal core 7.15
And it works quite well.
So, I have a new question: are you sure the PhpRedis extension is correctly enabled on your PHP CLI environment?
EDIT: Just updated to latest git version of PhpRedis, still no issues.
Some thoughts: maybe update your Redis? Update PhpRedis first, you might have used a buggy version! I'm closing this issue as cannot reproduce, but if you any new details, please re-open!
Comment #8
Fidelix commentedI am experiencing this exact problem as well.
PHPRedis compiled from the github source.
It does not happen on my local machine, but on my staging server, it does.
The only difference that I can tell is that the Redis server is not running on localhost on the staging server.
It is located in another virtual machine, which I can telnet to the redis port and run $redis->ping if I create a php script from scratch.
Comment #9
Fidelix commentedThis isn't generating any errors.
As soon as I uncomment this line:
Hell breaks loose.
Comment #10
pounard@Fidelix, please tell me exact versions you are using of:
- PhpRedis
- PHP
- Drupal core
- Redis module
And any other information you might think useful. I'd very much like to reproduce this bug but I could not the first time.
Comment #11
Fidelix commentedRedis 1.2.6 from dotdeb
PHPRedis 2.2.2 http://i.imgur.com/BVvsHXH.png
PHP Version 5.3.21-1~dotdeb.0
Drupal 7.19
Redis module: 7.x-2.0-beta4 (But at first, I was trying on an old dev version)
Apparently, it is breaking on:
https://github.com/nicolasff/phpredis/blob/master/library.c
Function redis_sock_read() or redis_read_variant_reply()
Comment #12
Fidelix commented(facepalm)
There is my answer.
Actually, the server where I had Redis installed did not have dotdeb configured, so it was using the default debian Redis package.
After compiling Redis manually, it worked like a charm. Then I removed it, configured dotdeb, installed it again, and it works wonders.
Really sorry for taking your time.
Comment #13
pounardDon't worry, I didn't loose time on this one, so you're saying it's because of a version mismatch between Redis and PhpRedis? It worth the shot to document it in the module.
Comment #14
Fidelix commentedThat's correct. It appears most of the new commands on PHPRedis need at least Redis 2.x to work.
I will submit a patch with a documentation update.
Comment #15
pounardAfter some thoughts, I think we can't seriously support Redis versions prior to 2.4 (missing WATCH command for a start). So I will document that this module is untested and potentially unstable or not working at all with older Redis versions.
I'm marking this as fixed as I commit the documentation fix. Please re-open if you disagree or have new arguments to bring.
Comment #17
c4rl commentedI have a few suggestions.
hook_requirementscheck for the Redis version.Comment #19
pounardI didn't implement the hook_requirements() because the module does not require to be activated. Otherwise I documented that Redis >=2.4.0 only is supported. Thank you very much.
Comment #20
c4rl commentedThanks :)