Nextcloud-aio-nextcloud reboot loop

Upgrading from AIO 10.13.0 to 10.14.0 has caused nextcloud-aio-nextcloud to enter a reboot loop. For testing, I can stop all containers and then manually start them all. The nextcloud-aio-nextcloud container will have no issues until nextcloud-aio-database container starts and then nextcloud-aio-nextcloud will proceed with constant reboots.

Sample logs from nextcloud-aio-nextcloud container:

The initial Nextcloud installation failed.
Please reset AIO properly and try again. For further clues what went wrong, check the logs above.
Connection to nextcloud-aio-database (172.18.0.5) 5432 port [tcp/postgresql] succeeded!


2025-05-14 14:12:01.070123+00
(1 row)

The initial Nextcloud installation failed.
Please reset AIO properly and try again. For further clues what went wrong, check the logs above.
See GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.
now

  • ‘[’ -f /dev-dri-group-was-added ‘]’
    ++ find /dev -maxdepth 1 -mindepth 1 -name dri
  • ‘[’ -n ‘’ ‘]’
  • set +x
    Connection to nextcloud-aio-redis (172.18.0.6) 6379 port [tcp/redis] succeeded!
    Connection to nextcloud-aio-database (172.18.0.5) 5432 port [tcp/postgresql] succeeded!
  • ‘[’ -f /dev-dri-group-was-added ‘]’
    ++ find /dev -maxdepth 1 -mindepth 1 -name dri
  • ‘[’ -n ‘’ ‘]’
  • set +x
    Connection to nextcloud-aio-redis (172.18.0.6) 6379 port [tcp/redis] succeeded!
    Connection to nextcloud-aio-database (172.18.0.5) 5432 port [tcp/postgresql] succeeded!
  • ‘[’ -f /dev-dri-group-was-added ‘]’
    ++ find /dev -maxdepth 1 -mindepth 1 -name dri
  • ‘[’ -n ‘’ ‘]’
  • set +x
    Connection to nextcloud-aio-redis (172.18.0.6) 6379 port [tcp/redis] succeeded!
    2025-05-14 14:12:05.011061+00
    (1 row)

Sample logs from nextcloud-aio-database container:

aredman@cloud:[/mnt/data]: sudo docker logs nextcloud-aio-database
Setting postgres values…
chmod: /var/run/postgresql: Operation not permitted

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-05-14 14:11:26.084 UTC [14] LOG: starting PostgreSQL 16.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
2025-05-14 14:11:26.084 UTC [14] LOG: listening on IPv4 address “0.0.0.0”, port 5432
2025-05-14 14:11:26.084 UTC [14] LOG: listening on IPv6 address “::”, port 5432
2025-05-14 14:11:26.085 UTC [14] LOG: listening on Unix socket “/var/run/postgresql/.s.PGSQL.5432”
2025-05-14 14:11:26.087 UTC [24] LOG: database system was shut down at 2025-05-14 02:24:21 UTC
2025-05-14 14:11:26.091 UTC [14] LOG: database system is ready to accept connections
++ rm -f /mnt/data/database-dump.sql.temp
++ touch /mnt/data/export.failed
++ pg_dump --username nextcloud nextcloud_database
++ rm -f /mnt/data/database-dump.sql
++ mv /mnt/data/database-dump.sql.temp /mnt/data/database-dump.sql
++ pg_ctl stop -m fast
2025-05-14 14:12:49.502 UTC [14] LOG: received fast shutdown request
2025-05-14 14:12:49.503 UTC [14] LOG: aborting any active transactions
2025-05-14 14:12:49.505 UTC [14] LOG: background worker “logical replication launcher” (PID 27) exited with exit code 1
2025-05-14 14:12:49.505 UTC [22] LOG: shutting down
2025-05-14 14:12:49.527 UTC [14] LOG: database system is shut down
waiting for server to shut down… done
server stopped
++ rm /mnt/data/export.failed
++ echo ‘Database dump successful!’
++ set +x
Database dump successful!

So, what did I do after the upgrade? Good question. I went to my NAS and restored the backups (tried two of them) from the previous two days but it still fails with the backups restored.

Thoughts?

Andy

I do have the data directory going to a NAS:

