“The Redis client was not able to create a connection to [127.0.0.1:6379]” when trying to create a new cache connection (Cache - Services) of type Redis Extension for Jakarta EE (Lucee 7+). I tried everything I could think of:
Host: localhost
Host: http://localhost
Host: redis
Host: 127.0.0.1
Host: http://127.0.0.1
Host: 0.0.0.0
Host: http://0.0.0.0
Host: 10.90.0.5 (Redis docker auto-assigned IP)
Host: http://10.90.0.5
Host: 192.168.1.9 (host IP)
Host: http://192.168.1.9
Port: 6379 (for all of the above)
with Username & Password and also tried without it (Direct Authentication)
- “redis” is the name of the Redis container
- in my desperation I also tried to enter the path of the Redis socket in the Host field: /tmp/redis/redis.sock that has been mounted to the Lucee docker, alas it won’t accept an empty string for the port, just 0.
- the Lucee and Redis containers are on the same network, both are healthy
- I am able to connect to Redis from inside its container and also from others via TLS, port 6379 (same for container and host)
- the Redit user “lucee” and password were created & verified beforehand.
- log files do not show anything relating to this failure of connecting, unless I don’t know where to look.
this.cache.connections["red_func"] = {
class: 'lucee.extension.io.cache.redis.simple.RedisCache'
, bundleName: 'redis.extension'
, bundleVersion: '4.0.0.2'
, storage: false
, custom: {
"timeToLiveSeconds":0,"connectionTimeout":"5000",
"host":"127.0.0.1",
"secretName":"",
"secretKey":"",
"socketTimeout":"2000",
"idleTimeout":"300000",
"username":"lucee",
"accessKeyId":"",
"maxLowPriority":"0",
"port":"6379",
"liveTimeout":"3600000",
"region":"",
"password":"myredispassword",
"minIdle":"0",
"maxIdle":"8",
"maxTotal":"24"
}
, default: 'function'
};
What am I missing? Anyone managed to configure it working? There are not much other options to play with as I can see. Any help would be appreciated.
OS: Linux (6.12.0-211.61.1.el10_2.x86_64_v2) 64bit
Java Version: 25.0.3
Tomcat Version: 11.0.25
Lucee Version: 7.1.0.204
Redis Version: 8.10.2 (separate docker container)
P.S: Would be nicer to have a Unix Socket (UDS) option for connecting to the existing Redis socket. Faster, local and works more reliably.