Upgrade from 27 to 28 error message

[/details]

Nextcloud version (eg, 20.0.5): 27.1.6
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): 2.4.56
PHP version (eg, 7.4): 8.1

The issue you are facing:

When I want upgrade from 27.1.6 to 28.x.x I have this error :

root@siegsrv0cld01:/var/www/nextcloud# sudo -u www-data php occ upgrade

An unhandled exception has been thrown:

TypeError: OCA\Theming\ImageManager::__construct(): Argument #5 ($logger) must be of type OCP\ILogger, OC\Log\PsrLoggerAdapter given, called in /var/www/nextcloud/lib/private/Server.php on line 1181 and defined in /var/www/nextcloud/apps/theming/lib/ImageManager.php:65

Stack trace:

#0 /var/www/nextcloud/lib/private/Server.php(1181): OCA\Theming\ImageManager->__construct()

#1 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\Server->OC{closure}()

#2 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()

#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): Pimple\Container->offsetGet()

#4 /var/www/nextcloud/lib/private/ServerContainer.php(173): OC\AppFramework\Utility\SimpleContainer->query()

#5 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(64): OC\ServerContainer->query()

#6 /var/www/nextcloud/lib/private/Server.php(2110): OC\AppFramework\Utility\SimpleContainer->get()

#7 /var/www/nextcloud/lib/private/Console/Application.php(62): OC\Server->getThemingDefaults()

#8 /var/www/nextcloud/console.php(97): OC\Console\Application->__construct()

#9 /var/www/nextcloud/occ(11): require_once(‘…’)

#10 {main}Vous avez du courrier dans /var/mail/root

I don’t have any problem when I update from 27.x.x to 27.x.x

It looks like your environment has an older version of the shipped theming app in-place still.

Did you just do a standard command-line update (i.e. updater.phar) before running occ upgrade or was it a manual update?

@jtr Thanks for your answer, yes I already try to done update.phar before and I had the same problem. And the command don’t purpose 28.x.x version olny 27.x.x
I don’t have any problem when I update manualy from 27.x.x to 27.x.x only when I try from 27.x.x to 28.x.x

Okay, since you’re doing a a manual update: Please check that you are updating your apps folder as well, described in the documentation[1].

The error regarding ILogger comes from having the older v27 theming app still installed rather than the new one that comes with the update to v28. The ILogger line in ImageManager.php doesn’t exist in v28.

My guess is you just overlooked manually updating the apps folder or something (since it was a manual update).

Though I’m concerned about why you weren’t offered the update via the updater.phar. Perhaps your CLI PHP version isn’t the same version as the mod_php/Apache one?

[1] Upgrade manually — Nextcloud latest Administration Manual latest documentation