Giter Site home page Giter Site logo

nautobot-docker-compose's Introduction

nautobot-docker-compose

Network to Code has an existing published Nautobot Docker Image on Docker Hub. See here. This project uses Docker Compose. The Docker compose file in this project pulls that Nautobot Docker image using the latest stable Nautobot release along with several other Docker images required for Nautobot to function. See the diagram below. This project is for those looking for a multi-container single-node install for Nautobot often coupled with backup & HA capabilities from their hypervisor manager.

Container Stack

By default, this project deploys the Nautobot application, a single worker container, Redis containers, and PostgreSQL. It does not deploy NGINX, SSL, or any Nautobot plugins. However, the project is extensible to allow users to tailor it to their specific requirements. For example, if you need to deploy SSL or plugins, see the docs linked. The web server used on the application is pyuwsgi.

Docker Compose

This documentation is now written assuming the latest Docker Compose methodology of using the Docker Compose Plugin instead of the independent docker-compose executable. See the Docker Compose Plugin installation notes

Why Poetry?

Poetry was chosen to replace both requirements.txt and setup.py. Poetry uses the pyproject.toml file to define package details, main package dependencies, development dependencies, and tool-related configurations. Poetry resolves dependencies and stores the hashes and metadata within the poetry.lock file (similar to performing a pip freeze > requirements.txt). The poetry.lock is what is used to provide consistency for package versions across the project to make sure anyone who is developing on it is using the same Python dependency versions. Poetry also provides virtual environments by simply being in the same directory as the pyproject.toml and poetry.lock files and executing the poetry shell command.

Why Invoke?

Invoke is a Python replacement for Make. Invoke looks for a tasks.py file that contains functions decorated by @task that provide the equivalents of Make targets.

The reason it was chosen over Makefile was due to our collective familiarity with Python and the ability to organize and re-use Invoke tasks across Cookiecutter templates. It also makes managing your Nautobot project vastly simpler by issuing simple commands instead of long command strings that can be confusing.

How to use this repo

This repo is designed to provide a custom build of Nautobot to include a set of plugins which can then be used in a development environment or deployed in production. Included in this repo is a skeleton Nautobot plugin which is designed only to provide a quick example of how a plugin could be developed. Plugins should ultimately be built as packages, published to a PyPI style repository and added to the poetry pyproject.toml in this repo. The plugin code should be hosted in their own repositories with their own CI pipelines and not included here.

Install Docker

Before beginning, install Docker and verify its operation by running docker run hello-world. If you encounter any issues connecting to the Docker service, check that your local user account is permitted to run Docker. Note: docker v1.10.0 or later is required.

Install Poetry

It is recommended to follow one of the installation methods detailed in their documentation. It's advised to install poetry as a system-level dependency and not inside a virtual environment. Once Poetry has been installed you can create the Poetry virtual environment with a few simple commands:

  1. poetry shell
  2. poetry lock
  3. poetry install

The last command, poetry install, will install all of the project dependencies for you to manage your Nautobot project. This includes installing the invoke Python project.

Build and start Nautobot

You can build, deploy and populate Nautobot with the following steps

  1. invoke build
  2. invoke start or invoke debug

The standard way of starting the containers is to use invoke start. If you wish to see the logs from the containers while running Nautobot use the invoke debug command. Be aware that exiting debug mode will stop all the containers.

Nautobot will be available on port 8080 locally http://localhost:8080

Cleanup Everything and start from scratch

  1. invoke destroy
  2. invoke build
  3. invoke db-import
  4. invoke start

The invoke db-import command will only work if you have a previous backup of your database.

Export current database

While the database is already running

  • invoke db-export

Docker Compose Files

Several Docker Compose files are provided as overrides to allow for various development configurations, these can be thought of as layers to Docker Compose, each Compose file is described below:

  • docker-compose.postgres.yml - Starts the prerequisite PostgreSQL service if using PostgreSQL as your database.
  • docker-compose.mysql.yml - Starts the prerequisite MySQL service if using MySQL as your database is desired.
  • docker-compose.base.yml - Defines the default Nautobot, Celery worker, Celery beats scheduler, and Redis services and how they should be run and built.
  • docker-compose.ldap.yml - Duplicate of docker-compose.base.yml file but points to LDAP-specific Dockerfile. This is done to make building an LDAP-supported installation easier.
  • docker-compose.local.yml - Defines how the Nautobot and Celery worker containers should run locally with port mappings and volume mounts. This is helpful as an example when you wish to create another instance, for example, a production instance, and you want to have the volume mounts and port mappings done differently.

Only docker-compose.postgres.yml or docker-compose.mysql.com should be used as they are mutually exclusive and providing the same database backend service.

Environment Files

Environment files (.env) are the standard way of providing configuration information or secrets in Docker containers. This project includes two example environment files that each serve a specific purpose:

  • local.example.env - The local environment file is intended to store all relevant configurations that are safe to be stored in git. This would typically be things like specifying the database user or whether debug is enabled or not. Do not store secrets, ie passwords or tokens, in this file!

  • creds.example.env - The creds environment file is intended to store all configuration information that you wish to keep out of git. The creds.env file is in .gitignore and thus will not be pushed to git by default. This is essential to keep passwords and tokens from being leaked accidentally.

To use the provided environment files it's suggested that you copy the file to the same name without the example keyword, ie:

cp environments/local.example.env environments/local.env
cp environments/creds.example.env environments/creds.env

CLI Helper Commands

The project comes with a CLI helper based on invoke to help manage the Nautobot environment. The commands are listed below in 2 categories environment and utility.

Each command can be executed with a simple invoke <command>. Each command also has its own help invoke <command> --help.

Manage Nautobot environment

  build            Build all docker images.
  debug            Start Nautobot and its dependencies in debug mode.
  destroy          Destroy all containers and volumes.
  start            Start Nautobot and its dependencies in detached mode.
  stop             Stop Nautobot and its dependencies.
  db-export        Export Database data to nautobot_backup.dump.
  db-import        Import test data.

Utility

  cli              Launch a bash shell inside the running Nautobot container.
  migrate          Run database migrations in Django.
  nbshell          Launch a nbshell session.

Getting Started

NOTE: Please be aware that you must be in the Poetry virtual environment before issuing any invoke commands. The steps to do this are detailed above.

  1. Have Docker installed on the host.
  2. Clone this repository to your Nautobot host into the current user directory.
git clone https://github.com/nautobot/nautobot-docker-compose.git
  1. Navigate to the new directory from the git clone.
cd nautobot-docker-compose
  1. Copy the local.env.example file to local.env and creds.example.env file to creds.env in the environments folder.
cp environments/local.example.env environments/local.env
cp environments/creds.example.env environments/creds.env
  1. Update the .env files for your environment. THESE SHOULD BE CHANGED for proper security and the creds.env file should never be synchronized to git as it should contain all secrets for the environment!
vi environments/local.env
vi environments/creds.env
  1. Update the local.env and creds.env files to be only available for the current user.
chmod 0600 environments/local.env environments/creds.env
  1. Copy the invoke.example.yml file to invoke.yml:
cp invoke.example.yml invoke.yml
  1. Run invoke build start to build the containers and start the environment.
invoke build start

NOTE - MySQL

If you want to use MySQL for the database instead of PostgreSQL, perform the below step in place for step #7 above:

cp invoke.mysql.yml invoke.yml

Getting Started - LDAP

The use of LDAP requires the installation of some additional libraries and some configuration in nautobot_config.py. See the LDAP documentation.

Getting Started - Plugins

The installation of plugins has a slightly more involved getting-started process. See the Plugin documentation.

Super User Account

Create Super User via Environment

The Docker container has a Docker entry point script that allows you to create a super user by the usage of Environment variables. This can be done by updating the creds.env file environment option of NAUTOBOT_CREATE_SUPERUSER to True. This will then use the information supplied to create the specified superuser.

Create Super User via Container

After the containers have started:

  1. Verify the containers are running:
docker container ls

Example Output:

❯ docker container ls
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS                   PORTS                                                                                  NAMES
143f10daa229   networktocode/nautobot:latest   "nautobot-server rqw…"   2 minutes ago   Up 2 minutes (healthy)                                                                                          nautobot-docker-compose_celery_worker_1
bb29124d7acb   networktocode/nautobot:latest   "/docker-entrypoint.…"   2 minutes ago   Up 2 minutes (healthy)   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp   nautobot-docker-compose_nautobot_1
ad57ac1749b3   redis:alpine                    "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes             6379/tcp                                                                               nautobot-docker-compose_redis_1
5ab83264e6fe   postgres:10                     "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes             5432/tcp                                                                               nautobot-docker-compose_postgres_1
  1. Execute Create Super User Command and follow the prompts
invoke createsuperuser

Example Prompts:

nautobot@bb29124d7acb:~$ invoke createsuperuser
Username: administrator
Email address:
Password:
Password (again):
Superuser created successfully.

nautobot-docker-compose's People

Contributors

adrydale avatar hokandil avatar jdrew82 avatar jvanderaa avatar lvrfrc87 avatar matt852 avatar nniehoff avatar ubajze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nautobot-docker-compose's Issues

There are significant differences between the various docker-compose files - inclusion of a separate celery beat service

Between the simple docker-compose.yml, the docker-compose.ldap.yml and the docker-compose.override.yml.example there are significant differences. For example the inclusion of a seperate celery beat service in docker-compose.yml which is not included in the other two. Also the dependencies for each service, and the test arguments for the celery worker.
Especially the need for inclusion of a separate celery beat service should be addressed and configuration settings should be reviewed. So that one common view/direction is produced for all cases (ldap/plugins/etc) for the docker-compose based nautobot deployment.

Postgress and Celery beat service produce errors in log during the first deployment (when no db exists already).

Postgress and Celery beat service produce errors in log during the first deployment (when no db exists already).
Postgress complains for some relations that don't exist at specific character locations, e.g. :

