NC 12 stuck in upgrade mode


NC web interface is stuck requesting upgrade to 12.0.0

Even if I do the upgrade it still requests another upgrade.

The installation has been at v12 for some time.

This seems to have happened after I was working on some letsencrypt certificates

Any suggestions

Running on Ubuntu 16.04

If you have command-line access, I would run sudo -u www-data php /path/to/nc/occ upgrade (debian/ubuntu) until it has updated everything properly. It can occur when an app was updated.

Thanks for that. I ran upgrade and everything looked ok and is said it was successful. But It still says it requires upgrading. The status command gives the following

sudo -u www-data ./occ status
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade

  • installed: true
  • version:
  • versionstring: 12.0.0
  • edition:

So I’m still stuck with NC insisiting it requires upgrading.

Can you check your logfiles for more details and which app causes this problem?

Thanks for the quick reply. I’ve looked through some logs but don’t see anything. I may be looking through the wrong logs. Which logfile do you suggest (location/name). And anything that I should be looking for (grep any keywords). Thanks again

The nextcloud logfile is in data/nextcloud.log of the main nextcloud folder.

I ran occ upgrade and the log file indicated a fail

“level”:3,“time”:“2017-07-31T19:25:21+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“file_put_contents(/var/www/nextcloud/data/.htaccess): failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Setup.php#515”,“userAgent”:"–",“version”:“”}

I had a look at .htaccess and it showed -rw-r–r-- 1 root www-data

I executed the following script to relax permissions

#Sets permissions of the Nextcloud instance for updating
chown -R ${htuser}:${htgroup} ${ncpath}

The log no longer shows any fails and the log displays
message":"\OC\Updater::updateEnd: Update successful",“userAgent”:"–",“version”:“”}

but status shows
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade

  • installed: true
  • version:
  • versionstring: 12.0.0
  • edition:

I’m stuck now as to where to go from here. I cannot log into NC all I get is the perform update page.

Is there anything else I can check? Thanks for the help.

Did you try that again? More info in the logs? What version were you using before?

also, try 12.0.1RC perhaps…

Sorry for the delay in replying. I screwed up the LAMP stack with all my ‘fixes’. These are all sorted now but I’m still stuck with NC wanting to be updated even after a update is performed. What’s the best way of updating to 12.0.1RC

12.0.2 has been released, use this directly ( Just to avoid any inconveniences, I would do a manual upgrade:

  • backup database, data, config
  • delete everything but the config/ and data/ folder
  • get code from, extract it and fix the permissions (like with your script)
  • run sudo -u www-data php /var/www/nextcloud/occ upgrade
  • disable maintenance mode in case it stays active: - run sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
  • login again, enable the apps you need

Thanks for that. A manual upgrade fixed the problem.

I recently upgraded from to and now I’m stuck in the upgrade mode. I followed the steps from tflidd, but Nextcloud won’t come back to normal operation:

  • Webpage still shows:
    “Nextcloud will be updated to version 12.0.4”.
  • Updater.phar gives:
    [root@host updater]# sudo -u nginx php updater.phar -vvv Nextcloud Updater - version: v12.0.4RC1 Current version is 12.0.4. No update available. Nothing to do.
  • occ upgrade says:
    [root@host nextcloud]# sudo -u nginx php ./occ upgrade -vvv -n Nextcloud is already latest version
  • What makes me think is following log entry in the nextcloud.log:
    {“reqId”:“d0ZB3Be24ZBIoq0hts8x”,“level”:1,“time”:“2018-01-21T10:13:35+00:00”,“remoteAddr”:“”,“user”:"–",“app”:“updater”,“method”:“GET”,“url”:"/nextcloud/core/ajax/update.php?requesttoken=lgVgNNFJAU2jV8GBsp%2B3Sd58qfdQDLc7KNwjNpzDW7A%3D%3Azn03VpYrSgrJBLC09M7We49L45IjVOJUaYgSAeWpMN4%3D",“message”:"\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check",“userAgent”:“Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36”,“version”:“”}

Looks like something in the deep still reminds itself to Version

I cannot access the Admin Webpage any more, but I remember after upgrade the Version shown in the Admin Panel still showed 12.0.3.

Where does this version entry come from? This may be the root cause of the stuck in upgrade.

Thanks for any hints on that.

[UPDATE:] Forgot to mention the upgrade has been performed on december, 16th. After a system reboot some days ago the upgrade front page returned.

I fiddled with the installation and upgrade backwards/forwards, also returned to a kernel before metdown/spectre patches and so on, nothing fixed the problem. Then I found a hint in another forum, Nextcloud would not work with php version 7.2+
I then studied the dnf.rpm.log and found an upgrade entry from php-7.1.10 to php-7.1.13 and did a downgrade.
“dnf downgrade php-common”

Nextcloud returned to normal operation instantly.

So I have to hold on that version for now!

Hope this helps someone else.


[UPDATE:] For versionlock do the following:
“dnf install ‘dnf-command(versionlock)’”
“dnf versionlock php-*”

NC 13 and later will support PHP 7.2.