Getaddrinfo for host "nextcloud-aio-database"

Hello, can someone plz explain to me why i get on nextcloud-aio-nextcloud logs:
⚡ root@openmediavault  ~  docker logs --tail=50 nextcloud-aio-nextcloud nc: getaddrinfo for host "nextcloud-aio-database" port 5432: Try again Waiting for database to start...

while i can :

⚡ root@openmediavault  ~  docker exec -it nextcloud-aio-nextcloud sh      
/var/www/html # ping nextcloud-aio-database
PING nextcloud-aio-database (172.25.0.9): 56 data bytes
64 bytes from 172.25.0.9: seq=0 ttl=42 time=0.074 ms

/var/www/html # nslookup nextcloud-aio-database
Server:         127.0.0.11
Address:        127.0.0.11#53

Non-authoritative answer:
Name:   nextcloud-aio-database
Address: 172.25.0.9
/var/www/html # nc -zv nextcloud-aio-database 5432
Connection to nextcloud-aio-database (172.25.0.9) 5432 port [tcp/postgresql] succeeded!
/var/www/html # exit
 ⚡ root@openmediavault  ~  docker inspect nextcloud-aio-nextcloud nextcloud-aio-database | grep NetworkMode
            "NetworkMode": "nextcloud-aio",
            "NetworkMode": "nextcloud-aio",


My network for information :

⚡ root@openmediavault  ~  docker network inspect nextcloud-aio                  
[
    {
        "Name": "nextcloud-aio",
        "Id": "bb922d10e4aa28c2f2d8dbdc731317acb4bad44879cae2c0003116c3fd5bb315",
        "Created": "2025-04-13T23:23:24.627409505+02:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv4": true,
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.25.0.0/16",
                    "Gateway": "172.25.0.1"
                }
            ]
        },
        "Internal": true,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "0051e1a14f739ee2806b6a2e3983a61fa08926b021e0393a96c119a43dae83e2": {
                "Name": "nextcloud-aio-database",
                "EndpointID": "afd1cde5afed5a1471d3f8f37405178bb79930bc2f5e184b9a610ecfc8416301",
                "MacAddress": "46:37:95:46:80:ec",
                "IPv4Address": "172.25.0.9/16",
                "IPv6Address": ""
            },
            "0378d5cb9380fffec447333bc233947536bbc624b89b1851dc6d3147f7d7a5ad": {
                "Name": "nextcloud-aio-nextcloud",
                "EndpointID": "910b3d5b6b6571bbf632aaf93e8a9f9d43ea52e66b940c13ea6edd4c98f62a4f",
                "MacAddress": "3e:fb:e9:77:41:b7",
                "IPv4Address": "172.25.0.8/16",
                "IPv6Address": ""
            },
            "50aad02fd7b5f546f14b3c8bb98932777bb28c6bd1c860a06fa0d860fd14dee9": {
                "Name": "nextcloud-aio-mastercontainer",
                "EndpointID": "edae70e72388e43831348f40bf379d157cc243c39fbf1669b77f1256b733e51f",
                "MacAddress": "a2:9f:1d:9f:2b:5d",
                "IPv4Address": "172.25.0.4/16",
                "IPv6Address": ""
            },
            "513abc48e0ac309436a7c4f62ecf662c1a08e1642b726cd473967b44b509fdda": {
                "Name": "nextcloud-aio-imaginary",
                "EndpointID": "0941c0d905da65d3620e4d8031466c3987f0cfd45e250da6df9f95c06d41c692",
                "MacAddress": "82:ce:0e:4f:11:1d",
                "IPv4Address": "172.25.0.2/16",
                "IPv6Address": ""
            },
            "5354b608627b9aa0dc8db4b32723e02743ad1d934cc3989b8f22ad510365541a": {
                "Name": "nextcloud-aio-redis",
                "EndpointID": "d1d4e37edceae69dc766e820478de2ca904cd308dad253e0f7d0a38e626f3399",
                "MacAddress": "da:89:48:6e:6c:f6",
                "IPv4Address": "172.25.0.6/16",
                "IPv6Address": ""
            },
            "687b1f6b207c4999d30616d1a693477dedc7f569657951d25a000074379c269d": {
                "Name": "nextcloud-aio-collabora",
                "EndpointID": "ece20ea5ecbabe3b720e52176e715462b1993657359030bacf447d9738c5993b",
                "MacAddress": "8a:e0:d4:a4:d5:e6",
                "IPv4Address": "172.25.0.3/16",
                "IPv6Address": ""
            },
            "80de97aff580df9297928fe5cc4da2f05b4cba18411bea2e93e8b4c43c18f66d": {
                "Name": "nextcloud-aio-apache",
                "EndpointID": "9a209c9ccacce5982f2a7b18711389bbdad7fbe62f9b6132cb9f4f16dad4ce0d",
                "MacAddress": "ea:a2:36:22:bb:ca",
                "IPv4Address": "172.25.0.7/16",
                "IPv6Address": ""
            },
            "d0cfc3e6d4ce52f5a235ad21c08dfa4a4ea89255409031b89a86bf2bff83700b": {
                "Name": "nextcloud-aio-whiteboard",
                "EndpointID": "2f68562522de02852b8ee5ed507918d3dacc2a5b5459c92d905c9baeb6ba2386",
                "MacAddress": "c6:ce:7d:01:5d:94",
                "IPv4Address": "172.25.0.10/16",
                "IPv6Address": ""
            },
            "fa8bb29447c235cfabaf523e20091013e92271f214fee6d0ee1291539d4b8538": {
                "Name": "nextcloud-aio-notify-push",
                "EndpointID": "969cbadb629089f0227e063effd1f4f4958bcfdd67685a60a484177be58f542a",
                "MacAddress": "c2:bc:9a:f4:85:83",
                "IPv4Address": "172.25.0.5/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.name": "br-faff837eac6b"
        },
        "Labels": {}
    }
]

