Nextcloud doesn't start after update

I upgraded the version from 25 to 26, first installed php 8, then downloaded the new version from here:

https://download.nextcloud.com/server/releases/

Following this guide, I proceeded to rename the old folder, move the new one and then copy the config folder to the new folder

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/manual_upgrade.html

when I try to access nextcloud from my browser I receive the following message:

Error

  • Can’t write into config directory!This can usually be fixed by giving the webserver write access to the config directory.

I tried to give read/write permissions but nothing, always the same message, could you tell me what I could do?

What system do you use? If you have debian/ubuntu, you could try:

sudo -u www-data ls -lisa /path/to/nextcloud

This should show you the permissions within the nextcloud folder, and it is executed by www-data (or use any other user that runs the php). If that shows an error, you can post the output without the sudo-part.

My suggestion would also be to check file permissions. Maybe you forgot the recursive tag or set the permissions before later changes.

What could also end up in weird error messages is having multiple php versions in use. I had one instance where I needed to remove all non used versions even after setting the default used version manually.

Gerneally you could set the error level higher in the config and look into the nextcloud error log to maybe get more detailed information on what this could be.
Alternatively, if it really has something to do with php, you could look at the error messages of your webserver.

I deleted the nextcloud folder, uninstalled php and reinstalled php8, I then continued by downloading version 26 of nextcloud again and placing it in /var/www/, nothing, I still get the same error as before

pi@raspberrypi:/var/www/nextcloud $ sudo -u www-data ls -lisa
total 1976
384769    4 drwxr-xr-x 13 root root    4096 Feb 17 12:13 .
129722    4 drwxr-xr-x  6 root root    4096 Feb 17 12:13 ..
515038    4 drwxr-xr-x 45 root root    4096 Feb 17 12:13 3rdparty
388497    4 drwxr-xr-x 50 root root    4096 Feb 17 12:13 apps
386766   20 -rw-r--r--  1 root root   19327 Feb 17 12:13 AUTHORS
386764    4 -rw-r--r--  1 root root    1283 Feb 17 12:13 composer.json
384773    4 -rw-r--r--  1 root root    3140 Feb 17 12:13 composer.lock
525363    4 drwxr-xr-x  2 root root    4096 Feb 17 12:13 config
386770    4 -rw-r--r--  1 root root    4095 Feb 17 12:13 console.php
428986   36 -rw-r--r--  1 root root   34520 Feb 17 12:13 COPYING
386793    4 drwxr-xr-x 24 root root    4096 Feb 17 12:13 core
386769    8 -rw-r--r--  1 root root    6317 Feb 17 12:13 cron.php
388330   12 drwxr-xr-x  2 root root   12288 Feb 17 12:13 dist
386767    8 -rw-r--r--  1 root root    4122 Feb 17 12:13 .htaccess
384793    4 -rw-r--r--  1 root root     156 Feb 17 12:13 index.html
384770    8 -rw-r--r--  1 root root    4103 Feb 17 12:13 index.php
384795    4 drwxr-xr-x  6 root root    4096 Feb 17 12:13 lib
386763    4 -rw-r--r--  1 root root     283 Feb 17 12:13 occ
384775    4 drwxr-xr-x  2 root root    4096 Feb 17 12:13 ocs
384771    4 drwxr-xr-x  2 root root    4096 Feb 17 12:13 ocs-provider
386765    8 -rw-r--r--  1 root root    6005 Feb 17 12:13 package.json
384774 1780 -rw-r--r--  1 root root 1819242 Feb 17 12:13 package-lock.json
428985    4 -rw-r--r--  1 root root    3187 Feb 17 12:13 public.php
384792    8 -rw-r--r--  1 root root    5597 Feb 17 12:13 remote.php
384779    4 drwxr-xr-x  4 root root    4096 Feb 17 12:13 resources
384794    4 -rw-r--r--  1 root root      26 Feb 17 12:13 robots.txt
386771    4 -rw-r--r--  1 root root    2452 Feb 17 12:13 status.php
386775    4 drwxr-xr-x  3 root root    4096 Feb 17 12:13 themes
386772    4 drwxr-xr-x  2 root root    4096 Feb 17 12:13 updater
428984    4 -rw-r--r--  1 root root     101 Feb 17 12:13 .user.ini
386768    4 -rw-r--r--  1 root root     385 Feb 17 12:13 version.php

Okay,
what I usually do it not setting permissions with chmod and the numbers but chown for the www-data user and group if you are using apache2.

This would need you to have to do this:

(sudo) chown -R www-data:www-data /var/www/nextcloud

Of cause assuming you have your nextcloud directory located there.

ok, now when I reload the page it tells me that there are updates available:

When I click on “start update” I get this error:
Update to 26.0.13

An error occurred.
Detailed logs
An error occurred.
if I try from terminal instead:

I would hint at the php module, that has not been updatet or been installed for the current php version and checking that it is enabled:

I used to upgrade using web UI, but it started timing out on me about 6 months ago, and I switched to using updater.phar. updater.phar never failed until today with this error. The fix was to follow the advises above:

  • install php-apcu module
  • set apc.enable_cli=1 in /etc/php/7.x/mods-available/apcu.ini
  • restart php-fpm
  • re-run sudo -u www-data php updater/updater.phar to finish the update to the latest version

Thank you so much @MacLemon @Bruno666!

This worked like a charm on Ubuntu server 20.04 running php 7.4. Thanks for posting!

I am referring this post from the nextcloud github

You would need to use the current 8.x folder in your case.

doing as you said:

Same errors with thenormal upgrade command?

sudo -u www-data php occ upgrade

php was set to 8.4, I set it to 8.2 and…

Now, finally, I can log in to version 26, thanks

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.