nautobot-docker-postgres-1         | 2022-09-05 00:02:28.816 EEST [83] ERROR:  relation "django_content_type" does not exist at character 106
nautobot-docker-postgres-1         | 2022-09-05 00:02:28.816 EEST [83] STATEMENT:  SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE (("django_content_type"."app_label" = 'extras' AND "django_content_type"."model" IN ('relationshipassociation', 'status', 'tag', 'dynamicgroup', 'configcontextschema', 'secret', 'secretsgroup')) OR ("django_content_type"."app_label" = 'dcim' AND "django_content_type"."model" IN ('consoleport', 'consoleserverport', 'powerport', 'poweroutlet', 'interface', 'frontport', 'rearport', 'devicebay', 'inventoryitem', 'manufacturer', 'devicetype', 'devicerole', 'platform', 'device', 'virtualchassis', 'cable', 'consoleporttemplate', 'consoleserverporttemplate', 'powerporttemplate', 'poweroutlettemplate', 'interfacetemplate', 'frontporttemplate', 'rearporttemplate', 'devicebaytemplate', 'locationtype', 'location', 'powerpanel', 'powerfeed', 'rackgroup', 'rackrole', 'rack', 'rackreservation', 'region', 'site')) OR ("django_content_type"."app_label" = 'circuits' AND "django_content_type"."model" IN ('providernetwork', 'provider', 'circuittype', 'circuit', 'circuittermination')) OR ("django_content_type"."app_label" = 'virtualization' AND "django_content_type"."model" IN ('clustertype', 'clustergroup', 'cluster', 'virtualmachine', 'vminterface')) OR ("django_content_type"."app_label" = 'ipam' AND "django_content_type"."model" IN ('vrf', 'routetarget', 'rir', 'aggregate', 'role', 'prefix', 'ipaddress', 'vlangroup', 'vlan', 'service')) OR ("django_content_type"."app_label" = 'tenancy' AND "django_content_type"."model" IN ('tenantgroup', 'tenant')))

Celery beat is producing python errors in the log, its quite possible that the two issues are connected.

nautobot-docker-celery_beat-1      | celery beat v5.2.7 (dawn-chorus) is starting.
nautobot-docker-nautobot-1         |   Applying extras.0001_initial_part_1... OK
nautobot-docker-nautobot-1         |   Applying tenancy.0001_initial... OK
nautobot-docker-nautobot-worker-1  | 00:02:34.526 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   Worker rq:worker:2143c5e82ac149eab2b7dbdb1d791d69: started, version 1.10.1
nautobot-docker-nautobot-worker-1  | 00:02:34.526 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   Subscribing to channel rq:pubsub:2143c5e82ac149eab2b7dbdb1d791d69
nautobot-docker-nautobot-worker-1  | 00:02:34.534 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   *** Listening on default, check_releases, custom_fields, webhooks...
nautobot-docker-nautobot-worker-1  | 00:02:34.536 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   Cleaning registries for queue: default
nautobot-docker-nautobot-worker-1  | 00:02:34.540 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   Cleaning registries for queue: check_releases
nautobot-docker-nautobot-worker-1  | 00:02:34.549 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   Cleaning registries for queue: custom_fields
nautobot-docker-nautobot-worker-1  | 00:02:34.554 INFO    rq.worker :
nautobot-docker-nautobot-worker-1  |   Cleaning registries for queue: webhooks
nautobot-docker-nautobot-1         |   Applying dcim.0001_initial_part_1... OK
nautobot-docker-nautobot-1         |   Applying dcim.0002_initial_part_2... OK
nautobot-docker-nautobot-1         |   Applying ipam.0001_initial_part_1... OK
nautobot-docker-celery_beat-1      | __    -    ... __   -        _
nautobot-docker-celery_beat-1      | LocalTime -> 2022-09-05 00:02:36
nautobot-docker-celery_beat-1      | Configuration ->
nautobot-docker-celery_beat-1      |     . broker -> redis://:**@redis:6379/0
nautobot-docker-celery_beat-1      |     . loader -> celery.loaders.app.AppLoader
nautobot-docker-celery_beat-1      |     . scheduler -> nautobot.core.celery.schedulers.NautobotDatabaseScheduler
nautobot-docker-celery_beat-1      |
nautobot-docker-celery_beat-1      |     . logfile -> [stderr]@%WARNING
nautobot-docker-celery_beat-1      |     . maxinterval -> 5.00 seconds (5s)
nautobot-docker-postgres-1         | 2022-09-05 00:02:36.356 EEST [86] ERROR:  relation "extras_scheduledjob" does not exist at character 746
nautobot-docker-postgres-1         | 2022-09-05 00:02:36.356 EEST [86] STATEMENT:  SELECT "extras_scheduledjob"."id", "extras_scheduledjob"."name", "extras_scheduledjob"."task", "extras_scheduledjob"."job_model_id", "extras_scheduledjob"."job_class", "extras_scheduledjob"."interval", "extras_scheduledjob"."args", "extras_scheduledjob"."kwargs", "extras_scheduledjob"."queue", "extras_scheduledjob"."one_off", "extras_scheduledjob"."start_time", "extras_scheduledjob"."enabled", "extras_scheduledjob"."last_run_at", "extras_scheduledjob"."total_run_count", "extras_scheduledjob"."date_changed", "extras_scheduledjob"."description", "extras_scheduledjob"."user_id", "extras_scheduledjob"."approved_by_user_id", "extras_scheduledjob"."approval_required", "extras_scheduledjob"."approved_at", "extras_scheduledjob"."crontab" FROM "extras_scheduledjob" WHERE ("extras_scheduledjob"."enabled" AND (("extras_scheduledjob"."approval_required" AND "extras_scheduledjob"."approved_at" IS NOT NULL) OR NOT "extras_scheduledjob"."approval_required"))
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,356: CRITICAL/MainProcess] beat raised exception <class 'django.db.utils.ProgrammingError'>: ProgrammingError('relation "extras_scheduledjob" does not exist\nLINE 1: ...pproved_at", "extras_scheduledjob"."crontab" FROM "extras_sc...\n                                                             ^\n')
nautobot-docker-celery_beat-1      | Traceback (most recent call last):
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
nautobot-docker-celery_beat-1      |     return self.cursor.execute(sql, params)
nautobot-docker-celery_beat-1      | psycopg2.errors.UndefinedTable: relation "extras_scheduledjob" does not exist
nautobot-docker-celery_beat-1      | LINE 1: ...pproved_at", "extras_scheduledjob"."crontab" FROM "extras_sc...
nautobot-docker-celery_beat-1      |                                                              ^
nautobot-docker-celery_beat-1      |
nautobot-docker-celery_beat-1      |
nautobot-docker-celery_beat-1      | The above exception was the direct cause of the following exception:
nautobot-docker-celery_beat-1      |
nautobot-docker-celery_beat-1      | Traceback (most recent call last):
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/celery/apps/beat.py", line 105, in start_scheduler
nautobot-docker-celery_beat-1      |     service.start()
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 636, in start
nautobot-docker-celery_beat-1      |     humanize_seconds(self.scheduler.max_interval))
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/kombu/utils/objects.py", line 30, in __get__
nautobot-docker-celery_beat-1      |     return super().__get__(instance, owner)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/functools.py", line 981, in __get__
nautobot-docker-celery_beat-1      |     val = self.func(instance)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 679, in scheduler
nautobot-docker-celery_beat-1      |     return self.get_scheduler()
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 670, in get_scheduler
nautobot-docker-celery_beat-1      |     return symbol_by_name(self.scheduler_cls, aliases=aliases)(
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 231, in __init__
nautobot-docker-celery_beat-1      |     Scheduler.__init__(self, *args, **kwargs)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 271, in __init__
nautobot-docker-celery_beat-1      |     self.setup_schedule()
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 239, in setup_schedule
nautobot-docker-celery_beat-1      |     self.install_default_entries(self.schedule)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 361, in schedule
nautobot-docker-celery_beat-1      |     self._schedule = self.all_as_schedule()
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 245, in all_as_schedule
nautobot-docker-celery_beat-1      |     for model in self.Model.objects.enabled():
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 280, in __iter__
nautobot-docker-celery_beat-1      |     self._fetch_all()
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/cacheops/query.py", line 281, in _fetch_all
nautobot-docker-celery_beat-1      |     self._result_cache = list(self._iterable_class(self))
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 51, in __iter__
nautobot-docker-celery_beat-1      |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
nautobot-docker-celery_beat-1      |     cursor.execute(sql, params)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/cacheops/transaction.py", line 97, in execute
nautobot-docker-celery_beat-1      |     result = self._no_monkey.execute(self, sql, params)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 66, in execute
nautobot-docker-celery_beat-1      |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
nautobot-docker-celery_beat-1      |     return executor(sql, params, many, context)
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in _execute
nautobot-docker-celery_beat-1      |     with self.db.wrap_database_errors:
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/utils.py", line 90, in __exit__
nautobot-docker-celery_beat-1      |     raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-celery_beat-1      |   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
nautobot-docker-celery_beat-1      |     return self.cursor.execute(sql, params)
nautobot-docker-celery_beat-1      | django.db.utils.ProgrammingError: relation "extras_scheduledjob" does not exist
nautobot-docker-celery_beat-1      | LINE 1: ...pproved_at", "extras_scheduledjob"."crontab" FROM "extras_sc...
nautobot-docker-celery_beat-1      |                                                              ^
nautobot-docker-celery_beat-1      |
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,379: WARNING/MainProcess] Traceback (most recent call last):
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,379: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,380: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,381: WARNING/MainProcess] return self.cursor.execute(sql, params)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,381: WARNING/MainProcess] psycopg2.errors
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,381: WARNING/MainProcess] .
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,387: WARNING/MainProcess] UndefinedTable
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,387: WARNING/MainProcess] :
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,387: WARNING/MainProcess] relation "extras_scheduledjob" does not exist
nautobot-docker-celery_beat-1      | LINE 1: ...pproved_at", "extras_scheduledjob"."crontab" FROM "extras_sc...
nautobot-docker-celery_beat-1      |                                                              ^
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,387: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | The above exception was the direct cause of the following exception:
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,388: WARNING/MainProcess] Traceback (most recent call last):
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,388: WARNING/MainProcess]   File "/usr/local/bin/nautobot-server", line 8, in <module>
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,389: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,389: WARNING/MainProcess] sys.exit(main())
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,390: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/nautobot/core/cli.py", line 54, in main
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,391: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,391: WARNING/MainProcess] run_app(
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,391: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/nautobot/core/runner/runner.py", line 266, in run_app
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,392: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,392: WARNING/MainProcess] management.execute_from_command_line([runner_name, command] + command_args)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,393: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,394: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,394: WARNING/MainProcess] utility.execute()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,395: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,396: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,396: WARNING/MainProcess] self.fetch_command(subcommand).run_from_argv(self.argv)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,396: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/nautobot/core/management/commands/celery.py", line 24, in run_from_argv
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,396: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,397: WARNING/MainProcess] celery_main.main()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,397: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,398: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,398: WARNING/MainProcess] rv = self.invoke(ctx)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,398: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,399: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,410: WARNING/MainProcess] return _process_result(sub_ctx.command.invoke(sub_ctx))
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,411: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,412: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,412: WARNING/MainProcess] return ctx.invoke(self.callback, **ctx.params)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,412: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,413: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,413: WARNING/MainProcess] return __callback(*args, **kwargs)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,413: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,414: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,414: WARNING/MainProcess] return f(get_current_context(), *args, **kwargs)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,414: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/bin/base.py", line 134, in caller
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,415: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,415: WARNING/MainProcess] return f(ctx, *args, **kwargs)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,416: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/bin/beat.py", line 72, in beat
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,416: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,417: WARNING/MainProcess] return beat().run()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,417: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/apps/beat.py", line 77, in run
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,417: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,417: WARNING/MainProcess] self.start_scheduler()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,418: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/apps/beat.py", line 105, in start_scheduler
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,418: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,419: WARNING/MainProcess] service.start()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,419: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 636, in start
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,423: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,423: WARNING/MainProcess] humanize_seconds(self.scheduler.max_interval))
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,423: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/kombu/utils/objects.py", line 30, in __get__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,424: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,424: WARNING/MainProcess] return super().__get__(instance, owner)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,424: WARNING/MainProcess]   File "/usr/local/lib/python3.10/functools.py", line 981, in __get__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,425: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,425: WARNING/MainProcess] val = self.func(instance)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,425: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 679, in scheduler
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,426: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,426: WARNING/MainProcess] return self.get_scheduler()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,426: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 670, in get_scheduler
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,442: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,443: WARNING/MainProcess] return symbol_by_name(self.scheduler_cls, aliases=aliases)(
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,443: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 231, in __init__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,443: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,444: WARNING/MainProcess] Scheduler.__init__(self, *args, **kwargs)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,444: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 271, in __init__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,444: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,444: WARNING/MainProcess] self.setup_schedule()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,444: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 239, in setup_schedule
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,446: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,446: WARNING/MainProcess] self.install_default_entries(self.schedule)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,447: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 361, in schedule
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,447: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,447: WARNING/MainProcess] self._schedule = self.all_as_schedule()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,448: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 245, in all_as_schedule
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,448: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,449: WARNING/MainProcess] for model in self.Model.objects.enabled():
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,449: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 280, in __iter__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,450: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,450: WARNING/MainProcess] self._fetch_all()
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,450: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/cacheops/query.py", line 281, in _fetch_all
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,451: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,451: WARNING/MainProcess] self._result_cache = list(self._iterable_class(self))
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,451: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 51, in __iter__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,452: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,452: WARNING/MainProcess] results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,452: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,453: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,453: WARNING/MainProcess] cursor.execute(sql, params)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,454: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/cacheops/transaction.py", line 97, in execute
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,454: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,454: WARNING/MainProcess] result = self._no_monkey.execute(self, sql, params)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,455: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 66, in execute
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,455: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,456: WARNING/MainProcess] return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,456: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,456: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,456: WARNING/MainProcess] return executor(sql, params, many, context)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,457: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in _execute
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,457: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,467: WARNING/MainProcess] with self.db.wrap_database_errors:
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,467: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/utils.py", line 90, in __exit__
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,468: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,468: WARNING/MainProcess] raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,468: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,469: WARNING/MainProcess]
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,469: WARNING/MainProcess] return self.cursor.execute(sql, params)
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,469: WARNING/MainProcess] django.db.utils
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,470: WARNING/MainProcess] .
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,470: WARNING/MainProcess] ProgrammingError
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,470: WARNING/MainProcess] :
nautobot-docker-celery_beat-1      | [2022-09-05 00:02:36,471: WARNING/MainProcess] relation "extras_scheduledjob" does not exist
nautobot-docker-celery_beat-1      | LINE 1: ...pproved_at", "extras_scheduledjob"."crontab" FROM "extras_sc...
nautobot-docker-celery_beat-1      |                                                              ^
nautobot-docker-nautobot-1         |   Applying extras.0002_initial_part_2... OK
nautobot-docker-celery_worker-1    |
nautobot-docker-celery_worker-1    |  -------------- celery@7f9b141e6f50 v5.2.7 (dawn-chorus)
nautobot-docker-celery_worker-1    | --- ***** -----
nautobot-docker-celery_worker-1    | -- ******* ---- Linux-5.15.0-47-generic-x86_64-with-glibc2.31 2022-09-05 00:02:37
nautobot-docker-celery_worker-1    | - *** --- * ---
nautobot-docker-celery_worker-1    | - ** ---------- [config]
nautobot-docker-celery_worker-1    | - ** ---------- .> app:         nautobot:0x7f4def263f10
nautobot-docker-celery_worker-1    | - ** ---------- .> transport:   redis://:**@redis:6379/0
nautobot-docker-celery_worker-1    | - ** ---------- .> results:     redis://:**@redis:6379/0
nautobot-docker-celery_worker-1    | - *** --- * --- .> concurrency: 2 (prefork)
nautobot-docker-celery_worker-1    | -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
nautobot-docker-celery_worker-1    | --- ***** -----
nautobot-docker-celery_worker-1    |  -------------- [queues]
nautobot-docker-celery_worker-1    |                 .> celery           exchange=celery(direct) key=celery
nautobot-docker-celery_worker-1    |
nautobot-docker-celery_worker-1    |
nautobot-docker-celery_beat-1 exited with code 1

