Support intro
Sorry to hear you’re facing problems. 
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:
- Official documentation (searchable and regularly updated)
- How to topics and FAQs
- Forum search
(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).
Hello everyone,
First of all, thank you for taking the time to read this. Any help or insight is greatly appreciated – we are genuinely stuck and eager to learn a proper solution for our home setup.
We have been working on integrating Nextcloud with LocalAI and Context Chat via AppAPI, and hit a persistent database authentication issue that blocks further progress.
The Basics
-
- Nextcloud Server version: 33.0.2
- Operating system and version: TrueNAS SCALE 25.10.3 (Linux 6.12.33, Debian bookworm based)
- Web server and version: Apache 2.4.66 (inside the Nextcloud container)
- Reverse proxy and version: Cloudflare
- PHP version: 8.4.19
- Is this the first time you’ve seen this error?: No, it has recurred after snapshot rollbacks
- When did this problem seem to first start?: After a TrueNAS snapshot rollback was performed
- Installation method: TrueNAS SCALE App (Docker)
- Are you using Cloudflare, mod_security, or similar?: Yes, Cloudflare
Summary of the issue you are facing:
Nextcloud returns error 500 with “FATAL: password authentication failed for user oc_administrador”, even though the password in config.php matches the value in the TrueNAS GUI’s “Database Password” field. Manual ALTER USER inside the PostgreSQL container temporarily fixes the issue, but it reappears after container restart.
Steps to replicate it (hint: details matter!):
-
Perform a TrueNAS snapshot rollback of the Nextcloud app volumes.
-
Start (or restart) the Nextcloud app from the TrueNAS GUI.
-
Observe that Nextcloud logs show password authentication failures for
oc_administrador. -
Manually reset the password inside the PostgreSQL container using
ALTER USER. -
Verify successful connection with
PGPASSWORD. -
Restart the Nextcloud container again – the error sometimes returns.
Log entries
Nextcloud
[Thu Apr 30 14:18:38.943815 2026] [php:error] [pid 634:tid 634] [client 172.16.8.1:47070] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "postgres" (172.16.8.6), port 5432 failed: FATAL: password authentication failed for user "oc_administrador" in /var/www/html/lib/private/DB/Connection.php:238
PostgreSQL log:
2026-04-30 13:00:29.459 -03 [74] FATAL: password authentication failed for user "oc_administrador"
2026-04-30 13:00:29.459 -03 [74] DETAIL: Connection matched file "/var/lib/postgresql/18/docker/pg_hba.conf" line 99: "host all all all md5"
Web Browser
If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.
PASTE
Web server / Reverse Proxy
The output of your Apache/nginx/system log in /var/log/____:
PASTE HERE
Configuration
Nextcloud
Nextcloud (config.php excerpt):
'dbtype' => 'pgsql',
'dbname' => 'nextcloud',
'dbhost' => 'postgres:5432',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_administrador',
'dbpassword' => 'PASSWORD',
PostgreSQL container pg_hba.conf (relevant line):
host all all all md5
What we have already tried:
-
Reset the password using
ALTER USER:bash
sudo docker exec -it ix-nextcloud-postgres-1 psql -U nextcloud -d nextcloud -c "ALTER USER oc_administrador WITH PASSWORD 'SENHADBNOVA';"Returns
ALTER ROLE. -
Verified the new password:
bash
sudo docker exec -e PGPASSWORD='SENHADBNOVA' ix-nextcloud-postgres-1 psql -U oc_administrador -d nextcloud -c "SELECT 1;"Returns
1(success). -
Temporarily modified
pg_hba.conftotrustfor local connections, performed the password change, and restored the file. -
Replaced the
trusted_domainsarray inconfig.phpafter discovering it had been corrupted with error-log fragments.
Despite these steps, the error sometimes reappears after container restarts.
Hypothesis:
Is there a startup script inside the PostgreSQL container (e.g., under /docker-entrypoint-initdb.d/) that recreates the oc_administrador role with an old password on every container start?
Questions:
-
How can we make the password change permanent and immune to container restarts?
-
Is there any environment variable or TrueNAS App setting that might be forcing the original password?
-
Any other debugging suggestions are very welcome.
Thank you very much in advance for your time and expertise. We truly appreciate any guidance you can provide