aredman@cloud:[/mnt/data]: df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 1.2M 1.6G 1% /run
/dev/sda2 49G 24G 24G 50% /
tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
192.168.2.5:/volume1/pve-39/nfs/ourfullhouse 28T 2.0T 26T 8% /mnt/data
tmpfs 1.6G 12K 1.6G 1% /run/user/1001

The mount is correct and I can see files there:

aredman@cloud:[/mnt/data]: ls -la
total 60
drwxr-x— 8 www-data www-data 4096 May 14 14:12 .
drwxr-xr-x 3 root root 4096 Jan 31 15:35 ..
drwxrwxrwx 6 root root 4096 May 13 20:46 admin
drwxrwxrwx 17 root root 4096 May 13 20:46 appdata_oclmux1ta10u
drwxrwxrwx 7 root root 4096 May 13 20:46 aredman
-rw-r–r-- 1 www-data www-data 0 Jan 31 15:47 audit.log
drwxrwxrwx 7 root root 4096 May 13 20:46 credman
-rw-r–r-- 1 www-data www-data 0 Jan 31 15:48 fts-index.done
drwxrwxrwx 9 root root 4096 May 13 20:46 __groupfolders
-rw-r–r-- 1 www-data www-data 542 Apr 24 16:17 .htaccess
-rw-r–r-- 1 www-data www-data 0 Apr 24 16:17 index.html
-rw-r–r-- 1 www-data www-data 0 May 9 20:28 install.failed
drwxrwxrwx 6 root root 4096 May 13 20:46 jredman
-rw-r–r-- 1 www-data www-data 52 Apr 24 16:17 .ncdata
-rw-r–r-- 1 www-data www-data 0 Jan 31 15:47 nextcloud.log

The installation command:

sudo docker run
–init
–sig-proxy=false
–name nextcloud-aio-mastercontainer
–restart always
–publish 8080:8080
–env APACHE_PORT=11000
–env APACHE_IP_BINDING=192.168.2.9
–env NEXTCLOUD_DATADIR=“/mnt/data”
–env SKIP_DOMAIN_VALIDATION=true
–volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config
–volume /var/run/docker.sock:/var/run/docker.sock:ro
nextcloud/all-in-one:latest

IP Address: 192.168.2.9 is the reverse proxy.

Before starting all containers via https://ip:8080

aredman@cloud:[~]: sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e3651043f9b1 nextcloud/all-in-one:latest “/start.sh” 13 hours ago Up 13 hours (healthy) 80/tcp, 8443/tcp, 9000/tcp, 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp nextcloud-aio-mastercontainer

After starting all containers:

From the AIO interface …

Nextcloud AIO v10.14.0

You are running the latest channel. (Logs)

It seems at least one container was not able to start correctly and is currently restarting.

To break this endless loop, you can stop the containers below and investigate the issue in the container logs before starting the containers again.

aredman@cloud:[~]: sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc2e53b01957 ghcr.io/nextcloud-releases/aio-apache:latest “/start.sh /usr/bin/…” 50 seconds ago Up 50 seconds (healthy) 80/tcp, 192.168.2.9:11000->11000/tcp nextcloud-aio-apache
97e0d85c528a ghcr.io/nextcloud-releases/aio-whiteboard:latest “/start.sh” 56 seconds ago Up 55 seconds (healthy) 3002/tcp nextcloud-aio-whiteboard
b11117356dc2 ghcr.io/nextcloud-releases/aio-notify-push:latest “/start.sh” 58 seconds ago Up 57 seconds (healthy) nextcloud-aio-notify-push
2fed6ec9a1c5 Package aio-nextcloud · GitHub “/start.sh /usr/bin/…” About a minute ago Restarting (1) 12 seconds ago nextcloud-aio-nextcloud
89ab02c0f7b9 ghcr.io/nextcloud-releases/aio-imaginary:latest “/start.sh” About a minute ago Up About a minute (healthy) nextcloud-aio-imaginary
0320dba8a089 ghcr.io/nextcloud-releases/aio-talk-recording:latest “/start.sh python -m…” About a minute ago Up About a minute (healthy) nextcloud-aio-talk-recording
e6c18954716a ghcr.io/nextcloud-releases/aio-fulltextsearch:latest “/bin/tini – /usr/l…” About a minute ago Up About a minute (healthy) 9200/tcp, 9300/tcp nextcloud-aio-fulltextsearch
9dbff5aeb7d6 ghcr.io/nextcloud-releases/aio-clamav:latest “/start.sh /usr/bin/…” About a minute ago Up About a minute (healthy) nextcloud-aio-clamav
bbcca13112ad ghcr.io/nextcloud-releases/aio-redis:latest “/start.sh” About a minute ago Up About a minute (healthy) 6379/tcp nextcloud-aio-redis
cfd5b636027b ghcr.io/nextcloud-releases/aio-postgresql:latest “/start.sh” About a minute ago Up About a minute (healthy) 5432/tcp nextcloud-aio-database
ba1ca7dcb5e0 ghcr.io/nextcloud-releases/aio-talk:latest “/start.sh superviso…” About a minute ago Up About a minute (healthy) 0.0.0.0:3478->3478/tcp, 0.0.0.0:3478->3478/udp, [::]:3478->3478/tcp, [::]:3478->3478/udp nextcloud-aio-talk
df48e7627e9f ghcr.io/nextcloud-releases/aio-collabora:latest “/start-collabora-on…” About a minute ago Up About a minute (healthy) 9980/tcp nextcloud-aio-collabora
e3651043f9b1 nextcloud/all-in-one:latest “/start.sh” 13 hours ago Up 13 hours (healthy) 80/tcp, 8443/tcp, 9000/tcp, 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp

