Closed chetratep closed 8 months ago
Describe the problem When using password file with isCluster enabled, cluster client is created without password when receiving incoming scrape request. When using password file with url scheme redis:// is required. However in connectToRedisCluster https://github.com/oliver006/redis_exporter/blob/master/exporter/redis.go#L69-L81 removed the URL scheme before creating RedisDialOptions. The removal of the scheme in the url make searching password from the file hit nothing (https://github.com/oliver006/redis_exporter/blob/master/exporter/redis.go#L35). Because in the password file the URL(Keys) has scheme included.
redis://
connectToRedisCluster
Error is in below:
DEBU[10984] Creating cluster object DEBU[10984] Running refresh on cluster object ERRO[10984] Cluster refresh failed: redisc: all nodes failed NOAUTH Authentication required.
What version of redis_exporter are you running? Please run redis_exporter --version if you're not sure what version you're running.
redis_exporter --version
[ ] 1.54.0
Running the exporter ./redis_exporter -redis.password-file=pwd-file.json --is-cluster -redis.addr redis://xxxxxx:6379
Expected behavior When creating the RedisDialOptions, the URI should include the scheme as well.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Note: The workaround is to specify the -redis.password=xxxx .
~Can't you just change the entry in the password file to omit the redis:// scheme?~
nvm - I see your explanation, the scheme is stripped. Makes sense.
Describe the problem When using password file with isCluster enabled, cluster client is created without password when receiving incoming scrape request. When using password file with url scheme
redis://
is required. However inconnectToRedisCluster
https://github.com/oliver006/redis_exporter/blob/master/exporter/redis.go#L69-L81 removed the URL scheme before creating RedisDialOptions. The removal of the scheme in the url make searching password from the file hit nothing (https://github.com/oliver006/redis_exporter/blob/master/exporter/redis.go#L35). Because in the password file the URL(Keys) has scheme included.Error is in below:
What version of redis_exporter are you running? Please run
redis_exporter --version
if you're not sure what version you're running.[ ] 1.54.0
Running the exporter ./redis_exporter -redis.password-file=pwd-file.json --is-cluster -redis.addr redis://xxxxxx:6379
Expected behavior When creating the RedisDialOptions, the URI should include the scheme as well.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Note: The workaround is to specify the -redis.password=xxxx .