NetBox error creating the DB schema #3266

Closed
opened 2025-12-29 18:27:15 +01:00 by adam · 2 comments
Owner

Originally created by @AfraduaR on GitHub (Feb 4, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.3

Steps to Reproduce

  1. Installing Netbox on ubuntu 18.04 LTS under virtualbox
  2. Modified configuration.py for ALLOWED_HOSTS =/ DATABASE = / SECRET_KEY =
  3. create DB schema: sudo python3 /opt/netbox/netbox/manage.py migrate

Expected Behavior

Creation of DB schema

Observed Behavior

alvaro@alvaro-VirtualBox:/opt/netbox/netbox$ sudo python3 /opt/netbox/netbox/manage.py migrate
[sudo] password for alvaro:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 539, in connect
sock = self._connect()
File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 596, in _connect
raise err
File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 584, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/netbox-2.7.3/netbox/extras/apps.py", line 23, in ready
rs.ping()
File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 1106, in ping
return self.execute_command('PING')
File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 836, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 1073, in get_connection
connection.connect()
File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 544, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/dist-packages/django/core/management/init.py", line 357, in execute
django.setup()
File "/usr/local/lib/python3.6/dist-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.6/dist-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/opt/netbox-2.7.3/netbox/extras/apps.py", line 26, in ready
"Unable to connect to the Redis database. Check that the Redis configuration has been defined in "
django.core.exceptions.ImproperlyConfigured: Unable to connect to the Redis database. Check that the Redis configuration has been defined in configuration.py.

Originally created by @AfraduaR on GitHub (Feb 4, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.9 <!-- Example: 3.6.9 --> * NetBox version: 2.7.3 <!-- Example: 2.7.3 --> <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. Installing Netbox on ubuntu 18.04 LTS under virtualbox 2. Modified configuration.py for ALLOWED_HOSTS =/ DATABASE = / SECRET_KEY = 3. create DB schema: sudo python3 /opt/netbox/netbox/manage.py migrate <!-- What did you expect to happen? --> ### Expected Behavior Creation of DB schema <!-- What happened instead? --> ### Observed Behavior alvaro@alvaro-VirtualBox:/opt/netbox/netbox$ sudo python3 /opt/netbox/netbox/manage.py migrate [sudo] password for alvaro: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 539, in connect sock = self._connect() File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 596, in _connect raise err File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 584, in _connect sock.connect(socket_address) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox-2.7.3/netbox/extras/apps.py", line 23, in ready rs.ping() File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 1106, in ping return self.execute_command('PING') File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 836, in execute_command conn = self.connection or pool.get_connection(command_name, **options) File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 1073, in get_connection connection.connect() File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 544, in connect raise ConnectionError(self._error_message(e)) redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 357, in execute django.setup() File "/usr/local/lib/python3.6/dist-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.6/dist-packages/django/apps/registry.py", line 122, in populate app_config.ready() File "/opt/netbox-2.7.3/netbox/extras/apps.py", line 26, in ready "Unable to connect to the Redis database. Check that the Redis configuration has been defined in " django.core.exceptions.ImproperlyConfigured: Unable to connect to the Redis database. Check that the Redis configuration has been defined in configuration.py.
adam closed this issue 2025-12-29 18:27:15 +01:00
Author
Owner

@hSaria commented on GitHub (Feb 4, 2020):

It appears you haven't configured the REDIS key appropriately. Questions like these are best suited for the mailing list; people are faster to answer them there.

@hSaria commented on GitHub (Feb 4, 2020): It appears you haven't configured the `REDIS` key appropriately. Questions like these are best suited for the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss); people are faster to answer them there.
Author
Owner

@jeremystretch commented on GitHub (Feb 4, 2020):

Yep, this is an installation error. Please post to the mailing list if you require any further assistance.

@jeremystretch commented on GitHub (Feb 4, 2020): Yep, this is an installation error. Please post to the mailing list if you require any further assistance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3266