2.6 redis unreachable

111 views
Skip to first unread message

Jason Guy

unread,
Sep 3, 2019, 12:29:45 PM9/3/19
to NetBox
Hi all,

I upgraded to the latest this weekend. While it worked fine on my local dev environment, I see the following error in the production server:

(.venv) netbox@labman-app:/opt/netbox$ pip list | grep django-cacheops
django-cacheops          4.1
(.venv) netbox@labman-app:/opt/netbox$ python netbox/manage.py invalidate all
/opt/netbox/.venv/lib/python3.5/site-packages/cacheops/redis.py:21: RuntimeWarning: The cacheops cache is unreachable! Error: Authentication required.
  warnings.warn("The cacheops cache is unreachable! Error: %s" % e, RuntimeWarning)

I verified I can connect with redis-cli, and authenticate using the configured password.

$ redis-cli
127.0.0.1:6379> AUTH supersecret
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> CONFIG GET databases
1) "databases"
2) "16"
127.0.0.1:6379> info keyspace
# Keyspace
127.0.0.1:6379>

# Redis required for caching in v2.6
REDIS = {
    'HOST': 'localhost',
    'PORT': 6379,
    'PASSWORD': 'supersecret',
    'DATABASE': 0,
    'CACHE_DATABASE': 1,
    'DEFAULT_TIMEOUT': 300,
    'SSL': False,
}

I assume there should be a db1 under the keyspace, which I see in the dev environment on my local machine, so I assume the db1 is not getting auto created? I am not a redis expert, but I don't recall creating the db1 on my local host.

jguy@jguy-mac ~/PycharmProjects/netbox $ redis-cli
127.0.0.1:6379> auth supersecret
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> info keyspace
# Keyspace
db1:keys=64,expires=0,avg_ttl=0

Note, I do not have the webhooks enabled, hence the db0 should not be there.

Any ideas how to correct this?

Jason

 

Brian Candler

unread,
Sep 3, 2019, 1:26:14 PM9/3/19
to NetBox
Definitely 2.6.2? Should have been fixed here.

I suggest:
- tcpdump -i lo0 port 6379, and see if that auth error really is coming back from Redis
- configure your local dev environment with a redis password, and see if you can reproduce the problem

Jason Guy

unread,
Sep 3, 2019, 1:30:16 PM9/3/19
to Brian Candler, NetBox
Hey Brian,

No apparently not the latest... It was when I started testing the upgrade. :) 
Let me upgrade a bit more, and see what's going on. 

Thanks for pointing that out. I will let you know how it goes.
Jason

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/dc037603-b098-4744-880f-d8393dec8417%40googlegroups.com.

Jason Guy

unread,
Sep 3, 2019, 2:43:10 PM9/3/19
to Brian Candler, NetBox
Hi Brian,

So, I found the reason for the issue. On the production server, the configuration file still had some old default REDIS setting (which we previously didn't use) configured, toward the bottom of the file. 
I added the new required REDIS settings at the top under the main database configuration. Obviously the one lower in the file overwrote the setting. 
Apologies for wasting your time, but hopefully this helps someone avoid making the same silly mistake! :)

Thanks,
Jason


Reply all
Reply to author
Forward
0 new messages