I have “same” problem and “same” network config.
An I have got question to author, to narrow source of the problem, how other containers are working?

For me AIO web interface shows that only Database and Redis are running (out of 5 base components including not counting above mentioned Apache, Nextcloud and Notify Push - simplest test config to cut dawn Talk problems etc)

Same time Portainer shows all containers are healthy except nextcloud-aio-nextcloud with error:
nc: getaddrinfo for host “nextcloud-aio-database” port 5432: Try again", but it can ping in manualy by name or internal IP without problem.

But nextcloud-aio-notify-push is “Waiting for Nextcloud to start…” with “same” error “nc: getaddrinfo for host “nextcloud-aio-nextcloud” port 9000: Try again”. Same ping works good.

Same goes to nextcloud-aio-apache that is also “Waiting for Nextcloud to start…” with same error “nc: getaddrinfo for host “nextcloud-aio-nextcloud” port 9000: Try again”. Also ping is working.

After days of trials and mostly errors I think that AIO default config has same internal connection problems between containers…that manually can “communicate” ping with each other. I even have tried to connect it manually to docker default bridge (hell with security) but it didn’t help.

And another thing. Is Your setup working inside local network with firewall or proxy? (I use OPNsense with HAproxy maybe we could cross check configs)

The joke is I stared Nextcloud container from Linuxserver years ago without any knowledge about Docker, OPNsense, HAproxy Letsencrypt etc… and it worked like a charm ever since (but as it was tailored years ago it doesn’t support TALK)

An I have got question to author, to narrow source of the problem, how other containers are working?

And another thing. Is Your setup working inside local network with firewall or proxy? (I use OPNsense with HAproxy maybe we could cross check configs)

I don’t have any firewall or proxy (beside my ISP router)

The joke is I stared Nextcloud container from Linuxserver years ago without any knowledge about Docker, OPNsense, HAproxy Letsencrypt etc… and it worked like a charm ever since (but as it was tailored years ago it doesn’t support TALK)

The problem (i think) is not nextcloud or our network config but the AIO image (i can install and run the standalone nextcloud manually)

No, the problem is firewall settings in Synology that overwrite docker network communication and prevent the docker network from working correctly.

I dont have synology, i have omv7 on a mini pc.
I dont have ufw, and my nft list ruleset doesnt block any (nextcloud) trafic

Maybe iptables is not active?

here is my iptable, cant see anything wrong :roll_eyes:

 ✘ ⚡ root@openmediavault  ~  for table in filter nat mangle raw security; do
  echo -e "\n=== Checking table: $table ==="
  sudo iptables -t $table -L -v -n --line-numbers | grep -i 'a42a79df872f'
done

=== Checking table: filter ===
2       13   780 ACCEPT     6    --  !br-a42a79df872f br-a42a79df872f  0.0.0.0/0            172.25.0.10          tcp dpt:8080
7        0     0 ACCEPT     6    --  !br-a42a79df872f br-a42a79df872f  0.0.0.0/0            172.25.0.2           tcp dpt:11000
9        0     0 DROP       0    --  !br-a42a79df872f br-a42a79df872f  0.0.0.0/0            0.0.0.0/0           
2       13   780 DOCKER     0    --  *      br-a42a79df872f  0.0.0.0/0            0.0.0.0/0           
2      483  102K ACCEPT     0    --  *      br-a42a79df872f  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
5      425  558K ACCEPT     0    --  br-a42a79df872f *       0.0.0.0/0            0.0.0.0/0           
2      425  558K DOCKER-ISOLATION-STAGE-2  0    --  br-a42a79df872f !br-a42a79df872f  0.0.0.0/0            0.0.0.0/0           
8        0     0 DROP       0    --  *      br-a42a79df872f  0.0.0.0/0            0.0.0.0/0           

=== Checking table: nat ===
8       93  6463 MASQUERADE  0    --  *      !br-a42a79df872f  172.25.0.0/16        0.0.0.0/0           
8        0     0 RETURN     0    --  br-a42a79df872f *       0.0.0.0/0            0.0.0.0/0           
10       0     0 DNAT       6    --  !br-a42a79df872f *       0.0.0.0/0            0.0.0.0/0            tcp dpt:11000 to:172.25.0.2:11000
15      13   780 DNAT       6    --  !br-a42a79df872f *       0.0.0.0/0            0.0.0.0/0            tcp dpt:8888 to:172.25.0.10:8080

=== Checking table: mangle ===

=== Checking table: raw ===
1        0     0 DROP       6    --  !br-a42a79df872f *       0.0.0.0/0            172.25.0.2           tcp dpt:11000
6        0     0 DROP       6    --  !br-a42a79df872f *       0.0.0.0/0            172.25.0.10          tcp dpt:8080

=== Checking table: security ===




 ✘ ⚡ root@openmediavault  ~  docker network ls                              
NETWORK ID     NAME                     DRIVER    SCOPE
fc831b142d35   bridge                   bridge    local
b50b80a59af3   homepage_default         bridge    local
6cdfa8bbbb8b   host                     host      local
8866c7849f2c   immich_default           bridge    local
a42a79df872f   nextcloud-aio            bridge    local
3d384dc2e7a4   none                     null      local
afd2c12a66b2   tunnel_default           bridge    local
00e726ba2de9   vaultwarden_default      bridge    local
aa86437e0b82   watchtower_default       bridge    local
 ⚡ root@openmediavault  ~ 