None of those are repeated if the db exists already when creating the containers again (e.g. if we don't delete volumes between tests).

Changes with 2.X

It seems that now, after the 2.X release train is live buliding custom containers installs the latest version of nautobot and any plugins (apps) by default. This requires having to set versions manually in the requrements.txt file. Should this be using Poetry instead to manage these dependencies since that's our standard for other buildl environments?

This results in the Nautobot 2.X train being installed in the containers at build-time, even if NAUTOBOT_VERSION is set to a 1.X version.

This also breaks the database tables once the 2.X migrations run and a database backup is required to be restored.

This does not seem like desirable behavior to me.

docker compose up error

nautobot-docker-compose-main-nautobot-1 | Traceback (most recent call last):
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-main-nautobot-1 | self.connect()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
nautobot-docker-compose-main-nautobot-1 | return func(*args, **kwargs)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-main-nautobot-1 | self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
nautobot-docker-compose-main-nautobot-1 | return func(*args, **kwargs)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-main-nautobot-1 | connection = Database.connect(**conn_params)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/psycopg2/init.py", line 122, in connect
nautobot-docker-compose-main-nautobot-1 | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-main-nautobot-1 | psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known
nautobot-docker-compose-main-nautobot-1 |
nautobot-docker-compose-main-nautobot-1 |
nautobot-docker-compose-main-nautobot-1 | The above exception was the direct cause of the following exception:
nautobot-docker-compose-main-nautobot-1 |
nautobot-docker-compose-main-nautobot-1 | Traceback (most recent call last):
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/bin/nautobot-server", line 8, in
nautobot-docker-compose-main-nautobot-1 | sys.exit(main())
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/nautobot/core/cli.py", line 54, in main
nautobot-docker-compose-main-nautobot-1 | run_app(
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/nautobot/core/runner/runner.py", line 263, in run_app
nautobot-docker-compose-main-nautobot-1 | management.execute_from_command_line([runner_name, command] + command_args)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
nautobot-docker-compose-main-nautobot-1 | utility.execute()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/init.py", line 395, in execute
nautobot-docker-compose-main-nautobot-1 | django.setup()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/init.py", line 24, in setup
nautobot-docker-compose-main-nautobot-1 | apps.populate(settings.INSTALLED_APPS)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
nautobot-docker-compose-main-nautobot-1 | app_config.ready()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/nautobot/extras/apps.py", line 39, in ready
nautobot-docker-compose-main-nautobot-1 | wrap_model_clean_methods()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/nautobot/extras/plugins/validators.py", line 43, in wrap_model_clean_methods
nautobot-docker-compose-main-nautobot-1 | for model in ContentType.objects.filter(FeatureQuery("custom_validators").get_query()):
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 280, in iter
nautobot-docker-compose-main-nautobot-1 | self._fetch_all()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 271, in _fetch_all
nautobot-docker-compose-main-nautobot-1 | return self._no_monkey._fetch_all(self)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
nautobot-docker-compose-main-nautobot-1 | self._result_cache = list(self._iterable_class(self))
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 51, in iter
nautobot-docker-compose-main-nautobot-1 | results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
nautobot-docker-compose-main-nautobot-1 | cursor = self.connection.cursor()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
nautobot-docker-compose-main-nautobot-1 | return func(*args, **kwargs)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
nautobot-docker-compose-main-nautobot-1 | return self._cursor()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
nautobot-docker-compose-main-nautobot-1 | self.ensure_connection()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
nautobot-docker-compose-main-nautobot-1 | return func(*args, **kwargs)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-main-nautobot-1 | self.connect()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in exit
nautobot-docker-compose-main-nautobot-1 | raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-main-nautobot-1 | self.connect()
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
nautobot-docker-compose-main-nautobot-1 | return func(*args, **kwargs)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-main-nautobot-1 | self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
nautobot-docker-compose-main-nautobot-1 | return func(*args, **kwargs)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-main-nautobot-1 | connection = Database.connect(**conn_params)
nautobot-docker-compose-main-nautobot-1 | File "/usr/local/lib/python3.9/site-packages/psycopg2/init.py", line 122, in connect
nautobot-docker-compose-main-nautobot-1 | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-main-nautobot-1 | django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known
nautobot-docker-compose-main-nautobot-1 |
nautobot-docker-compose-main-nautobot-1 | ⏳ Waiting on DB... (3s / 30s)

Errors bringing up nautobot compose stack

I followed all the directions in this project. I have a plugin so I included all the steps required to build the image with the plugin module.
Image built fine.
When I bring up the compose stack I see a bunch of errors that are actually just 2 errors repeating and appearing from the various containers:

This one is related to a query made to the Postgres DB and it can be seen on the database and the two celery containers:

nautobot-docker-compose-db-1               | 2023-11-22 04:56:57.177 UTC [37] ERROR:  relation "extras_gitrepository" does not exist at character 417
nautobot-docker-compose-db-1               | 2023-11-22 04:56:57.177 UTC [37] STATEMENT:  SELECT "extras_gitrepository"."id", "extras_gitrepository"."created", "extras_gitrepository"."last_updated", "extras_gitrepository"."_custom_field_data", "extras_gitrepository"."name", "extras_gitrepository"."slug", "extras_gitrepository"."remote_url", "extras_gitrepository"."branch", "extras_gitrepository"."current_head", "extras_gitrepository"."secrets_group_id", "extras_gitrepository"."provided_contents" FROM "extras_gitrepository" ORDER BY "extras_gitrepository"."name" ASC
nautobot-docker-compose-celery_worker-1    | Traceback (most recent call last):
nautobot-docker-compose-celery_worker-1    |   File "/opt/nautobot/.local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
nautobot-docker-compose-celery_worker-1    |     return self.cursor.execute(sql, params)
nautobot-docker-compose-celery_worker-1    | psycopg2.errors.UndefinedTable: relation "extras_gitrepository" does not exist
nautobot-docker-compose-celery_worker-1    | LINE 1: ..., "extras_gitrepository"."provided_contents" FROM "extras_gi...
nautobot-docker-compose-celery_worker-1    |                                                              ^
nautobot-docker-compose-celery_worker-1    |

And this one appears on both nautobot containers:

usage: nautobot-server post_upgrade [-h] [--version] [-v {0,1,2,3}]
                                    [--settings SETTINGS]
                                    [--pythonpath PYTHONPATH] [--traceback]
                                    [--no-color] [--force-color]
                                    [--skip-checks] [--build-ui]
                                    [--no-clearsessions] [--no-collectstatic]
                                    [--no-remove-stale-contenttypes]
                                    [--no-migrate]
                                    [--no-trace-paths]
                                    [--no-send-installation-metrics]
                                    [--no-refresh-content-type-cache]
                                    [--no-refresh-dynamic-group-member-caches]
nautobot-server post_upgrade: error: unrecognized arguments: --no-invalidate-all
⏳ Waiting on DB... (27s / 30s)

thank you

Docker swarm

Trying to get the compose file to work on Docker Swarm but all containers exits with error code 137. Only Redis and Postgres container is working.

Poetry install stuck on install package "attrs"

Steps to reproduce:
Starting from 0 on a Debian machine

apt install python3 (i alreayd had it but i tried it anyway)
apt install python3-pip (python that comes with debian doesn't have pip included)
apt install pipx
pipx ensurepath
sudo pipx ensurepath
(close ssh session, reopen it)
pipx install poetry
git clone https://github.com/nautobot/nautobot-docker-compose.git
cd nautobot-docker-compose
(copy environments/local.env and environments/creds.env to /environments and edit them)
chmod 0600 environments/local.env environments/creds.env
cp invoke.example.yml invoke.yml
poetry shell
poetry lock
poetry install

What it does:

It installs 2 packages and after that it gets stuck on installing "attrs 23.2.0"
Tried to install it separately but it keeps saying package doesn't exist
image

Default docker-compose has issues authenticating database user nautobot

Environment: Docker in LXC on Proxmox 7.1-7

For some reason the default values are not working, nor any combination of altered values.

I followed everything laid out here:

https://github.com/nautobot/nautobot-docker-compose#getting-started

Initially I adjusted the values to suit a more secure environment, but then after issues I worked back to simple defaults:

 docker-compose up[+] Running 6/0
 ⠿ Container nautobot-docker-compose-redis-1            Created                                         0.0s
 ⠿ Container nautobot-docker-compose-postgres-1         Created                                         0.0s
 ⠿ Container nautobot-docker-compose-nautobot-1         Created                                         0.0s
 ⠿ Container nautobot-docker-compose-nautobot-worker-1  Created                                         0.0s
 ⠿ Container nautobot-docker-compose-celery_beat-1      Created                                         0.0s
 ⠿ Container nautobot-docker-compose-celery_worker-1    Created                                         0.0s
Attaching to nautobot-docker-compose-celery_beat-1, nautobot-docker-compose-celery_worker-1, nautobot-docker-compose-nautobot-1, nautobot-docker-compose-nautobot-worker-1, nautobot-docker-compose-postgres-1, nautobot-docker-compose-redis-1
nautobot-docker-compose-redis-1            | 1:C 08 Jan 2022 20:58:58.943 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
nautobot-docker-compose-redis-1            | 1:C 08 Jan 2022 20:58:58.943 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
nautobot-docker-compose-redis-1            | 1:C 08 Jan 2022 20:58:58.943 # Configuration loaded
nautobot-docker-compose-redis-1            | 1:M 08 Jan 2022 20:58:58.943 * monotonic clock: POSIX clock_gettime
nautobot-docker-compose-redis-1            | 1:M 08 Jan 2022 20:58:58.944 * Running mode=standalone, port=6379.
nautobot-docker-compose-redis-1            | 1:M 08 Jan 2022 20:58:58.944 # Server initialized
nautobot-docker-compose-redis-1            | 1:M 08 Jan 2022 20:58:58.944 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
nautobot-docker-compose-redis-1            | 1:M 08 Jan 2022 20:58:58.944 * Ready to accept connections
nautobot-docker-compose-postgres-1         | 
nautobot-docker-compose-postgres-1         | PostgreSQL Database directory appears to contain a database; Skipping initialization
nautobot-docker-compose-postgres-1         | 
nautobot-docker-compose-postgres-1         | 2022-01-08 20:58:59.119 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
nautobot-docker-compose-postgres-1         | 2022-01-08 20:58:59.119 UTC [1] LOG:  listening on IPv6 address "::", port 5432
nautobot-docker-compose-postgres-1         | 2022-01-08 20:58:59.121 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
nautobot-docker-compose-postgres-1         | 2022-01-08 20:58:59.130 UTC [25] LOG:  database system was shut down at 2022-01-08 20:58:17 UTC
nautobot-docker-compose-postgres-1         | 2022-01-08 20:58:59.133 UTC [1] LOG:  database system is ready to accept connections
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:00.610 UTC [32] FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:00.610 UTC [32] DETAIL:  Role "nautobot" does not exist.
nautobot-docker-compose-postgres-1         |    Connection matched pg_hba.conf line 95: "host all all all md5"
nautobot-docker-compose-nautobot-1         | Traceback (most recent call last):
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-nautobot-1         |     self.connect()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-1         |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-nautobot-1         |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-1         |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-nautobot-1         |     connection = Database.connect(**conn_params)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-nautobot-1         |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-nautobot-1         | psycopg2.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-nautobot-1         | 
nautobot-docker-compose-nautobot-1         | 
nautobot-docker-compose-nautobot-1         | The above exception was the direct cause of the following exception:
nautobot-docker-compose-nautobot-1         | 
nautobot-docker-compose-nautobot-1         | Traceback (most recent call last):
nautobot-docker-compose-nautobot-1         |   File "/usr/local/bin/nautobot-server", line 8, in <module>
nautobot-docker-compose-nautobot-1         |     sys.exit(main())
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/cli.py", line 54, in main
nautobot-docker-compose-nautobot-1         |     run_app(
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/runner/runner.py", line 266, in run_app
nautobot-docker-compose-nautobot-1         |     management.execute_from_command_line([runner_name, command] + command_args)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
nautobot-docker-compose-nautobot-1         |     utility.execute()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute
nautobot-docker-compose-nautobot-1         |     django.setup()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
nautobot-docker-compose-nautobot-1         |     apps.populate(settings.INSTALLED_APPS)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
nautobot-docker-compose-nautobot-1         |     app_config.ready()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/apps.py", line 34, in ready
nautobot-docker-compose-nautobot-1         |     wrap_model_clean_methods()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/plugins/validators.py", line 43, in wrap_model_clean_methods
nautobot-docker-compose-nautobot-1         |     for model in ContentType.objects.filter(FeatureQuery("custom_validators").get_query()):
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 287, in __iter__
nautobot-docker-compose-nautobot-1         |     self._fetch_all()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 273, in _fetch_all
nautobot-docker-compose-nautobot-1         |     return self._no_monkey._fetch_all(self)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1308, in _fetch_all
nautobot-docker-compose-nautobot-1         |     self._result_cache = list(self._iterable_class(self))
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 53, in __iter__
nautobot-docker-compose-nautobot-1         |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql
nautobot-docker-compose-nautobot-1         |     cursor = self.connection.cursor()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-1         |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
nautobot-docker-compose-nautobot-1         |     return self._cursor()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
nautobot-docker-compose-nautobot-1         |     self.ensure_connection()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-1         |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-nautobot-1         |     self.connect()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
nautobot-docker-compose-nautobot-1         |     raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-nautobot-1         |     self.connect()
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-1         |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-nautobot-1         |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-1         |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-nautobot-1         |     connection = Database.connect(**conn_params)
nautobot-docker-compose-nautobot-1         |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-nautobot-1         |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-nautobot-1         | django.db.utils.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-nautobot-1         | 
nautobot-docker-compose-nautobot-1         | ⏳ Waiting on DB... (0s / 30s)
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:02.482 UTC [33] FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:02.482 UTC [33] DETAIL:  Role "nautobot" does not exist.
nautobot-docker-compose-postgres-1         |    Connection matched pg_hba.conf line 95: "host all all all md5"
nautobot-docker-compose-celery_beat-1      | Traceback (most recent call last):
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-celery_beat-1      |     self.connect()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_beat-1      |     return func(*args, **kwargs)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-celery_beat-1      |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_beat-1      |     return func(*args, **kwargs)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-celery_beat-1      |     connection = Database.connect(**conn_params)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-celery_beat-1      |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-celery_beat-1      | psycopg2.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-celery_beat-1      | 
nautobot-docker-compose-celery_beat-1      | 
nautobot-docker-compose-celery_beat-1      | The above exception was the direct cause of the following exception:
nautobot-docker-compose-celery_beat-1      | 
nautobot-docker-compose-celery_beat-1      | Traceback (most recent call last):
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/bin/nautobot-server", line 8, in <module>
nautobot-docker-compose-celery_beat-1      |     sys.exit(main())
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/cli.py", line 54, in main
nautobot-docker-compose-celery_beat-1      |     run_app(
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/runner/runner.py", line 266, in run_app
nautobot-docker-compose-celery_beat-1      |     management.execute_from_command_line([runner_name, command] + command_args)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
nautobot-docker-compose-celery_beat-1      |     utility.execute()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute
nautobot-docker-compose-celery_beat-1      |     django.setup()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
nautobot-docker-compose-celery_beat-1      |     apps.populate(settings.INSTALLED_APPS)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
nautobot-docker-compose-celery_beat-1      |     app_config.ready()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/apps.py", line 34, in ready
nautobot-docker-compose-celery_beat-1      |     wrap_model_clean_methods()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/plugins/validators.py", line 43, in wrap_model_clean_methods
nautobot-docker-compose-celery_beat-1      |     for model in ContentType.objects.filter(FeatureQuery("custom_validators").get_query()):
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 287, in __iter__
nautobot-docker-compose-celery_beat-1      |     self._fetch_all()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 273, in _fetch_all
nautobot-docker-compose-celery_beat-1      |     return self._no_monkey._fetch_all(self)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1308, in _fetch_all
nautobot-docker-compose-celery_beat-1      |     self._result_cache = list(self._iterable_class(self))
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 53, in __iter__
nautobot-docker-compose-celery_beat-1      |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql
nautobot-docker-compose-celery_beat-1      |     cursor = self.connection.cursor()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_beat-1      |     return func(*args, **kwargs)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
nautobot-docker-compose-celery_beat-1      |     return self._cursor()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
nautobot-docker-compose-celery_beat-1      |     self.ensure_connection()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_beat-1      |     return func(*args, **kwargs)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-celery_beat-1      |     self.connect()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
nautobot-docker-compose-celery_beat-1      |     raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-celery_beat-1      |     self.connect()
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_beat-1      |     return func(*args, **kwargs)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-celery_beat-1      |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_beat-1      |     return func(*args, **kwargs)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-celery_beat-1      |     connection = Database.connect(**conn_params)
nautobot-docker-compose-celery_beat-1      |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-celery_beat-1      |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-celery_beat-1      | django.db.utils.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-celery_beat-1      | 
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:02.529 UTC [34] FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:02.529 UTC [34] DETAIL:  Role "nautobot" does not exist.
nautobot-docker-compose-postgres-1         |    Connection matched pg_hba.conf line 95: "host all all all md5"
nautobot-docker-compose-nautobot-worker-1  | Traceback (most recent call last):
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-nautobot-worker-1  |     self.connect()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-worker-1  |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-nautobot-worker-1  |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-worker-1  |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-nautobot-worker-1  |     connection = Database.connect(**conn_params)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-nautobot-worker-1  |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-nautobot-worker-1  | psycopg2.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-nautobot-worker-1  | 
nautobot-docker-compose-nautobot-worker-1  | 
nautobot-docker-compose-nautobot-worker-1  | The above exception was the direct cause of the following exception:
nautobot-docker-compose-nautobot-worker-1  | 
nautobot-docker-compose-nautobot-worker-1  | Traceback (most recent call last):
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/bin/nautobot-server", line 8, in <module>
nautobot-docker-compose-nautobot-worker-1  |     sys.exit(main())
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/cli.py", line 54, in main
nautobot-docker-compose-nautobot-worker-1  |     run_app(
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/runner/runner.py", line 266, in run_app
nautobot-docker-compose-nautobot-worker-1  |     management.execute_from_command_line([runner_name, command] + command_args)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
nautobot-docker-compose-nautobot-worker-1  |     utility.execute()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute
nautobot-docker-compose-nautobot-worker-1  |     django.setup()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
nautobot-docker-compose-nautobot-worker-1  |     apps.populate(settings.INSTALLED_APPS)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
nautobot-docker-compose-nautobot-worker-1  |     app_config.ready()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/apps.py", line 34, in ready
nautobot-docker-compose-nautobot-worker-1  |     wrap_model_clean_methods()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/plugins/validators.py", line 43, in wrap_model_clean_methods
nautobot-docker-compose-nautobot-worker-1  |     for model in ContentType.objects.filter(FeatureQuery("custom_validators").get_query()):
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 287, in __iter__
nautobot-docker-compose-nautobot-worker-1  |     self._fetch_all()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 273, in _fetch_all
nautobot-docker-compose-nautobot-worker-1  |     return self._no_monkey._fetch_all(self)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1308, in _fetch_all
nautobot-docker-compose-nautobot-worker-1  |     self._result_cache = list(self._iterable_class(self))
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 53, in __iter__
nautobot-docker-compose-nautobot-worker-1  |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql
nautobot-docker-compose-nautobot-worker-1  |     cursor = self.connection.cursor()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-worker-1  |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
nautobot-docker-compose-nautobot-worker-1  |     return self._cursor()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
nautobot-docker-compose-nautobot-worker-1  |     self.ensure_connection()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-worker-1  |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-nautobot-worker-1  |     self.connect()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
nautobot-docker-compose-nautobot-worker-1  |     raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-nautobot-worker-1  |     self.connect()
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-worker-1  |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-nautobot-worker-1  |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-nautobot-worker-1  |     return func(*args, **kwargs)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-nautobot-worker-1  |     connection = Database.connect(**conn_params)
nautobot-docker-compose-nautobot-worker-1  |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-nautobot-worker-1  |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-nautobot-worker-1  | django.db.utils.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-nautobot-worker-1  | 
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:02.916 UTC [35] FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-postgres-1         | 2022-01-08 20:59:02.916 UTC [35] DETAIL:  Role "nautobot" does not exist.
nautobot-docker-compose-postgres-1         |    Connection matched pg_hba.conf line 95: "host all all all md5"
nautobot-docker-compose-celery_worker-1    | Traceback (most recent call last):
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-celery_worker-1    |     self.connect()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_worker-1    |     return func(*args, **kwargs)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-celery_worker-1    |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_worker-1    |     return func(*args, **kwargs)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-celery_worker-1    |     connection = Database.connect(**conn_params)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-celery_worker-1    |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-celery_worker-1    | psycopg2.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-celery_worker-1    | 
nautobot-docker-compose-celery_worker-1    | 
nautobot-docker-compose-celery_worker-1    | The above exception was the direct cause of the following exception:
nautobot-docker-compose-celery_worker-1    | 
nautobot-docker-compose-celery_worker-1    | Traceback (most recent call last):
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/bin/nautobot-server", line 8, in <module>
nautobot-docker-compose-celery_worker-1    |     sys.exit(main())
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/cli.py", line 54, in main
nautobot-docker-compose-celery_worker-1    |     run_app(
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/nautobot/core/runner/runner.py", line 266, in run_app
nautobot-docker-compose-celery_worker-1    |     management.execute_from_command_line([runner_name, command] + command_args)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
nautobot-docker-compose-celery_worker-1    |     utility.execute()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute
nautobot-docker-compose-celery_worker-1    |     django.setup()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
nautobot-docker-compose-celery_worker-1    |     apps.populate(settings.INSTALLED_APPS)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
nautobot-docker-compose-celery_worker-1    |     app_config.ready()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/apps.py", line 34, in ready
nautobot-docker-compose-celery_worker-1    |     wrap_model_clean_methods()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/nautobot/extras/plugins/validators.py", line 43, in wrap_model_clean_methods
nautobot-docker-compose-celery_worker-1    |     for model in ContentType.objects.filter(FeatureQuery("custom_validators").get_query()):
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 287, in __iter__
nautobot-docker-compose-celery_worker-1    |     self._fetch_all()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 273, in _fetch_all
nautobot-docker-compose-celery_worker-1    |     return self._no_monkey._fetch_all(self)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1308, in _fetch_all
nautobot-docker-compose-celery_worker-1    |     self._result_cache = list(self._iterable_class(self))
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 53, in __iter__
nautobot-docker-compose-celery_worker-1    |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql
nautobot-docker-compose-celery_worker-1    |     cursor = self.connection.cursor()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_worker-1    |     return func(*args, **kwargs)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
nautobot-docker-compose-celery_worker-1    |     return self._cursor()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
nautobot-docker-compose-celery_worker-1    |     self.ensure_connection()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_worker-1    |     return func(*args, **kwargs)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-celery_worker-1    |     self.connect()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
nautobot-docker-compose-celery_worker-1    |     raise dj_exc_value.with_traceback(traceback) from exc_value
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
nautobot-docker-compose-celery_worker-1    |     self.connect()
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_worker-1    |     return func(*args, **kwargs)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
nautobot-docker-compose-celery_worker-1    |     self.connection = self.get_new_connection(conn_params)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
nautobot-docker-compose-celery_worker-1    |     return func(*args, **kwargs)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
nautobot-docker-compose-celery_worker-1    |     connection = Database.connect(**conn_params)
nautobot-docker-compose-celery_worker-1    |   File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
nautobot-docker-compose-celery_worker-1    |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
nautobot-docker-compose-celery_worker-1    | django.db.utils.OperationalError: FATAL:  password authentication failed for user "nautobot"
nautobot-docker-compose-celery_worker-1    | 
nautobot-docker-compose-nautobot-worker-1 exited with code 1
nautobot-docker-compose-celery_beat-1 exited with code 1
nautobot-docker-compose-celery_worker-1 exited with code 1

Uploaded images do not persist across restarts

If you stop and restart nautobot instance, you cannot view the uploaded images

Way to reproduce

  • Start nautobot using docker-compose
  • Upload an image to a site
  • Restart nautobot
  • Notice the previously uploaded files are missing

Explanation

If I understand correctly this happens because the uploaded images are stored in the file system within the container and the filesystem is purged when the container stops

Proposed Fix

Mount a volume from the host system to store uploaded files

docker.compose never ends

I have followed the description and I can get the UI etc.

But the "docker-compose up" command never ends, I stops:

root@nautobot01:/opt/nautobot/nautobot-docker-compose# docker-compose up Starting nautobot-docker-compose_nautobot_1 ... done Starting nautobot-docker-compose_db_1 ... done Starting nautobot-docker-compose_redis_1 ... done Starting nautobot-docker-compose_celery_worker_1 ... done Starting nautobot-docker-compose_celery_beat_1 ... done Attaching to nautobot-docker-compose_db_1, nautobot-docker-compose_nautobot_1, nautobot-docker-compose_redis_1, nautobot-docker-compose_celery_worker_1, nautobot-docker-compose_celery_beat_1 db_1 | db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db_1 | db_1 | 2023-12-14 12:39:02.781 UTC [1] LOG: starting PostgreSQL 13.13 (Debian 13.13-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit db_1 | 2023-12-14 12:39:02.781 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1 | 2023-12-14 12:39:02.781 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1 | 2023-12-14 12:39:02.787 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2023-12-14 12:39:02.795 UTC [26] LOG: database system was shut down at 2023-12-14 12:38:56 UTC db_1 | 2023-12-14 12:39:02.803 UTC [1] LOG: database system is ready to accept connections redis_1 | 1:C 14 Dec 2023 12:39:02.825 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis_1 | 1:C 14 Dec 2023 12:39:02.825 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis_1 | 1:C 14 Dec 2023 12:39:02.825 * Redis version=7.2.3, bits=64, commit=00000000, modified=0, pid=1, just started redis_1 | 1:C 14 Dec 2023 12:39:02.825 * Configuration loaded redis_1 | 1:M 14 Dec 2023 12:39:02.825 * monotonic clock: POSIX clock_gettime redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Running mode=standalone, port=6379. redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Server initialized redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Reading RDB base file on AOF loading... redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Loading RDB produced by version 7.2.3 redis_1 | 1:M 14 Dec 2023 12:39:02.826 * RDB age 470 seconds redis_1 | 1:M 14 Dec 2023 12:39:02.826 * RDB memory usage when created 0.83 Mb redis_1 | 1:M 14 Dec 2023 12:39:02.826 * RDB is base AOF redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Done loading RDB, keys loaded: 0, keys expired: 0. redis_1 | 1:M 14 Dec 2023 12:39:02.826 * DB loaded from base file appendonly.aof.1.base.rdb: 0.000 seconds redis_1 | 1:M 14 Dec 2023 12:39:02.826 * DB loaded from incr file appendonly.aof.1.incr.aof: 0.000 seconds redis_1 | 1:M 14 Dec 2023 12:39:02.826 * DB loaded from append only file: 0.000 seconds redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Opening AOF incr file appendonly.aof.1.incr.aof on server start redis_1 | 1:M 14 Dec 2023 12:39:02.826 * Ready to accept connections tcp nautobot_1 | Performing database migrations... nautobot_1 | Operations to perform: nautobot_1 | Apply all migrations: admin, auth, circuits, contenttypes, database, dcim, django_celery_beat, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization nautobot_1 | Running migrations: nautobot_1 | No migrations to apply. celery_beat_1 | celery beat v5.2.7 (dawn-chorus) is starting. nautobot_1 | nautobot_1 | Generating cable paths... nautobot_1 | Found no missing circuit termination paths; skipping nautobot_1 | Found no missing console port paths; skipping nautobot_1 | Found no missing console server port paths; skipping nautobot_1 | Found no missing interface paths; skipping nautobot_1 | Found no missing power feed paths; skipping nautobot_1 | Found no missing power outlet paths; skipping nautobot_1 | Found no missing power port paths; skipping nautobot_1 | Finished. nautobot_1 | nautobot_1 | Collecting static files... celery_worker_1 | celery_worker_1 | -------------- celery@2c9d9ae6e123 v5.2.7 (dawn-chorus) celery_worker_1 | --- ***** ----- celery_worker_1 | -- ******* ---- Linux-5.15.0-25-generic-x86_64-with-glibc2.31 2023-12-14 12:39:10 celery_worker_1 | - *** --- * --- celery_worker_1 | - ** ---------- [config] celery_worker_1 | - ** ---------- .> app: nautobot:0x7f6e161d0610 celery_worker_1 | - ** ---------- .> transport: redis://:**@redis:6379/0 celery_worker_1 | - ** ---------- .> results: redis://:**@redis:6379/0 celery_worker_1 | - *** --- * --- .> concurrency: 2 (prefork) celery_worker_1 | -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker) celery_worker_1 | --- ***** ----- celery_worker_1 | -------------- [queues] celery_worker_1 | .> default exchange=default(direct) key=default celery_worker_1 | celery_worker_1 | nautobot_1 | nautobot_1 | 0 static files copied to '/opt/nautobot/static', 720 unmodified. nautobot_1 | nautobot_1 | Removing stale content types... nautobot_1 | nautobot_1 | Removing expired sessions... nautobot_1 | celery_beat_1 | __ - ... __ - _ celery_beat_1 | LocalTime -> 2023-12-14 12:39:10 celery_beat_1 | Configuration -> celery_beat_1 | . broker -> redis://:**@redis:6379/0 celery_beat_1 | . loader -> celery.loaders.app.AppLoader celery_beat_1 | . scheduler -> nautobot.core.celery.schedulers.NautobotDatabaseScheduler celery_beat_1 | celery_beat_1 | . logfile -> [stderr]@%WARNING celery_beat_1 | . maxinterval -> 5.00 seconds (5s) nautobot_1 | ⏳ Running initial systems check... nautobot_1 | System check identified some issues: nautobot_1 | nautobot_1 | WARNINGS: nautobot_1 | ?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems. nautobot_1 | ?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS. nautobot_1 | ?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions. nautobot_1 | ?: (security.W016) You have 'django.middleware.csrf.CsrfViewMiddleware' in your MIDDLEWARE, but you have not set CSRF_COOKIE_SECURE to True. Using a secure-only CSRF cookie makes it more difficult for network traffic sniffers to steal the CSRF token. nautobot_1 | nautobot_1 | System check identified 4 issues (0 silenced). nautobot_1 | 💡 Superuser Username: admin, E-Mail: [email protected] nautobot_1 | [uWSGI] getting INI configuration from /opt/nautobot/uwsgi.ini nautobot_1 | [uwsgi-static] added mapping for /static => /opt/nautobot/static nautobot_1 | *** Starting uWSGI 2.0.21 (64bit) on [Thu Dec 14 12:39:31 2023] *** nautobot_1 | compiled with version: 10.2.1 20210110 on 20 February 2023 06:12:35 nautobot_1 | os: Linux-5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 nautobot_1 | nodename: 6589ea9ea190 nautobot_1 | machine: x86_64 nautobot_1 | clock source: unix nautobot_1 | detected number of CPU cores: 2 nautobot_1 | current working directory: /opt/nautobot nautobot_1 | detected binary path: /usr/local/bin/python3.9 nautobot_1 | !!! no internal routing support, rebuild with pcre support !!! nautobot_1 | your memory page size is 4096 bytes nautobot_1 | detected max file descriptor number: 1048576 nautobot_1 | building mime-types dictionary from file /etc/mime.types...1476 entry found nautobot_1 | lock engine: pthread robust mutexes nautobot_1 | thunder lock: disabled (you can enable it with --thunder-lock) nautobot_1 | uWSGI http bound on 0.0.0.0:8080 fd 10 nautobot_1 | uWSGI http bound on 0.0.0.0:8443 fd 11 nautobot_1 | uwsgi socket 0 bound to TCP address 127.0.0.1:34903 (port auto-assigned) fd 9 nautobot_1 | Python version: 3.9.16 (main, Feb 9 2023, 05:40:23) [GCC 10.2.1 20210110] nautobot_1 | --- Python VM already initialized --- nautobot_1 | Python main interpreter initialized at 0x56152133cb90 nautobot_1 | python threads support enabled nautobot_1 | your server socket listen backlog is limited to 128 connections nautobot_1 | your mercy for graceful operations on workers is 60 seconds nautobot_1 | mapped 291680 bytes (284 KB) for 3 cores nautobot_1 | *** Operational MODE: preforking *** nautobot_1 | 12:39:31.136 INFO nautobot : nautobot_1 | Nautobot initialized! nautobot_1 | WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x56152133cb90 pid: 1 (default app) nautobot_1 | spawned uWSGI master process (pid: 1) nautobot_1 | spawned uWSGI worker 1 (pid: 79, cores: 1) nautobot_1 | spawned uWSGI worker 2 (pid: 80, cores: 1) nautobot_1 | spawned uWSGI worker 3 (pid: 81, cores: 1) nautobot_1 | 12:39:31.164 INFO nautobot.core.wsgi : nautobot_1 | Closing existing DB and cache connections on worker 1 after uWSGI forked ... nautobot_1 | 12:39:31.169 INFO nautobot.core.wsgi : nautobot_1 | Closing existing DB and cache connections on worker 2 after uWSGI forked ... nautobot_1 | spawned uWSGI http 1 (pid: 82) nautobot_1 | 12:39:31.176 INFO nautobot.core.wsgi : nautobot_1 | Closing existing DB and cache connections on worker 3 after uWSGI forked ...

If I break it, the system (of cause) dies.

NAUTOBOT_CACHEOPS_REDIS error in example files

in https://github.com/nautobot/nautobot-docker-compose/blob/main/local.env.example row 24:
NAUTOBOT_CACHEOPS_REDIS=redis://:decinablesprewad@redis:6379/1

There is an extra : in there after redis://

Same thing in https://github.com/nautobot/nautobot-docker-compose/blob/main/config/nautobot_config.py.ldap row 61.
CACHEOPS_REDIS = os.getenv("NAUTOBOT_CACHEOPS_REDIS", f"{redis_protocol}://:{cache_ops_pwd}@{cache_ops_host}:{cache_ops_port}/1")

This caused al sorts of weird behavior in my deployment, after I removed the redundant semi colon it all worked smooth.

Adding dependency "nautobot[napalm]" breaks Invoke's image URL generation

I was trying to enable Napalm functionality on our Nautobot instance, using the instructions from Nautobot Documentation -> User Guide -> Administration -> Installation -> Installing Nautobot. In the context of the new poetry + Invoke setup, that just means doing the following:

poetry add nautobot[napalm]@2.1.1

That results in the following being changed in pyproject.toml:

- nautobot = "2.1.1"
+ nautobot = {version = "2.1.1", extras = ["napalm"]}

When running any Invoke command, the following lines get run:

with open("pyproject.toml", "r", encoding="utf8") as pyproject:
parsed_toml = toml.load(pyproject)
NAUTOBOT_VERSION = parsed_toml["tool"]["poetry"]["dependencies"]["nautobot"]

Which evaluates like so:

>>> parsed_toml["tool"]["poetry"]["dependencies"]["nautobot"]
{'version': '2.1.1', 'extras': ['napalm']}

...when, instead, the logic is intended to parse just the version string for the Nautobot dependency.

Later, when trying to synthesize the URL for the required Docker image, the following exception happens:

...

  File "/srv/docker-compose/nautobot-docker-compose-v2.0.0/tasks.py", line 90, in docker_compose
    return context.run(compose_command, env=compose_env, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/nautobot-docker-compose-ENx6_Wnd-py3.11/lib/python3.11/site-packages/invoke/context.py", line 104, in run
    return self._run(runner, command, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/nautobot-docker-compose-ENx6_Wnd-py3.11/lib/python3.11/site-packages/invoke/context.py", line 113, in _run
    return runner.run(command, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/nautobot-docker-compose-ENx6_Wnd-py3.11/lib/python3.11/site-packages/invoke/runners.py", line 395, in run
    return self._run_body(command, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/nautobot-docker-compose-ENx6_Wnd-py3.11/lib/python3.11/site-packages/invoke/runners.py", line 440, in _run_body
    self.start(command, self.opts["shell"], self.env)
  File "/root/.cache/pypoetry/virtualenvs/nautobot-docker-compose-ENx6_Wnd-py3.11/lib/python3.11/site-packages/invoke/runners.py", line 1337, in start
    self.process = Popen(
                   ^^^^^^
  File "/usr/lib64/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.11/subprocess.py", line 1870, in _execute_child
    env_list.append(k + b'=' + os.fsencode(v))
                               ^^^^^^^^^^^^^^
  File "<frozen os>", line 812, in fsencode
TypeError: expected str, bytes or os.PathLike object, not DynamicInlineTableDict

Update LDAP Docs

I believe the LDAP requirements are baked in to the Nautobot container now, worth a double check but could reduce the code here.

Don't reference MariaDB in Mysql example

Since Nautobot does not officially support MariaDB, we should not recommend it in the nautobot-docker-compose/docker-compose.mysql.yaml file.

    Although we cannot officially support MariaDB at this time, we did do a little research to address this issue for you.

I confirmed that if you explicitly pip install django-mptt==0.11.0 for your Nautobot installation, that this issue is alleviated. Note, however, that pip will complain about the version conflict with Nautobot's requirements, but it's just a warning that can be safely ignored in this case.

Since there are no other dependencies or conflicts with django-mptt, this should be fine for now in your deployment. Also, we do plan to get rid of this library in our v2.0.0 release, so this issue will also no longer be a concern.

I'll be closing this issue. Thanks for reporting it!

Originally posted by @jathanism in nautobot/nautobot#1724 (comment)

nautobot-server post_upgrade: error: unrecognized arguments: --no-invalidate-all

Hi Admin,

I have been running nautobot using docker which was working fine until I recently tried to install a new plugin and then perform a post_upgrade but it is failing due to the below error which I think is similar to the one mentioned here nautobot/nautobot#4555 . Can you please assist on how to resolve this issue as my Nautobot is currently down

nautobot_1 | [--no-refresh-content-type-cache]
nautobot_1 | [--no-refresh-dynamic-group-member-caches]
nautobot_1 | nautobot-server post_upgrade: error: unrecognized arguments: --no-invalidate-all
nautobot_1 | ⏳ Waiting on DB... (3s / 30s)
nautobot-worker_1 | Grafana ChatOps integration is not available.
nautobot-worker_1 | NoneType: None
nautobot-worker_1 | 20:33:04.044 ERROR nautobot.core.apps :
nautobot-worker_1 | Error in link construction for Notes: Reverse for 'note_list' not found. 'note_list' is not a valid view function or pattern name.
nautobot-worker_1 | usage: nautobot-server post_upgrade [-h] [--version] [-v {0,1,2,3}]
nautobot-worker_1 | [--settings SETTINGS]
nautobot-worker_1 | [--pythonpath PYTHONPATH] [--traceback]
nautobot-worker_1 | [--no-color] [--force-color]
nautobot-worker_1 | [--skip-checks] [--no-build-ui]
nautobot-worker_1 | [--no-clearsessions] [--no-collectstatic]
nautobot-worker_1 | [--no-migrate]
nautobot-worker_1 | [--no-remove-stale-contenttypes]
nautobot-worker_1 | [--no-trace-paths]
nautobot-worker_1 | [--no-send-installation-metrics]
nautobot-worker_1 | [--no-refresh-content-type-cache]
nautobot-worker_1 | [--no-refresh-dynamic-group-member-caches]
nautobot-worker_1 | nautobot-server post_upgrade: error: unrecognized arguments: --no-invalidate-all
nautobot-worker_1 | ⏳ Waiting on DB... (6s / 30s)

Invoke Build Broken

If you attempt to do an invoke build without having the invoke.yml file it throws an error:

Traceback (most recent call last):
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/config.py", line 117, in __getattr__
    return self._get(key)
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/config.py", line 177, in _get
    value = self._config[key]
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/config.py", line 168, in __getitem__
    return self._get(key)
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/config.py", line 177, in _get
    value = self._config[key]
KeyError: 'nautobot_docker_compose'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/bin/invoke", line 8, in <module>
    sys.exit(program.run())
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/program.py", line 398, in run
    self.execute()
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/program.py", line 583, in execute
    executor.execute(*self.tasks)
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/executor.py", line 140, in execute
    result = call.task(*args, **call.kwargs)
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/tasks.py", line 138, in __call__
    result = self.body(*args, **kwargs)
  File "/Users/justin.drew/Projects/nautobot-docker-compose/tasks.py", line 128, in build
    f"Building Nautobot {NAUTOBOT_VERSION} with Python {context.nautobot_docker_compose.python_ver}..."
  File "/Users/justin.drew/Projects/nautobot-docker-compose/.venv/lib/python3.9/site-packages/invoke/config.py", line 129, in __getattr__
    raise AttributeError(err)
AttributeError: No attribute or config key found for 'nautobot_docker_compose'

Valid keys: ['nautobot-docker-compose', 'run', 'runners', 'sudo', 'tasks', 'timeouts']

Valid real attributes: ['cd', 'clear', 'config', 'cwd', 'from_data', 'pop', 'popitem', 'prefix', 'run', 'setdefault', 'sudo', 'update']

This appears to be because the tasks.py has the context key as nautobot-docker-compose when it should be nautobot_docker_compose.

rq import problems with release 1.6

Just a quick documentation of an issue I had today while using the docker-compose setup to spin up a Nautobot 1.6 instance for testing.

https://github.com/nautobot/nautobot-docker-compose/blob/main/config/nautobot_config.py.ldap#L353 imports the ColorizingStreamHandler class from rq.utils.

But since django-rq was bumped from 2.5.1 to 2.8.1 for the Nautobot 1.6 release here the rq dependency has automatically been updated to >=1.15.1.

rq moved the class ColorizingStreamHandler from the utils.py to logutils.py here, unfortunately without mentioning it in the 1.14.0 release notes.

To get back to a working docker setup with Nautobot 1.6 you have to change the import statement in the LDAP config like I did in my fork here.

time to set a production target for docker-compose

Although I know that docker-compose is often considered a dev environment by the IT industry because of scaling, with most consultants advising a use of Kubernetes or other container orchestration platform that supports scaling, for a lot of smaller businesses, especially in Europe, that is simply inaccurate.
A lot of companies/businesses prefer to run such environments in Docker and use Docker-compose simply because of their smaller scale that doesn't justify the use of such a complex platform.
I believe it's time to consider a small scale production environment as target for the docker-compose implementation of Nautobot.
That would address several issues, in my opinion these are the most important:

  • Which nautobot components should be included as nautobot services separately in docker-compose.yml. Is Celery beat one of them? If so, a proper set of settings should be defined and verified.
  • Which are the dependecies for each service? A proper boot order should be defined.
  • A variation of a docker-compose file with Nginx in front, as well as a typical nginx default conf should be defined, to be alligned with the installation instructions of Nautobot on VM/physical.
  • An update of the nautobot versions tested with this setup should be included in the repo documentation.

bring up ports only on localhost

I'm trying to bring up the system only listening on 127.0.0.1 so I can access via a reverse proxy front-end, there are multiple services on the server. I am setting the ports section as follows:

ports:

- "8443:8443"

   - "127.0.0.1:8080:8080"

But when I attempt to bring up with docker-compose up -d I get the following error:

Error response from daemon: driver failed programming external connectivity on endpoint nautobot-docker-compose-nautobot-1 (74bdbcc15abbe36edcb02a99a015754724688250dd6db734389892af83ca0b23): Error starting userland proxy: listen tcp4 0.0.0.0:8080: bind: address already in use

I can confirm there is nothing else on this port prior. Wondering if someone could provide direction. I was able to accomplish a similar setup with NetBox. Thank y'all for what you do.

Default configuration does not mount `config/nautobot_config.py`

This repo is a good starting point, but it might be a bit confusing for newcomers as the config/nautobot_config.py is not mounted by default and thus does not apply any of the customisations specified by the user.

Presumably docker-compose.yml should have a volumes mount for ./config/nautobot_config.py into /opt/nautobot/nautobot_config.py, e.g.;

    volumes:
      - "./config/nautobot_config.py:/opt/nautobot/nautobot_config.py:ro"

Let me know if you'd take a PR for this and I'll happily fix, thanks.

API connection problem and getting errors

hello,

So I spawned an instance and having problem seems I cannot connect to API don't understand why. I tried to generate inventory via Ansible I can see in console that graphQL schema is generating and ready then nothing:

nautobot_1         | 18:39:05.509 INFO    nautobot.graphql.schema :
nautobot_1         |   Beginning generation of Nautobot GraphQL schema
nautobot_1         | 18:39:17.993 INFO    nautobot.graphql.schema :
nautobot_1         |   Generation of Nautobot GraphQL schema complete
nautobot_1         |   Internal Server Error: /api/docs/
nautobot_1         | [pid: 422|app: 0|req: 17/60] 172.20.0.1 () {34 vars in 497 bytes} [Mon Aug 22 18:39:04 2022] GET /api/docs/?format=openapi => generated 245 bytes in 27016 msecs (HTTP/1.1 500) 7 headers in 217 bytes (1 switches on core 0)

Also I am getting some error on terminal:

nautobot_1         | 18:36:30.528 WARNING django.request :
nautobot_1         |   Not Found: /version
nautobot_1         | [pid: 422|app: 0|req: 5/22] 172.20.0.1 () {32 vars in 437 bytes} [Mon Aug 22 18:36:30 2022] GET /version?timeout=5s => generated 7257 bytes in 162 msecs (HTTP/1.1 404) 7 headers in 364 bytes (1 switches on core 0)
nautobot_1         | 18:37:30.812 WARNING django.request :
nautobot_1         |   Not Found: /version
nautobot_1         | [pid: 424|app: 0|req: 21/35] 172.20.0.1 () {32 vars in 437 bytes} [Mon Aug 22 18:37:30 2022] GET /version?timeout=5s => generated 7257 bytes in 59 msecs (HTTP/1.1 404) 7 headers in 364 bytes (1 switches on core 0)

Error in invoke db-export due to incorrect service name and obsolete version warnings

Description

When running invoke db-export within the nautobot-docker-compose project, the command fails due to warnings about deprecated version fields in YAML configuration files and a service naming error indicating "no such service: postgres."

Steps to Reproduce

  1. Clone the nautobot-docker-compose repository.
  2. Navigate to the project directory.
  3. Execute the command invoke db-export.

Expected Behavior

The database export process should execute without errors, properly identifying the correct database service name and avoiding any deprecated warnings.

Actual Behavior

The following issues were encountered:

  • Obsolete version field warnings in docker-compose.postgres.yml, docker-compose.base.yml, and docker-compose.local.yml.
  • Error message: "no such service: postgres".

It was noted that the actual database service is named db and not postgres, as evidenced by docker ps output.

Possible Fix

  • Modify the tasks.py file to reference the correct service name (db instead of postgres).
  • Review and update the Docker Compose YAML files to comply with current Docker standards, specifically removing or updating the deprecated version field.

Additional Information

  • It may be necessary to confirm the database service configuration to ensure the service is intended to use PostgreSQL and not MySQL, as inferred by the use of the postgres:13-alpine image.

Prevision of a case where both LDAP support is needed and plugins are installed/supported

There are a lot of issues to be discussed. Normally I would create one issue named "Full review on the docker compose use cases and yml file" but I guess that's not very practical So I will create each item separately.
In order to have LDAP support and install plugins at the same time, a different Dockerfile should be prepared. I am proposing a modified version of the LDAP Dockerfile, where plugins are included in one file, additional python packages in another, the nautobot_config.py file is copied over during the two stage process and the plugins and additional packages are installed by the nautobot user.
Also the Dockerfile contains previsions for the ownership of the nautobot_config.py file to be retained by the nautobot user/group.

ARG PYTHON_VER=3.10
ARG NAUTOBOT_VERSION=1.4.1

FROM networktocode/nautobot:${NAUTOBOT_VERSION}-py${PYTHON_VER} as base

USER 0
RUN apt-get update -y && apt-get install -y libldap2-dev libsasl2-dev libssl-dev

# ---------------------------------
# Stage: Builder
# ---------------------------------
FROM base as builder

RUN apt-get install -y gcc && \
    apt-get autoremove -y && \
    apt-get clean all && \
    rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip wheel && pip3 install django-auth-ldap

# ---------------------------------
# Stage: Final
# ---------------------------------
FROM base as final
ARG PYTHON_VER
USER 0

COPY --from=builder /usr/local/lib/python${PYTHON_VER}/site-packages /usr/local/lib/python${PYTHON_VER}/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --chown=nautobot:nautobot ./nautobot_config.py /opt/nautobot/nautobot_config.py

USER nautobot
WORKDIR /opt/nautobot

RUN pip install --upgrade pip wheel
COPY --chown=nautobot:nautobot ./plugin_requirements.txt /opt/nautobot/
RUN pip install --no-warn-script-location -r /opt/nautobot/plugin_requirements.txt
COPY --chown=nautobot:nautobot ./local_requirements.txt /opt/nautobot/
RUN pip install --no-warn-script-location -r /opt/nautobot/local_requirements.txt

Purpose of `plugin_example/docker-compose.yml`?

Is plugin_example/docker-compose.yml a necessary/useful file? It looks like a duplicate of the base docker-compose.yml file to me - following the plugins.md docs will have you copy it out to override the base file, but is that even necessary?

Various documentation updates needed

Celery/Redis inconsistencies:

https://github.com/networktocode-llc/nautobot-docker-compose/blob/main/docs/create_ssl_cert.md - still has just a placeholder for Let's Encrypt - do we need to add this before release?

Remove RQ worker from default setup

The RQ integration in Nautobot has been deprecated since 1.1.0. New deployments typically have no need for the rq_worker container, so it should probably be disabled by default in new deployments, with documentation provided on how to enable it if really needed.

Postgress is in UTC Timezone which causes timestamp errors in tasks if nautobot runs in a different time zone, timezone should be defined in the environment section for Postgress.

If the Timezone is not UTC and an appropriate different timezone is defined for nautobot in the nautobot_config.py (or env file) and also by the use of

    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro    

for each service, the onboarding tasks are mentioned to be running for a wrong amount of time and are timestamped a few hours away from the local time marked in the footer of the nautobot webpage.
The Correct timezone should be defined in the environment area of the Nautobotm docker-compose.yml file for the postgress service:

    environment:
      - TZ=Europe/Athens

This should be mentioned in the documentation for the repo.

Celery worker need access to nautobot_config.py (volume mapping)

Currently the celery worker doesn't have any volumes mapped in the docker_compose.yml file(s)

Result:
When executing a job from Plugin it failed because plugin config is not found. This container also needs the same mapping as nautobot and nautobot-worker container

This was needed for golden-config job to execute, that failed first:

 -------------- celery@a2017eec65b4 v5.2.7 (dawn-chorus)
--- ***** -----
-- ******* ---- Linux-4.18.0-372.26.1.el8_6.x86_64-x86_64-with-glibc2.31 2022-10-19 13:44:39
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app:         nautobot:0x7f9060254580
- ** ---------- .> transport:   redis://:**@nautobot-redis:6379/0
- ** ---------- .> results:     redis://:**@nautobot-redis:6379/0
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery


[2022-10-19 13:46:01,586: ERROR/ForkPoolWorker-1] Task nautobot.extras.jobs.run_job[43b252ff-c653-45a9-a637-c725a850d872] raised unexpected: KeyError('nautobot_golden_config')
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nautobot/extras/jobs.py", line 1067, in run_job
    job_class = job_model.job_class
  File "/usr/local/lib/python3.9/site-packages/nautobot/extras/models/jobs.py", line 300, in job_class
    self._job_class = import_object(f"{self.module_name}.{self.job_class_name}")
  File "/usr/local/lib/python3.9/site-packages/nautobot/extras/plugins/utils.py", line 45, in import_object
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/nautobot_golden_config/jobs.py", line 13, in <module>
    from nautobot_golden_config.nornir_plays.config_intended import config_intended
  File "/usr/local/lib/python3.9/site-packages/nautobot_golden_config/nornir_plays/config_intended.py", line 22, in <module>
    from nautobot_golden_config.models import GoldenConfigSetting, GoldenConfig
  File "/usr/local/lib/python3.9/site-packages/nautobot_golden_config/models.py", line 20, in <module>
    from nautobot_golden_config.utilities.utils import get_platform
  File "/usr/local/lib/python3.9/site-packages/nautobot_golden_config/utilities/utils.py", line 5, in <module>
    from nautobot_golden_config.utilities.constant import PLUGIN_CFG
  File "/usr/local/lib/python3.9/site-packages/nautobot_golden_config/utilities/constant.py", line 4, in <module>
    PLUGIN_CFG = settings.PLUGINS_CONFIG["nautobot_golden_config"]
KeyError: 'nautobot_golden_config'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.