Closed nerzhul closed 3 years ago
Looked a bit more, password
actually get passed to Connection
constructor so it's useful.
i'm trying to fix this issue, it seems currently no password is put when you use sentinel mode.
I'm using netbox 2.10.3
/usr/local/lib/python3.9/site-packages/cacheops/redis.py:19: RuntimeWarning: The cacheops cache is unreachable! Error: Authentication required.
warnings.warn("The cacheops cache is unreachable! Error: %s" % e, RuntimeWarning)
how can you pass the password, regarding the code password should be in URL directly ?
I'm trying to find why in netbox 2.10.3 it doesn't work.
They setup like this
if CACHING_REDIS_USING_SENTINEL:
CACHEOPS_SENTINEL = {
'locations': CACHING_REDIS_SENTINELS,
'service_name': CACHING_REDIS_SENTINEL_SERVICE,
'db': CACHING_REDIS_DATABASE, 'password': CACHING_REDIS_PASSWORD,
}
else:
if CACHING_REDIS_SSL:
REDIS_CACHE_CON_STRING = 'rediss://'
else:
REDIS_CACHE_CON_STRING = 'redis://'
if CACHING_REDIS_PASSWORD:
REDIS_CACHE_CON_STRING = '{}:{}@'.format(REDIS_CACHE_CON_STRING, CACHING_REDIS_PASSWORD)
REDIS_CACHE_CON_STRING = '{}{}:{}/{}'.format(
REDIS_CACHE_CON_STRING,
CACHING_REDIS_HOST,
CACHING_REDIS_PORT,
CACHING_REDIS_DATABASE
)
CACHEOPS_REDIS = REDIS_CACHE_CON_STRING
if not CACHE_TIMEOUT:
CACHEOPS_ENABLED = False
else:
CACHEOPS_ENABLED = True
Is there any issue here ?
CACHEOPS_SENTINEL
and CACHEOPS_REDIS
is mutually exclusive. Same as if you use it yourself. Anything in CACHEOPS_SENTINEL
is simply passed through to constructor, including password
.
@Suor it seems yes it's correctly setuped on netbox side, without sentinel it works well, but with sentinel enabled we have an issue with the password authentication. Do you have any idea where it comes from ? i'm a but confused by all those abstract levels
You should simply add password
to CACHEOPS_SENTINEL
and it will be passed to constructor.
There should not be
password
inCACHEOPS_SENTINEL
. If you omit it there it won't be used at all anyway.