NC AOI waiting for database to start

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):

    • AIO 13.4.1
  • Operating system and version (e.g., Ubuntu 24.04):

    • Guest Server runs on Proxmox VE 9.2.6
    • Fedora Core OS (Ucore) stable-nvidia 44.20260720.3.1

    Web server and version (e.g, Apache 2.4.25):

    • Runs on a seperate guest VM on another Machine Swag 5.7 (Linuxserverio)
  • Reverse proxy and version _(e.g. nginx 1.27.2)

    • nginx 3.22
  • PHP version (e.g, 8.3):

    • idk
  • Is this the first time you’ve seen this error? (Yes / No):

    • yes
  • When did this problem seem to first start?

    • when connecting my other server to to be managed by the same Proxmox VE instance
    • After I finished setting that up, I spun up all VMs again and then it happened
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)

    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)

    • No

Summary of the issue you are facing:

My Postgresql database doesn’t seem to start properly for the other containers to see it.
For example the NC container itself loops with the logs:
waiting for database to start...

After some searching after the issue I came across these threads:

I ran nc -z nextcloud-aio-database 5432; echo $? from inside the NC container and it returned a 1 .
So I tried setting the backend for firewalld to iptables from nftables like suggested but without success. (I reloaded the systemctl daemon for the 1st try and after that I rebooted the VM for the 2nd try)
I changed it back to nftables

Let me just say that I have setup/run multiple Nextcloud AIO instances on different Fedora installations for over 2 years now and I never had an issue with docker networking being of nftables besides my own lack of understanding in some cases.
Anyway

I tried recreating the docker network also without success.
So before any severe troubleshooting I created a backup of my instance and deleted all containers, Volumes and networks from the system related to NC. After setting up AIO again and restoring the Backup, it still failed.

Steps to replicate it (hint: details matter!):

  1. Go to AIO interface in your Browser

  2. Click on start containers

  3. Watch the Database and NC Container logs

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

It is empty

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

I only have the Access log from the other VM
If you want the firewalld log, please say so.

Database logs

The output of your Apache/nginx/system log in /var/log/____:

2026-08-15T07:34:10.311365614Z Setting postgres values...
2026-08-15T07:34:10.343535824Z chmod: /var/run/postgresql: Operation not permitted
2026-08-15T07:34:10.345271504Z 
2026-08-15T07:34:10.345284363Z PostgreSQL Database directory appears to contain a database; Skipping initialization
2026-08-15T07:34:10.345289055Z 
2026-08-15T07:34:10.431864472Z 2026-08-15 07:34:10.431 GMT [37] LOG:  starting PostgreSQL 18.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit
2026-08-15T07:34:10.432037113Z 2026-08-15 07:34:10.431 GMT [37] LOG:  listening on IPv6 address "::1", port 5432
2026-08-15T07:34:10.432045284Z 2026-08-15 07:34:10.431 GMT [37] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2026-08-15T07:34:10.434659227Z 2026-08-15 07:34:10.434 GMT [37] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2026-08-15T07:34:10.444686211Z 2026-08-15 07:34:10.444 GMT [50] LOG:  database system was shut down at 2026-08-15 06:17:20 GMT
2026-08-15T07:34:10.481414816Z 2026-08-15 07:34:10.481 GMT [37] LOG:  database system is ready to accept connections

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

I don't know where that is on my install

Apps

The output of occ app:list (if possible).
Can't do that, since I am not able to get into my instance

I’m seeing the same kind of AIO startup loop when the PostgreSQL container does not become available to the other containers, so this is the part I’m watching most closely. The fact that the NC container keeps waiting for the database makes the database container logs and health status the key details.

Thank you for the Reply.
I don’t get it.
I posted the database logs in the original post.
How can I check for the health status of the container?

Perhaps @Jessie.Turner61 means the health status returned by executing docker ps?

Try running:

docker exec nextcloud-aio-database psql -U nextcloud -d postgres -t -c "SHOW listen_addresses;"

If that returns “localhost” that’s your culprit and you should be able to fix it with:

docker exec nextcloud-aio-database sh -c "echo \"listen_addresses='*'\" >> /var/lib/postgresql/data/postgresql.conf"

I have no idea why this happened to me after a host server restart recently…

First of all:
Thank you for replying on this post and trying to help.
This is the first time I posted on this forum.
I managed to fix it with the commands provided by @Finski.
Have a nice day you all and hopefully this thread will serve many more people as help when they run into the same issue.