Jedis 5.0.3 ClusterCommandExecutor.executeCommand NullPointerException

10 views
Skip to first unread message

Sten Westerback

unread,
May 29, 2024, 8:31:34 AMMay 29
to Jedis
Hi
I have successfully used local (docker) redis with Java 21 and jedis 5.0.3.

Now for production we are going for AWS Memory DB for redis. After verifying credentials and --tls with redis-cli on Amazon Linux EC2 i tried with code using DefaultJedisClientConfig, hostAndPortSet and 
jedisCluster = new JedisCluster(hostAndPortSet, jedisClientConfig, maxAttempts); which goes through without exception. 

However, when i try the first jedisCluster.get("an existing key") it crashes with 

Caused by: java.lang.NullPointerException: Cannot suppress a null exception.
        at java.base/java.util.Objects.requireNonNull(Objects.java:259) ~[na:na]
        at java.base/java.lang.Throwable.addSuppressed(Throwable.java:1098) ~[na:na]
        at redis.clients.jedis.executors.ClusterCommandExecutor.executeCommand(ClusterCommandExecutor.java:130) ~[jedis-5.0.2.jar!/:na]
        at redis.clients.jedis.UnifiedJedis.executeCommand(UnifiedJedis.java:244) ~[jedis-5.0.2.jar!/:na]
        at redis.clients.jedis.UnifiedJedis.get(UnifiedJedis.java:722) ~[jedis-5.0.2.jar!/:na]
        at tech.kallio.configsvc.CfgStoreAWSMemDB4redis.get...

Is this a known bug inside jedis? Could the .build not detect a null for a required field? I find the documentation lacking as it seems to assume we know if for instance clientName has some special meaning.

The builder is as follows... with null/0 for most values. 

Builder cfgBuilder = DefaultJedisClientConfig.builder().clientName(clientName)
.timeoutMillis(clientTimeoutInSecs * 1000) .connectionTimeoutMillis(connectionTimeoutInSecs * 1000)
.blockingSocketTimeoutMillis(blockingSocketTimeoutInSecs * 1000)
.socketTimeoutMillis(socketTimeoutInSecs * 1000) .ssl(useSSL);
if (userName != null)
cfgBuilder = cfgBuilder.user(userName).password(password);

Would be great if someone has a solution for us.
Guess i'll try with some timeout values if timeout is reported with null exceptions.

Sazzadul Hoque

unread,
May 29, 2024, 10:23:08 AMMay 29
to jedis...@googlegroups.com
In new JedisCluster(hostAndPortSet, jedisClientConfig, maxAttempts),
did you send maxAttempts=0?

I do not see any other reason.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jedis_redis/32bc7195-c4e6-4d8f-a78c-e560202d1299n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages