SOLVED Nextcloud update 20.0.4 -> 20.0.5 gone wrong

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
I am running Nextcloud in an iocage jail (12.2-RELEASE-p2) on my TrueNAS Core 12.0-U1.
It is currently on version 20.0.4, with a waiting upgrade to 20.0.5.

Yesterday, I tried to upgrade, and hit a problem with write permissions:

Code:
X Check for write permissions
The following places can not be written to:
/usr/local/www/nextcloud/updater/../console.php
/usr/local/www/nextcloud/updater/../.htaccess
/usr/local/www/nextcloud/updater/../occ
/usr/local/www/nextcloud/updater/../robots.txt
/usr/local/www/nextcloud/updater/../AUTHORS
/usr/local/www/nextcloud/updater/../public.php
/usr/local/www/nextcloud/updater/../cron.php
/usr/local/www/nextcloud/updater/../COPYING
/usr/local/www/nextcloud/updater/../index.html
/usr/local/www/nextcloud/updater/../index.php
/usr/local/www/nextcloud/updater/../version.php
/usr/local/www/nextcloud/updater/../remote.php
/usr/local/www/nextcloud/updater/../status.php


I noticed that all files and folders were owned by root:wheel with 0644 permissions. So only root can write, and not www, that is running nextcloud.
Therefore I changed the ownership to root:www with 0664 permissions. As www is a member of the www group, the write is now possible.

But then it failed at the step "Replace entry points" and I am not able to figure out why. There is nothing in these logs about this:

Code:
/var/log/messages
/var/log/nextcloud/nextcloud.log


And, if I try to browse to it, I get a blank page with these words in the upper left corner:
Code:
Update in process.


I tried posting a topic about this in the Nextcloud Community, but the only response I got is that TrueNAS isn´t a recommended host to run Nextcloud on. Has anyone here seen this, does anyone know of a solution?

Would like to be able to keep updating...

In the meantime, I rolled back my snapshots and am staying at 20.0.4 for the time being.
 

G8One2

Patron
Joined
Jan 2, 2017
Messages
248
I literally just had this happen to me a few minutes ago. The update got stuck on moving old files. Idk why, and it wouldnt let me back into nextcloud. I use danby35 script for nextcloud installs. I just deleted the jail and reinstalled. From there is was stuck in maintenance mode. So I went into the jail root and issued the following command sudo -u www php /usr/local/www/nextcloud/occ maintenance:mode --off . Once I did that i was able to get back into my nextcloud instance. From there, it wanted to upgrade from the web interface so i let it upgrade. Its now running the latest version. Im not sure what it was that broke it in the first place, but this is why I like using danby35's install script. It makes it easy to reinstall if something gets screwed up.
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
I solved it. I had a thought that everything in usr/local/www/nextcloud, where I have my nextcloud installation, should be owned by www:www, which is the user that runs the application, and its primary group. This was not the case. A lot of files were owned by root:wheel. Perhaps since upgrading the jail in which Nextcloud runs.

So, after running chown -R www:www usr/local/www/nextcloud, the update went through.
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
Trying to update from 20.0.5 to 20.0.6 I had the same thing happen. Rolled back my snapshot, and ran the same chown command again. Then it went through. Again.
Why do these files keep changing owner?
 
Top