nextcloud-aio-database container being stopped:

aredman@cloud:[~]: sudo docker stop cfd5b636027b
cfd5b636027b

All ‘healthy’ now with db container down:

aredman@cloud:[~]: sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc2e53b01957 ghcr.io/nextcloud-releases/aio-apache:latest “/start.sh /usr/bin/…” 2 minutes ago Up 2 minutes (healthy) 80/tcp, 192.168.2.9:11000->11000/tcp nextcloud-aio-apache
97e0d85c528a ghcr.io/nextcloud-releases/aio-whiteboard:latest “/start.sh” 2 minutes ago Up 2 minutes (healthy) 3002/tcp nextcloud-aio-whiteboard
b11117356dc2 ghcr.io/nextcloud-releases/aio-notify-push:latest “/start.sh” 2 minutes ago Up 2 minutes (healthy) nextcloud-aio-notify-push
2fed6ec9a1c5 Package aio-nextcloud · GitHub “/start.sh /usr/bin/…” 2 minutes ago Up 37 seconds (healthy) 9000/tcp nextcloud-aio-nextcloud
89ab02c0f7b9 ghcr.io/nextcloud-releases/aio-imaginary:latest “/start.sh” 2 minutes ago Up 2 minutes (healthy) nextcloud-aio-imaginary
0320dba8a089 ghcr.io/nextcloud-releases/aio-talk-recording:latest “/start.sh python -m…” 2 minutes ago Up 2 minutes (healthy) nextcloud-aio-talk-recording
e6c18954716a ghcr.io/nextcloud-releases/aio-fulltextsearch:latest “/bin/tini – /usr/l…” 2 minutes ago Up 2 minutes (healthy) 9200/tcp, 9300/tcp nextcloud-aio-fulltextsearch
9dbff5aeb7d6 ghcr.io/nextcloud-releases/aio-clamav:latest “/start.sh /usr/bin/…” 2 minutes ago Up 2 minutes (healthy) nextcloud-aio-clamav
bbcca13112ad ghcr.io/nextcloud-releases/aio-redis:latest “/start.sh” 3 minutes ago Up 3 minutes (healthy) 6379/tcp nextcloud-aio-redis
ba1ca7dcb5e0 ghcr.io/nextcloud-releases/aio-talk:latest “/start.sh superviso…” 3 minutes ago Up 3 minutes (healthy) 0.0.0.0:3478->3478/tcp, 0.0.0.0:3478->3478/udp, [::]:3478->3478/tcp, [::]:3478->3478/udp nextcloud-aio-talk
df48e7627e9f ghcr.io/nextcloud-releases/aio-collabora:latest “/start-collabora-on…” 3 minutes ago Up 3 minutes (healthy) 9980/tcp nextcloud-aio-collabora
e3651043f9b1 nextcloud/all-in-one:latest “/start.sh” 13 hours ago Up 13 hours (healthy) 80/tcp, 8443/tcp, 9000/tcp, 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp nextcloud-aio-mastercontainer

Up four mins now healthy without db container started:

