goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
24.05k stars 4.75k forks source link

[core] Failed to ping redis+sentinel with password #14810

Closed kmlebedev closed 3 years ago

kmlebedev commented 3 years ago

Expected behavior and actual behavior:

Successful connection to the redis+sentinel with a password

Steps to reproduce the problem:

Versions:

Additional context:

2021-05-06T08:25:49Z [INFO] [/core/main.go:164]: initializing cache ...
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:66]: get redis pool:821584da9b467015eade432767a37b2fredis+sentinel://default:xxxx@registry-redis-ha.query.consul:16379/harbor/0?idle_timeout_seconds=30
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:101]: getSentinelPool:redis+sentinel://default:xxxx@registry-redis-ha.query.consul:16379/harbor/0?idle_timeout_seconds=30
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:104]: 821584da9b467015eade432767a37b2fsentinel DialConnectionTimeout:1s
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:108]: 821584da9b467015eade432767a37b2fsentinel DialReadTimeout:2s
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:112]: 821584da9b467015eade432767a37b2fsentinel DialWriteTimeout:5s
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:121]: 821584da9b467015eade432767a37b2fredis has password
2021-05-06T08:25:49Z [DEBUG] [/lib/redis/redisclient.go:142]: 821584da9b467015eade432767a37b2fdial redis sentinel:registry-redis-ha.query.consul:16379
2021-05-06T08:25:49Z [ERROR] [/lib/cache/cache.go:101]: failed to ping redis+sentinel://default:xxxxx@registry-redis-ha.query.consul:16379/harbor/0?idle_timeout_seconds=30, retry after 803.134233ms : redigo: no sentinels available; last error: NOAUTH Authentication required.

sentinel auth work

redis-cli -p 16379 --user default --pass xxxx ping
PONG

and redis without sentinel auth wotk

bitsf commented 3 years ago

doesn't support password for sentinel server now, only support password for redis server refer issue #14757

ywk253100 commented 3 years ago

Closing this issue as it's dup of #14757