Closed web3d0 closed 1 year ago
Hi, which Nextcloud apps do you have installed?
It comes with a default set of "Apache" "Database" "Nextcloud" "Redis" "Collabora" and "Nextcloud Talk". I have disabled the "Talk" option, so "Collabora" is still running. None of the other optional packages of "Talk" "ClamAV" "Fulltextsearch" "Imaginary" or "Talk recording server" are running.
I'm comfortable on the command line, so I'm happy to probe into any avenues you suggest. If you can say how to get a psql connection to the Postgres database container, I can try and find where the connections are coming from?
Can you post your Nextcloud logs here? You can get them via https://yourdomain.com/settings/admin/logging
Here is a sample of one of them, as the log file is very large:
[core] Error: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "nextcloud-aio-database" (172.18.0.3), port 5432 failed: FATAL: remaining connection slots are reserved for non-replication superuser connections at <
POST /apps/text/session/sync from 1.124.107.142 at 2023-06-21T04:40:30+00:00
However I'm sure this is just a connection error after the problem has happened. I'm looking for the first error to see what was immediately prior to that. EDIT: No, it goes straight from a reboot to being out of database connections a few hours later.
So from my poking at it so far, I'd like to know what's holding the database connections open. There's about 30 connections just sitting idle, so I could modify the postgres configuration to kill connections after 5 minutes... but why are those connections there in the first place? Are they pooled and waiting for use, in which case the problem is a mis-matching number? Or is something failing to run to completion, so killing the connections would hide the underlying problem?
I suppose this is happening due to one of the installed apps. Can you run sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ app:list
and post the output here?
root@nextcloud:~# docker exec --user www-data -it nextcloud-aio-nextcloud php occ app:list Enabled:
This should be a clean install of Nextcloud, as it was a Digital Ocean droplet which was installed and upgraded. I did try and sync a directory which had node_modules in it, so it thrashed for a bit on the thousands of small files and crashed. I cleared the directory and kept going, but maybe this is a hangover issue?
What kind of hardware do you have? How many CPUs and how many RAM?
1 core, 2GB RAM, 50GB disk. 33% disk usage, 4% CPU usage, 50% memory usage. 50k/sec disk usage (4 people who barely use it), and 4GB swapspace with 0% used.
1 core, 2GB RAM
I would suggest to upgrade to 2vCPU and 4GB RAM, then you should be safe. Otherwise you should probably disable all additional addons as suggested in the AIO interface.
Steps to reproduce
Expected behavior
NextCloud should continue running.
Actual behavior
The log file fills up with:
2023-06-21 16:03:50.654 ACST [4938] FATAL: remaining connection slots are reserved for non-replication superuser connections 2023-06-21 16:04:20.812 ACST [4948] FATAL: remaining connection slots are reserved for non-replication superuser connections
and Postgres shows a large number of idle connections.
Host OS
Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-75-generic x86_64)
Nextcloud AIO version
Nextcloud AIO v6.1.1
Current channel
latest
Other valuable info
Could be a mismatch between number of connections to keep open when pooling and the number of connections allowed by the database?