After upgrading to Spring Boot 2.2.8.RELEASE from 2.2.7.RELEASE, the Redis health indicator started reporting down with the following error detail on clustered Redis:

"redis": {
   "details": {
     "error": "java.lang.IllegalArgumentException: Value must not be null"
  },
  "status": "DOWN"
 }

It appears that the info properties coming back in 2.2.8 have the IP address and port prefix on the keys (e.g. 127.0.0.1:7002.redis_version). It also appears the properties come back from each node this way.

The attached zip file reproduces the issue. Instructions can be found in instructions.md in the attached zip for how we are starting a clustered Redis docker container.

clustered-redis-issue.zip

Comment From: edwardsre

@wilkinsona Here is the separate issue you asked for in #21514

Comment From: scottfrederick

Thanks for the report and the sample application. I can reproduce the problem with the provided sample and instructions.

The root cause is a change made to Spring Data Redis 2.2.8 in this commit. With this change, Spring Data Redis is detecting the cluster configuration and providing a LettuceReactiveRedisClusterConnection to Spring Boot's RedisReactiveHealthIndicator, where it was providing a LettuceReactiveRedisConnection in previous versions. When RedisReactiveHealthIndicator calls connection.serverCommands().info(), The Cluster form of the connection eventually delegates to LettuceReactiveClusterServerCommands, which adds the host and port prefix to each info property.

This seems to me like a condition that Spring Boot will need to handle, but I'm not sure how Boot should figure out what's going on or if there's something more Spring Data Redis should be doing to simplify the situation.

cc @mp911de

Comment From: mp911de

We changed the behavior as bugfix but weren't aware that the reactive health check would fail. I suggest issuing a PING command if the connection is of type ReactiveRedisClusterConnection and skip the detail for the 2.2.x line. #21514 aims for a proper change in Boot 2.3.x and 2.4.x to align with the blocking healthcheck.