Jedis compatibility

323 views
Skip to first unread message

Petar Tahchiev

unread,
Jun 5, 2015, 7:08:23 AM6/5/15
to jedis...@googlegroups.com
Hi guys,

I'm using Jedis 2.5.2 and embedded-redis 0.6 (which ships redis 2.8.19) and sometimes I get this exception:

Stacktrace:] with root cause
redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hmset' command
    at redis.clients.jedis.Protocol.processError(Protocol.java:113)
    at redis.clients.jedis.Protocol.process(Protocol.java:138)
    at redis.clients.jedis.Protocol.read(Protocol.java:192)
    at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:282)
    at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:181)
    at redis.clients.jedis.BinaryJedis.hmset(BinaryJedis.java:722)
    at org.springframework.data.redis.connection.jedis.JedisConnection.hMSet(JedisConnection.java:2685)
    at org.springframework.data.redis.core.DefaultHashOperations$7.doInRedis(DefaultHashOperations.java:134)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:191)

See here https://github.com/kstyrc/embedded-redis/issues/48 for a more detailed exception. The guy in that issue suggests it might be incompatible versions of jedis and redis. Can you please tell me if jedis 2.5.2 is incompatible with redis 2.8.19? Also this exception does not happen every time, and once it happens on my website, I can refresh the page and it's gone. Very strange.

Marcos Lilljedahl

unread,
Jun 5, 2015, 8:42:46 AM6/5/15
to jedis...@googlegroups.com
Petar, 

Jedis 2.5.2 should be fully compatbile with redis 2.8.19. Having said that I'm seeing in your stacktrace the following line: 

at org.springframework.session.data.redis.RedisOperationsSessionRepository.save(RedisOperationsSessionRepository.java:141)
    at com.nemesis.platform.core.service.core.impl.SessionServiceImpl.setAttribute(SessionServiceImpl.java:78)

Seems like at some point SessionServiceImpl is trying to set an invalid value which is causing redis to complain about it (maybe an invalid session?). Do you have access to that code?, if that is the case can you catch the JedisDataException and print the value that you're trying to set into the session?

Thanks, 

Marcos.



--
You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedis_redis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

임정택

unread,
Jun 6, 2015, 1:28:29 AM6/6/15
to jedis...@googlegroups.com
Hi, Petar.

You may want to check that it calls mset with empty argument. 
(Redis complains 'wrong number of arguments' when no argument or odd number of arguments are presented for hmset.)
Jedis doesn't adjust it for accomplishing multi versions of Redis support.

Thanks.
Jungtaek Lim (HeartSaVioR) 

2015년 6월 5일 금요일 오후 8시 8분 23초 UTC+9, Petar Tahchiev 님의 말:
Reply all
Reply to author
Forward
0 new messages