nautobot-docker-compose icon indicating copy to clipboard operation
nautobot-docker-compose copied to clipboard

Errors bringing up nautobot compose stack

Open adrian62 opened this issue 7 months ago • 3 comments

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

adrian62 avatar Nov 22 '23 05:11 adrian62

The celery_worker startup errors should be fixable by changing the docker-compose so that it has:

    depends_on:
      nautobot:
        condition: service_healthy

so that it doesn't attempt to start up while the nautobot container is still running initial database migrations.

Likely a similar change would be appropriate for the celery_beat container as well.

glennmatthews avatar Nov 27 '23 15:11 glennmatthews

Hi adrian62 Did you find any solution to this? I am facing same issue with docker compose. This error came up when I tried to install a plugin.

Nautobot Docker version: 1.5.11 Python version: 3.9

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

Would be helpful if someone shed some light on this.

NetOpsChic avatar Jan 22 '24 13:01 NetOpsChic

@NetOpsChic That specific error suggests that you're trying to run a newer version of Nautobot (2.x) in a docker container that was built for an older version (1.x), as the --[no-]invalidate-all flag was removed in 2.0.

I'd suggest checking the version and dependencies of the plugin that you're installing, it may be that its own Nautobot dependency may be triggering an unintended upgrade of Nautobot itself as a side effect.

glennmatthews avatar Jan 22 '24 14:01 glennmatthews