After upgrading my truenas all apps work (plex, collabora, nginx proxy manager and netdata) except NextCloud.
The container nextcloud says exited and the log shows this error:
2024-11-01 20:57:29.934565+00:00Configuring Redis as session handler
2024-11-01 20:57:30.020057+00:00Warning: /var/www/html/config/redis.config.php differs from the latest version of this image at /usr/src/nextcloud/config/redis.config.php
2024-11-01 20:57:30.020941+00:00Warning: /var/www/html/config/reverse-proxy.config.php differs from the latest version of this image at /usr/src/nextcloud/config/reverse-proxy.config.php
2024-11-01 20:57:30.021819+00:00Warning: /var/www/html/config/s3.config.php differs from the latest version of this image at /usr/src/nextcloud/config/s3.config.php
2024-11-01 20:57:30.022733+00:00Warning: /var/www/html/config/smtp.config.php differs from the latest version of this image at /usr/src/nextcloud/config/smtp.config.php
2024-11-01 20:57:30.024899+00:00=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
2024-11-01 20:57:30.026301+00:00==> Running the script (cwd: /var/www/html): “/docker-entrypoint-hooks.d/before-starting/ix-update-hosts-script.sh”
2024-11-01 20:57:30.031571+00:00Updating database and redis host in config.php
2024-11-01 20:57:30.069451+00:00Could not open input file: /var/www/html/occ
2024-11-01 20:57:30.074210+00:00==> Failed at executing “/docker-entrypoint-hooks.d/before-starting/ix-update-hosts-script.sh”. Exit code: 1
Hi Paco,
Some days ago, I got an error from the Postgres container.
I changed the user:group of the pgdata & pgbackup folders and now it says the “database system is ready to accept connections”.
I run this command:
sudo chown -R netdata:docker /mnt/…/pgdata
The problem shown above now is with the NextCloud container itself.
Are you having troubles with the postgres?
2024-11-02 23:26:58.663406+00:002024-11-02T23:26:58.663406558Z
2024-11-02 23:26:58.663437+00:00PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-11-02 23:26:58.663450+00:002024-11-02T23:26:58.663450908Z
2024-11-02 23:26:58.686591+00:002024-11-02 23:26:58.686 UTC [1] LOG: starting PostgreSQL 13.16 (Debian 13.16-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-02 23:26:58.686747+00:002024-11-02 23:26:58.686 UTC [1] LOG: listening on IPv4 address “0.0.0.0”, port 5432
2024-11-02 23:26:58.686773+00:002024-11-02 23:26:58.686 UTC [1] LOG: listening on IPv6 address “::”, port 5432
2024-11-02 23:26:58.689115+00:002024-11-02 23:26:58.689 UTC [1] LOG: listening on Unix socket “/var/run/postgresql/.s.PGSQL.5432”
2024-11-02 23:26:58.699050+00:002024-11-02 23:26:58.698 UTC [14] LOG: database system was shut down at 2024-11-02 23:26:48 UTC
2024-11-02 23:26:58.706031+00:002024-11-02 23:26:58.705 UTC [1] LOG: database system is ready to accept connections
Actually, my postgres cannot find nextcloud admin user:
2024-11-03 09:49:02.231351+00:002024-11-03 09:49:02.231 UTC [970] FATAL: no pg_hba.conf entry for host "172.16.4.4", user "oc_admin", database "nextcloud", SSL off
2024-11-03 09:49:12.272313+00:002024-11-03 09:49:12.272 UTC [978] FATAL: database "nextcloud" does not exist
Thus nextcloud instance cannot connect to the database. I cheked the user:group of my postgres_db folder and subs, all seems alright…
Hi
My Nextcloud is working again.
I did it by updating the ownership of folders and rolling back the NextCloud instance.
If you followed the general recommendations creating 4 folders to install the NextCloud app then ensure the ownership is www-data for userdata and appdata folders, and netdata:docker for pgdata and pgbackup folders.
This was not enough in my case. I tested by rolling back NextCloud to a previous version.
After this the app will say that there is a new upgrade available and check whether the Nextcloud POD is working. Probably, NextCloud will work immediately. In my case it did not.
I had a blue screen saying to continue with the upgrade manually.
However, this time I was able to enter into the NextCloud Pod and run the occ php upgrade command. Depending on your configuration it may need a different syntax. These are the different formats I found online:
sudo -u www-data php occ upgrade
su -s /bin/bash www-data -c ‘php occ upgrade’
php occ upgrade
After this, I was able to log in back into de the NextCloud. Everything was there. I already completed the most recent upgrade with no problems this time.
This worked for my case, I hope it serves you as a guide