Update issue to v18.0.2

Good morning
Something odd is going on. I have a fresh installed rpi4 buster nextcloud 18 on nginx and it is working fine. I have passman installed and preview generator. Everything is working great.
I am used to the gui updater not working for me, so i usually does it from command line. But now neither works, and dur to the amount of family photos, i hesitate to just copy and unzip the new version and copy back the conf and data. I really would like the updater to work. Here is what happens :
GUI : as admin i see the below, and when i press open updater, i get back the the admin files view - here is what i see in the version section :slight_smile: Version

Nextcloud 18.0.0

A new version is available: Nextcloud 18.0.2
All apps have an update for this version available

Apps with available updates

Open updater Download now

Update channel:

Stable

COMMAND LINE :
/var/www/nextcloud# sudo -u www-data ./occ update:check
Nextcloud 18.0.2 is available. Get more information on how to update at https://docs.nextcloud.com/server/18/admin_manual/maintenance/upgrade.html.
1 update available

/var/www/nextcloud# sudo -u www-data ./occ upgrade
Nextcloud is already latest version

/var/www/nextcloud# sudo -u www-data php updater/updater.phar
Nextcloud Updater - version: v16.0.3-3-ga0c2b25 dirty

Current version is 18.0.0.

Update to Nextcloud 18.0.2 available. (channel: “stable”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-18.0.2.zip
Open changelog :arrow_upper_right:

Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done

Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[:heavy_check_mark:] Check for expected files
[✘] Check for write permissions failed
The following places can not be written to:
/var/www/nextcloud/updater/…/.user.ini
/var/www/nextcloud/updater/…/.htaccess

Update failed. To resume or retry just execute the updater again.

<<<the user.ini and htaccess do indeed not exist, and i believe this is correct since i am on nginx…??>>

This means the web server user (usually www-data or http) doesn’t have the rights to write files in the root folder of Nextcloud (in your case /var/www/nextcloud). Check that the web server user is the owner of the whole directory, and that it has write access.

1 Like

Very insightful. Indeed the owner of /var/www/nextcloud was root:root. I changed it to www-data:www-data and could successfully do this :
sudo -u www-data touch testfile
to the /var/www/nextcloud directory, and the file appeared :
-rw-r–r-- 1 www-data www-data 0 Mar 15 11:31 testfile
rebooted the server just in case, verified login and files ok, but still same problem.
IMHO nginx does not have htaccess at all, so it is true and by design that the files are not there.
Tried again and oups :smiley:
Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✘] Check for expected files failed
The following extra files have been found:
testfile
Update failed. To resume or retry just execute the updater again.

rm testfile

sudo -u “www-data” php updater/updater.phar
Nextcloud Updater - version: v16.0.3-3-ga0c2b25 dirty
[✘] Check for write permissions failed
The following places can not be written to:
/var/www/nextcloud/updater/…/.user.ini
/var/www/nextcloud/updater/…/.htaccess

Update failed. To resume or retry just execute the updater again

Please ls -alh /var/www/nextcloud to show permissions on the whole folder itself.

I confirm that even if the .htaccess file isn’t used by nginx, it’s bundled with each NC install.

very good again - thank you :
ls -alh /var/www/nextcloud
total 160K
drwxr-xr-x 14 www-data www-data 4.0K Mar 15 11:42 .
drwxr-xr-x 4 root root 4.0K Jan 19 22:30 …
-rw-r–r-- 1 root root 2.5K Jan 17 14:46 .htaccess
-rw-r–r-- 1 root root 101 Jan 17 14:46 .user.ini
drwxr-xr-x 33 www-data www-data 4.0K Jan 17 14:50 3rdparty
-rw-r–r-- 1 www-data www-data 16K Jan 17 14:46 AUTHORS
-rw-r–r-- 1 www-data www-data 34K Jan 17 14:46 COPYING


Seing clearly now, i
chown www-data:www-data .htaccess
chown www-data:www-data .user.ini

and now the updater is running
Great help - thank you very much :slight_smile:

Hi,

I like to share the findings I made on the update stucking in ‘Step 3’:
For to restart the update delete the file ‘.step’ in ‘/updater-’.

On my side I could start the update again but it stuck again. updater.phar gives a RuntimeException and aborted.

Solution: I deleted older backups and gained free space on the drive again.
The update runs through without complaining anymore.

Regards!
Fraengii