Nextcloud is already the latest version

There are some posts on this but most are quite old. Nextcloud informs me that there is a next version:

When I try the updater, it fails:

Running occ upgrade reports that it’s already the latest version?

Bit confused now!

This is because the web based updater didn’t finish preparing the upgrade. You can try to start the updater from the command line instead:

sudo -u nginx php --define apc.enable_cli=1 /path/to/nextcloud/updater/updater.phar

Once the updater completed successfully, you can try to run to the occ upgrade command again.

If the CLI Updater is throwing an error as well while creating the backup, there is some problem on your server. Possible reasons for the backup to fail:

  • wrong permissions / ownership on some of the files or folders in your Nextcloud or Nextcloud data folder
  • SELinux or AppArmor set too restrictively
  • Insufficient disk space

Thanks for the CLI update command. I’ll give that a go. I have had permissions problems with previous updates but the last update was fine.

Later… command line does give more information. Yes, it’s permissions. Looking at the system change log for this server, the last thing done was to configure APCu and enable 4-byte support. This required a change to config.php and I naturally made a backup copy.

It’s a shame that the web based reported can’t display the output of the commands. I assuming it’s running something similar to the command line updater internally.

I guess I should raise a couple of requests on github around this as a supplemental problem with updater.phar in that if prompts if you want to upgrade the database but then fails with an APCu error:

Should the “occ upgrade” command be executed? [Y/n] y
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

I’m assuming that this is because it’s not executing the PHP occ command with the –define apc.enable_cli=1 option.

It then prompts to disable maintenance mode but this also fails with a similar problem. It also infers that maintenance mode is disabled but it’s not - I had to manually turn it off in config.php:

Keep maintenance mode active? [y/N]
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

Maintenance mode is disabled

As the documentation is peppered with warnings about apc.enable_cli=1, I would suspect that these scripts should be more aware of it. Detecting that APUc is enabled and using the option itself?

I’m no expert and no developer, but I try to answer your questions as good as I can…

Yes, the php-apcu module has to be installed and yes you have to enable globally in the php.ini or you have to add –define apc.enable_cli=1 option to your commands in order to use it.

Afaik this isnt’t an issue that can or should be solved by the scripts, because the same script can run with or without APCu. Large scripts (like updater.phar) are just more likely to crash without it, or the general performance of Nextcloud is likely to be worse. That’s why they recommend to use it everywhere.

The reason why they specifically recommend to add the --define apc.enable_cli=1 option to every command is because on many systems it isn’t globally enabled for the CLI, even if the php-apcu package is installed. See here… https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id1

1 Like

What’s I’m saying is that updater.phar should determine whether it’s been run with apc.enable_cli=1 and if so pass the same command when (I assume) it executes occ upgrade itself.

I’ve deferred from editing the global php.ini file to add apc.enable_cli=1 as I’m a little wary of what effect it might have on other PHP apps on the same server.

Total aside - first time I’ve ever come across phar files… had to read up on what they are. I’m a “PHP dabbler” when it comes to development. Can read/edit it but never comfortably :wink:

There is no hard requirement to use APCu. Also, if you don’t want to enable it globally you can just run every Nextcloud related command with the apc.enable_cli=1 option. In order to make things easy, you could create two bash aliases in ~/.bash_aliases, like this:

alias nocc="sudo -u www-data php --define apc.enable_cli=1 /var/www/html/nextcloud/occ"
alias ncupdate="sudo -u www-data php --define apc.enable_cli=1 /var/www/html/nextcloud/updater/updater.phar"

…then you only have to type ncupdate and nocc upgrade in order to upgrade your instance.

1 Like

I have no problem with this although it makes the command rather convoluted. An alias is a reasonable suggestion.

But the fact the PHP updater script fails by not passing the option to occ upgrade is still a clear flaw.

Well, there might still be instances out there with ≤ 512MB of RAM that don’t use any memory cache at all.

We don’t need to discuss how useful it is to use Nextcloud in such a configuration. However, fact is, instances like this are still supported and they do still work for very basic file sharing tasks, even though Nextcloud is recommending a minimum of 512MB per PHP process. System requirements — Nextcloud latest Administration Manual latest documentation

Anyways, if you think think the devs should be made aware of this, I recommend to open an issue / feature request on GitHub.