Error -2 connecting to redis:6379. Name does not resolve.

634 views
Skip to first unread message

Hasan T. Emdad

unread,
Oct 25, 2020, 11:06:05 AM10/25/20
to NetBox

Getting the following error on my netbox docker-

<class 'redis.exceptions.ConnectionError'>
Error -2 connecting to redis:6379. Name does not resolve.Screenshot 2020-10-25 21.05.22.png

Jacob Mansfield

unread,
Oct 25, 2020, 2:12:41 PM10/25/20
to Hasan T. Emdad, NetBox
Are the connection details for your redis server set correctly in the Netbox configuration?


--
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/38dbf011-75b7-4e2b-9d4f-0a882f4f398cn%40googlegroups.com.

Hasan T. Emdad

unread,
Oct 26, 2020, 12:50:34 AM10/26/20
to Jacob Mansfield, NetBox
It was a live and production system until a reboot was needed. Ever since reboot, getting this error. There was no change in the environment (hosting) or the application end.
Is there a settings or configuration file where I should make some change now?

 


Markku Leiniö

unread,
Oct 26, 2020, 2:13:34 AM10/26/20
to NetBox
Hi, you didn't mention your NetBox version, but see REDIS in https://netbox.readthedocs.io/en/stable/configuration/required-settings/.

Also see /opt/netbox/netbox/netbox/configuration.example.py

Your configuration is in /opt/netbox/netbox/netbox/configuration.py. It is loaded only when netbox is restarted, so maybe someone had edited it without restarting earlier.

Markku

Hasan T. Emdad

unread,
Oct 26, 2020, 3:31:17 AM10/26/20
to Markku Leiniö, NetBox
Hi, 

Thanks for Helping out. However, the problem still remains. Checked the configuration file. Nothing unusual. Have mentioned that the system used for a production setup had invested hundreds of man hour :(

Version of Netbox is 2.8.6

Shared the Configuration file screenshot as attached. No CHANGES were made ever since installed some 4 months back and populated with data from netbox UI.

The machine hostname is 'netbox' and resolves to 127.0.0.1

TIA.



--
You received this message because you are subscribed to a topic in the Google Groups "NetBox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netbox-discuss/6sKx-aSv5jk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/cf3af0b9-5cdc-4acb-a2d4-619c7b525627o%40googlegroups.com.
Screenshot 2020-10-26 13.11.27.png

markku...@gmail.com

unread,
Oct 26, 2020, 6:37:22 AM10/26/20
to NetBox
Hi, did you check your REDIS configuration that it does not contain hostname "redis"? I mean, you don't show it fully in the screenshot.

Markku

Markku Leiniö

unread,
Oct 26, 2020, 10:24:10 AM10/26/20
to NetBox
Also, here is the documentation for REDIS configuration in 2.8.6: https://github.com/netbox-community/netbox/blob/v2.8.6/docs/configuration/required-settings.md

If you don't have a separate server running redis, then your hostname in REDIS configuration section should be "localhost" for both "tasks" and "caching".

Markku

Hasan T. Emdad

unread,
Oct 26, 2020, 1:02:10 PM10/26/20
to Markku Leiniö, NetBox
Still no luck. Sharing more screenshot values.
Nothing unusual it seems. Redis CLI or Redis log seems to be OK. 

Didn't find netbox error log path on docker edition. (/var/log/netbox.log is missing).


Hasan T. Emdad Rumi
Cell: +880.17.11673093 | Skype: h.t.emdad


Screenshot 2020-10-26 22.46.05.png
Screenshot 2020-10-26 22.59.05.png
Screenshot 2020-10-26 22.54.56.png
Screenshot 2020-10-26 22.45.39.png

markku...@gmail.com

unread,
Oct 26, 2020, 3:26:56 PM10/26/20
to NetBox
Sorry, I haven't run NetBox in Docker.

But I see in https://github.com/netbox-community/netbox-docker/blob/release/env/netbox.env that there is "REDIS_HOST=redis" that could explain your problem. Maybe someone more expert in running NetBox in Docker can help you further.

Markku
Reply all
Reply to author
Forward
0 new messages