2fed6ec9a1c5 Package aio-nextcloud · GitHub “/start.sh /usr/bin/…” 6 minutes ago Up 4 minutes (healthy) 9000/tcp nextcloud-aio-nextcloud

General advice based on my experience:

Based on my experience with Nextcloud AIO, I stopped using docker run for managing containers quite a while ago. I’ve switched entirely to using a docker-compose.yml file, which has significantly simplified container management.

Advantages of using docker-compose.yml:

  • Easier container management: With just docker-compose up -d and docker-compose down, I can start or stop all containers at once.
  • Centralized configuration: All settings are defined in one file, making it easier to manage and version.
  • Simplified recovery or migration: In case of server migration or rebuild, it’s easy to bring everything back up using the same compose file.

Using Portainer (Optional but helpful):

In addition to that, I personally use Portainer, which provides a graphical interface for Docker container management. Especially with Nextcloud AIO, which spins up to 15 different containers during full startup, Portainer helps me stay in control.

That said, I’m not trying to push Portainer on anyone — it really comes down to personal workflow. Some prefer sticking to the CLI only, and that’s totally valid.
For me personally, Portainer makes my work significantly more efficient, especially when inspecting logs, restarting services, or dealing with failed containers.

Benefits of Portainer:

  • Visual dashboard: Easily monitor container statuses, logs, and system resource usage.
  • Effortless management: Start, stop, restart, or remove containers without the terminal.
  • Compose stack support: Launch and manage entire docker-compose stacks from the web interface.

About your specific issue (reboot loop):

I’ve encountered similar situations before. Based on my experience, I recommend avoiding manual container shutdowns using docker stop or docker kill, especially with the nextcloud-aio-mastercontainer, which is critical for orchestrating the entire setup.

As I described in this post:
:right_arrow: https://help.nextcloud.com/t/nextcloud-aio-v10-1-1-apache-will-not-start/212805/19?u=vawaver

Here’s how I typically handle situations where containers fail to start:

  1. Use the AIO interface to stop all running containers.
  2. Open Portainer and remove all stopped containers, except for the nextcloud-aio-mastercontainer.
  3. If the issue continues, remove the image of the problematic container using Portainer.
  4. Let the AIO system automatically recreate the container with a fresh image upon restart.

This approach has helped me resolve such issues multiple times without touching the CLI.

Regarding the “volume already exists” warning:

This is another thing that may confuse users — especially after removing the nextcloud-aio-mastercontainer, Docker might display a message that a volume already exists and ask whether to recreate it.

This is easy to handle if you’re using a docker-compose.yml file, since volumes are explicitly defined and persist across container restarts or recreation.

More info here:
:right_arrow: https://help.nextcloud.com/t/nextcloud-aio-unexpectedly-reset-to-initial-setup/224587/4?u=vawaver


Summary:

I highly recommend managing your Nextcloud AIO setup using a docker-compose.yml file. And while Portainer is not required, it’s a valuable tool that I personally use to simplify Docker administration — especially when managing complex stacks like Nextcloud AIO.

This combination has made my environment much more stable, transparent, and easy to maintain — especially during updates, troubleshooting, or host reboots.


Note: This post was written with the help of an AI assistant as a writing aid only. The opinions, solutions, and technical recommendations are fully based on my personal experience.
More about how and why I use AI to write forum posts:
:right_arrow: Is there limitations to installing Nextcloud via CT template on Proxmox - #4 by vawaver

Thanks for the reply and suggestions. To clarify, I don’t manually do anything as normal practice. I’m simply shutting them down to see where the failure event occurs. I normally use the https://:8080 interface to manage this process. I do appreciate the feedback on how to generally manage things, but I’m focused on the actual issue at this point. Thanks, though.

I’m still hoping I can get some feedback as to why I’m in the failure situation based on log detail and a description of the issue.

Makes sense.
Hope you manage to get to the bottom of it — situations like this can be tricky with how many moving parts AIO involves.
Wishing you success in resolving it.

1 Like

I’ve built AIO from the ground up. Have data directory mounted on a NAS. Created new NFS directory and new AIO mounted to it. Copy-n-Paste old data to new NFS directory. Scanned files after all users/group folders created and bingo. Not going to invest any more time on this issue.

Thanks for the feedback again. I probs will take you up on your suggestions for better container MGMT anyway … just wasn’t my primary focus at the time :wink:

Andy

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.