netbox-community / netbox-docker

🐳 Docker Image of NetBox
https://github.com/netbox-community/netbox-docker/wiki
Apache License 2.0
1.88k stars 873 forks source link

wrong postgres version in docker-compose.yml #1288

Closed ji-podhead closed 3 months ago

ji-podhead commented 3 months ago
$ sudo podman logs netbox-docker_postgres_1

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-08-22 16:33:22.235 UTC [1] FATAL:  database files are incompatible with server
2024-08-22 16:33:22.235 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 14, which is not compatible with this version 16.4.

PostgreSQL Database directory appears to contain a database; Skipping initialization

this is the reason:


            # postgres
            postgres:
              image: docker.io/postgres:16-alpine

i changed the postgres version to 14 in docker-compose.yml and now its working

 sudo podman ps -a
CONTAINER ID  IMAGE                                        COMMAND               CREATED         STATUS                    PORTS                   NAMES
981bf0660acb  docker.io/library/postgres:14-alpine         postgres              45 seconds ago  Up 45 seconds                                     netbox-docker_postgres_1
ee4dfb994596  docker.io/library/redis:7-alpine             sh -c redis-serve...  45 seconds ago  Up 45 seconds                                     netbox-docker_redis_1
09d241285738  docker.io/library/redis:7-alpine             sh -c redis-serve...  45 seconds ago  Up 45 seconds                                     netbox-docker_redis-cache_1
c1aff231a211  docker.io/netboxcommunity/netbox:v4.0-2.9.1  /opt/netbox/docke...  44 seconds ago  Up 44 seconds (starting)  0.0.0.0:8000->8080/tcp  netbox-docker_netbox_1
f582506753db  docker.io/netboxcommunity/netbox:v4.0-2.9.1  /opt/netbox/venv/...  44 seconds ago  Up 44 seconds (healthy)                           netbox-docker_netbox-worker_1
4d76f8a3f8a6  docker.io/netboxcommunity/netbox:v4.0-2.9.1  /opt/netbox/house...  43 seconds ago  Up 42 seconds (healthy)                           netbox-docker_netbox-housekeeping_1

i think some users had similar problems: https://github.com/netbox-community/netbox-docker/discussions/1079

tobiasge commented 3 months ago

Postgres 16 is the current version. We won't merge this downgrade. Please follow the the guide on updating: https://github.com/netbox-community/netbox-docker/wiki/Updating#postgresql-update

ji-podhead commented 3 months ago

Postgres 16 is the current version. We won't merge this downgrade. Please follow the the guide on updating: https://github.com/netbox-community/netbox-docker/wiki/Updating#postgresql-update

a yes i had to run docker compose pull after wiping the containers and volumes. i though that this just leaked from development, but i was just stupid. thanks man!