Skip to content

netbox container fails to start on ipv6 disabled hosts, though ipv6 listener is disabledΒ #1613

@necarnot

Description

@necarnot

Current Behavior

I'm running netbox-docker for years and upgrading at each release with no major issues.
Now, trying to upgrade from 4.4.2 to the latest, I see that the netbox container fails to start with the error :
netbox-1 | RuntimeError: Address family not supported by protocol (os error 97)

Years ago, I've already included an override of nginx conf file in my docker-compose.override.yml file :

    volumes:
      - /data/projects/nginx-unit.json:/etc/unit/nginx-unit.json:ro

which nginx-unit.json contains a listener section with ipv6 section removed. So it was OK.

Now, I see in the release notes (https://github.com/netbox-community/netbox-docker/releases) that the internal nginx is replaced by granian (I'm light years from having understood what I just wrote), and I'm wondering if this could explain the issue described above.

Expected Behavior

I wish the netbox container would run as usual.

Docker Compose Version

Docker Compose version v2.40.3

Docker Version

Client: Docker Engine - Community
 Version:           29.0.2
 API version:       1.52
 Go version:        go1.25.4
 Git commit:        8108357
 Built:             Mon Nov 17 12:33:40 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          29.0.2
  API version:      1.52 (minimum version 1.44)
  Go version:       go1.25.4
  Git commit:       e9ff10b
  Built:            Mon Nov 17 12:33:40 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.1.5
  GitCommit:        fcd43222d6b07379a4be9786bda52438f0dd16a1
 runc:
  Version:          1.3.3
  GitCommit:        v1.3.3-0-gd842d771
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

c60defe

The 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

βœ” Container netbox-docker-postgres-1     Running                                                                                                                            0.0s 
 βœ” Container netbox-docker-redis-1        Running                                                                                                                            0.0s 
 βœ” Container netbox-docker-redis-cache-1  Running                                                                                                                            0.0s 
 ✘ Container netbox-docker-netbox-1       Error                                                                                                                             47.1s 
dependency failed to start: container netbox-docker-netbox-1 is unhealthy
redis-1  | 1:M 06 Feb 2026 09:40:24.525 * DB loaded from base file appendonly.aof.321.base.rdb: 0.004 seconds
redis-1  | 1:M 06 Feb 2026 09:40:25.012 * DB loaded from incr file appendonly.aof.321.incr.aof: 0.487 seconds
redis-1  | 1:M 06 Feb 2026 09:40:25.013 * DB loaded from append only file: 0.492 seconds
redis-1  | 1:M 06 Feb 2026 09:40:25.013 * Opening AOF incr file appendonly.aof.321.incr.aof on server start
redis-1  | 1:M 06 Feb 2026 09:40:25.013 * Ready to accept connections tcp
redis-1  | 1:M 06 Feb 2026 09:41:25.018 * 10000 changes in 60 seconds. Saving...
redis-1  | 1:M 06 Feb 2026 09:41:25.019 * Background saving started by pid 371
redis-1  | 371:C 06 Feb 2026 09:41:25.026 * DB saved on disk
redis-1  | 371:C 06 Feb 2026 09:41:25.027 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
redis-1  | 1:M 06 Feb 2026 09:41:25.120 * Background saving terminated with success
postgres-1  | 2026-02-06 09:40:26.434 UTC [65] LOG:  database system was shut down at 2026-02-06 09:40:26 UTC
postgres-1  | 2026-02-06 09:40:26.444 UTC [1] LOG:  database system is ready to accept connections
postgres-1  | 2026-02-06 09:40:31.562 UTC [75] ERROR:  relation "core_configrevision" does not exist at character 168
postgres-1  | 2026-02-06 09:40:31.562 UTC [75] STATEMENT:  SELECT "core_configrevision"."id", "core_configrevision"."active", "core_configrevision"."created", "core_configrevision"."comment", "core_configrevision"."data" FROM "core_configrevision" WHERE "core_configrevision"."active" LIMIT 21
postgres-1  | 2026-02-06 09:40:41.942 UTC [83] ERROR:  relation "core_configrevision" does not exist at character 168
postgres-1  | 2026-02-06 09:40:41.942 UTC [83] STATEMENT:  SELECT "core_configrevision"."id", "core_configrevision"."active", "core_configrevision"."created", "core_configrevision"."comment", "core_configrevision"."data" FROM "core_configrevision" WHERE "core_configrevision"."active" LIMIT 21
postgres-1  | 2026-02-06 09:40:52.112 UTC [91] ERROR:  relation "core_configrevision" does not exist at character 168
postgres-1  | 2026-02-06 09:40:52.112 UTC [91] STATEMENT:  SELECT "core_configrevision"."id", "core_configrevision"."active", "core_configrevision"."created", "core_configrevision"."comment", "core_configrevision"."data" FROM "core_configrevision" WHERE "core_configrevision"."active" LIMIT 21
postgres-1  | 2026-02-06 09:45:26.878 UTC [63] LOG:  checkpoint starting: time
postgres-1  | 2026-02-06 09:47:28.525 UTC [63] LOG:  checkpoint complete: wrote 1215 buffers (7.4%), wrote 3 SLRU buffers; 0 WAL file(s) added, 0 removed, 1 recycled; write=121.608 s, sync=0.018 s, total=121.648 s; sync files=2942, longest=0.002 s, average=0.001 s; distance=16944 kB, estimate=16944 kB; lsn=0/2C60F40, redo lsn=0/2C2B5B8
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.514 * Running mode=standalone, port=6379.
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.517 # Warning: Could not create server TCP listening socket ::*:6379: unable to bind socket, errno: 97
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.517 * Server initialized
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.519 * Cleaning slot migration log in anticipation of a load operation.
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.519 * Loading RDB produced by Valkey version 8.1.1
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.519 * RDB age 12 seconds
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.519 * RDB memory usage when created 12.99 Mb
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.553 * Done loading RDB, keys loaded: 3, keys expired: 0.
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.555 * DB loaded from disk: 0.038 seconds
redis-cache-1  | 1:M 06 Feb 2026 09:40:24.555 * Ready to accept connections tcp
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 562, in _serve
netbox-1       |     self.startup(spawn_target, target_loader)
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 466, in startup
netbox-1       |     self._init_shared_socket()
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/mp.py", line 329, in _init_shared_socket
netbox-1       |     super()._init_shared_socket()
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 318, in _init_shared_socket
netbox-1       |     self._shd = self._ssp.build()
netbox-1       |                 ^^^^^^^^^^^^^^^^^
netbox-1       | RuntimeError: Address family not supported by protocol (os error 97)
netbox-1       | ↩️ Skip creating the superuser
netbox-1       | βœ… Initialisation is done.
netbox-1       | ↩️ Skip creating the superuser
netbox-1       | βœ… Initialisation is done.
netbox-1       | [WARNING] Configured number of workers appears to be higher than the amount of CPU cores available. Mind that such value might actually decrease the overall throughput of the server. Consider using 2 workers and tune threads configuration instead
netbox-1       | [INFO] Starting granian (main PID: 7)
netbox-1       | [WARNING] Configured number of workers appears to be higher than the amount of CPU cores available. Mind that such value might actually decrease the overall throughput of the server. Consider using 2 workers and tune threads configuration instead
netbox-1       | [INFO] Starting granian (main PID: 7)
netbox-1       | Traceback (most recent call last):
netbox-1       |   File "/opt/netbox/venv/bin/granian", line 10, in <module>
netbox-1       |     sys.exit(cli.entrypoint())
netbox-1       |              ^^^^^^^^^^^^^^^^
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/cli.py", line 606, in entrypoint
netbox-1       | Traceback (most recent call last):
netbox-1       |   File "/opt/netbox/venv/bin/granian", line 10, in <module>
netbox-1       |     sys.exit(cli.entrypoint())
netbox-1       |     cli(auto_envvar_prefix='GRANIAN')
netbox-1       |              ^^^^^^^^^^^^^^^^
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/cli.py", line 606, in entrypoint
netbox-1       |     cli(auto_envvar_prefix='GRANIAN')
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
netbox-1       |     return self.main(*args, **kwargs)
netbox-1       |     return self.main(*args, **kwargs)
netbox-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 1406, in main
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 1406, in main
netbox-1       |     rv = self.invoke(ctx)
netbox-1       |     rv = self.invoke(ctx)
netbox-1       |          ^^^^^^^^^^^^^^^^
netbox-1       |          ^^^^^^^^^^^^^^^^
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
netbox-1       |     return ctx.invoke(self.callback, **ctx.params)
netbox-1       |     return ctx.invoke(self.callback, **ctx.params)
netbox-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
netbox-1       |     return callback(*args, **kwargs)
netbox-1       |     return callback(*args, **kwargs)
netbox-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/cli.py", line 600, in cli
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/cli.py", line 600, in cli
netbox-1       |     server.serve()
netbox-1       |     server.serve()
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/mp.py", line 458, in serve
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/mp.py", line 458, in serve
netbox-1       |     super().serve(spawn_target, target_loader, wrap_loader)
netbox-1       |     super().serve(spawn_target, target_loader, wrap_loader)
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 720, in serve
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 720, in serve
netbox-1       |     serve_method(spawn_target, target_loader)
netbox-1       |     serve_method(spawn_target, target_loader)
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 562, in _serve
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 562, in _serve
netbox-1       |     self.startup(spawn_target, target_loader)
netbox-1       |     self.startup(spawn_target, target_loader)
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 466, in startup
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 466, in startup
netbox-1       |     self._init_shared_socket()
netbox-1       |     self._init_shared_socket()
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/mp.py", line 329, in _init_shared_socket
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/mp.py", line 329, in _init_shared_socket
netbox-1       |     super()._init_shared_socket()
netbox-1       |     super()._init_shared_socket()
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 318, in _init_shared_socket
netbox-1       |   File "/opt/netbox/venv/lib/python3.12/site-packages/granian/server/common.py", line 318, in _init_shared_socket
netbox-1       |     self._shd = self._ssp.build()
netbox-1       |     self._shd = self._ssp.build()
netbox-1       |                 ^^^^^^^^^^^^^^^^^
netbox-1       |                 ^^^^^^^^^^^^^^^^^
netbox-1       | RuntimeError: Address family not supported by protocol (os error 97)
netbox-1       | RuntimeError: Address family not supported by protocol (os error 97)
netbox-1 exited with code 1 (restarting)

Content of docker-compose.override.yml

services:
  netbox:
    security_opt:
      - seccomp:unconfined
    ports:
    - 8000:8080
    healthcheck:
      start_period: 240s
      test: "curl -f http://127.0.0.1:8080/login/ || exit 1"
    environment:
      REMOTE_AUTH_ENABLED: "True"
      REMOTE_AUTH_BACKEND: "netbox.authentication.LDAPBackend"
      AUTH_LDAP_SERVER_URI: "REDACTED"
      AUTH_LDAP_BIND_DN: "REDACTED"
      AUTH_LDAP_BIND_PASSWORD: "REDACTED"
      AUTH_LDAP_USER_SEARCH_BASEDN: "REDACTED"
      AUTH_LDAP_GROUP_SEARCH_BASEDN: "REDACTED"
      AUTH_LDAP_REQUIRE_GROUP_DN: "REDACTED"
      AUTH_LDAP_GROUP_TYPE: "NestedGroupOfNamesType"
      AUTH_LDAP_IS_ADMIN_DN: "REDACTED"
      LDAP_IGNORE_CERT_ERRORS: "true"
      CSRF_TRUSTED_ORIGINS: "REDACTED"
      GRANIAN_HOST: "0.0.0.0"
    restart: unless-stopped
    volumes:
      - /data/projects/nginx-unit.json:/etc/unit/nginx-unit.json:ro

  netbox-worker:
    healthcheck:
      start_period: 120s
    restart: unless-stopped

  postgres:
    restart: unless-stopped

  redis:
    restart: unless-stopped

  redis-cache:
    restart: unless-stopped

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