Skip to content

Incompatible DB versionΒ #1538

@Ji-Shao

Description

@Ji-Shao

Current Behavior

Following the following steps:
git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
tee docker-compose.override.yml <<EOF
services:
netbox:
ports:
- 8000:8080
EOF
docker compose pull
docker compose up

but found the following error:

<--snip-->
redis-cache-1 | 1:M 15 Oct 2025 06:10:23.069 * Ready to accept connections tcp
netbox-1 | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1 | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1 | ⏳ Waiting on DB... (24s / 30s)

Troubleshooting:

docker logs -f c89066466d9f

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-10-15 06:27:54.449 UTC [1] FATAL: database files are incompatible with server
2025-10-15 06:27:54.449 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 17.6.

Expected Behavior

Modify "docker-compose.yml"

from : (not working)

postgres

postgres:
image: docker.io/postgres:17-alpine

to : (working)

postgres

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

Docker Compose Version

docker compose version Docker Compose version v2.40.0

Docker Version

docker version
Client: Docker Engine - Community
 Version:           28.5.1
 API version:       1.51
 Go version:        go1.24.8
 Git commit:        e180ab8
 Built:             Wed Oct  8 12:17:03 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.5.1
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.24.8
  Git commit:       f8215cc
  Built:            Wed Oct  8 12:17:03 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.28
  GitCommit:        b98a3aace656320842a23f4a392a33f46af97866
 runc:
  Version:          1.3.0
  GitCommit:        v1.3.0-0-g4ca628d1
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

git rev-parse HEAD ae5f7d2

The git Status

git status
On branch release
Your branch is up to date with 'origin/release'.

nothing to commit, working tree clean

Startup Command

docker compose up

NetBox Logs

docker compose up
[+] Running 6/6
 βœ” Network netbox-docker_default            Created                                                                                                                                                                                                                                                                      0.0s 
 βœ” Container netbox-docker-redis-cache-1    Created                                                                                                                                                                                                                                                                      0.1s 
 βœ” Container netbox-docker-redis-1          Created                                                                                                                                                                                                                                                                      0.1s 
 βœ” Container netbox-docker-postgres-1       Created                                                                                                                                                                                                                                                                      0.1s 
 βœ” Container netbox-docker-netbox-1         Created                                                                                                                                                                                                                                                                      0.0s 
 βœ” Container netbox-docker-netbox-worker-1  Created                                                                                                                                                                                                                                                                      0.0s 
Attaching to netbox-1, netbox-worker-1, postgres-1, redis-1, redis-cache-1
redis-1  | 1:M 15 Oct 2025 06:27:54.303 # 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:M 15 Oct 2025 06:27:54.303 * oO0OoO0OoO0Oo Valkey is starting oO0OoO0OoO0Oo
redis-1  | 1:M 15 Oct 2025 06:27:54.303 * Valkey version=8.1.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-1  | 1:M 15 Oct 2025 06:27:54.303 * Configuration loaded
redis-1  | 1:M 15 Oct 2025 06:27:54.303 * monotonic clock: POSIX clock_gettime
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * Running mode=standalone, port=6379.
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * Server initialized
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * Reading RDB base file on AOF loading...
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * Loading RDB produced by Redis version 7.2.5
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * RDB age 39136972 seconds
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * RDB memory usage when created 0.83 Mb
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * RDB is base AOF
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * Done loading RDB, keys loaded: 0, keys expired: 0.
redis-1  | 1:M 15 Oct 2025 06:27:54.304 * DB loaded from base file appendonly.aof.1.base.rdb: 0.000 seconds
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.336 # 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-cache-1  | 1:M 15 Oct 2025 06:27:54.336 * oO0OoO0OoO0Oo Valkey is starting oO0OoO0OoO0Oo
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.336 * Valkey version=8.1.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.336 * Configuration loaded
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.336 * monotonic clock: POSIX clock_gettime
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.336 * Running mode=standalone, port=6379.
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * Server initialized
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * Loading RDB produced by Valkey version 8.1.4
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * RDB age 16 seconds
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * RDB memory usage when created 0.98 Mb
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * Done loading RDB, keys loaded: 1, keys expired: 0.
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * DB loaded from disk: 0.000 seconds
redis-cache-1  | 1:M 15 Oct 2025 06:27:54.337 * Ready to accept connections tcp
postgres-1     | 
postgres-1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres-1     | 
postgres-1     | 2025-10-15 06:27:54.449 UTC [1] FATAL:  database files are incompatible with server
postgres-1     | 2025-10-15 06:27:54.449 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 17.6.
postgres-1 exited with code 1
redis-1        | 1:M 15 Oct 2025 06:27:55.308 * DB loaded from incr file appendonly.aof.1.incr.aof: 1.004 seconds
redis-1        | 1:M 15 Oct 2025 06:27:55.308 * DB loaded from append only file: 1.004 seconds
redis-1        | 1:M 15 Oct 2025 06:27:55.308 * Opening AOF incr file appendonly.aof.1.incr.aof on server start
redis-1        | 1:M 15 Oct 2025 06:27:55.308 * Ready to accept connections tcp
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (0s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (3s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (6s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (9s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (12s / 30s)
redis-1        | 1:M 15 Oct 2025 06:28:55.004 * 10000 changes in 60 seconds. Saving...
redis-1        | 1:M 15 Oct 2025 06:28:55.004 * Background saving started by pid 399
redis-1        | 399:C 15 Oct 2025 06:28:55.008 * DB saved on disk
redis-1        | 399:C 15 Oct 2025 06:28:55.008 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
redis-1        | 1:M 15 Oct 2025 06:28:55.104 * Background saving terminated with success
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (15s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (18s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (21s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (24s / 30s)
netbox-1       | django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
netbox-1       | [ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
netbox-1       | ⏳ Waiting on DB... (27s / 30s)
netbox-1       | ❌ Waited 30s or more for the DB to become ready.
netbox-1 exited with code 1
dependency failed to start: container netbox-docker-netbox-1 exited (1)
exit: 1

Content of docker-compose.override.yml

cat docker-compose.override.yml
services:
  netbox:
    ports:
      - 8000:8080

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions