Upgrade issues with occ throwing an exception on docker

Hello,

I’ve upgraded my nextcloud from 21 to 22 in Docker, had issues, dropped back to mariadb:10.5 (I’m using the mariadb/nextcloud:alpine-fpm/redis:alpine example image setup behind a reverse proxy) and whenever I use “php occ” in the www-data command line, I’m having issues.

I found I was experiencing this issue: (PHP fatal error due to PSR-11 · Issue #28972 · nextcloud/server · GitHub) and after fixing it, any php occ command generates the following exception:

An unhandled exception has been thrown:
TypeError: OC\App\AppManager::__construct(): Argument #7 ($logger) must be of type OCP\ILogger, OC\Log\PsrLoggerAdapter given, called in /var/www/html/lib/private/Server.php on line 880 and defined in /var/www/html/lib/private/App/AppManager.php:115
Stack trace:
#0 /var/www/html/lib/private/Server.php(880): OC\App\AppManager->__construct(Object(OC\User\Session), Object(OC\AllConfig), Object(OC\AppConfig), Object(OC\Group\Manager), Object(OC\Memcache\Factory), Object(OC\EventDispatcher\SymfonyAdapter), Object(OC\Log\PsrLoggerAdapter))
#1 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC{closure}(Object(OC\Server))
#2 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#3 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet(‘OC\App\AppManag…’)
#4 /var/www/html/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query(‘OC\App\AppManag…’, false)
#5 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OC\App\AppManag…’)
#6 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(182): OC\AppFramework\Utility\SimpleContainer->get(‘OC\App\AppManag…’)
#7 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#8 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#9 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet(‘OCP\App\IAppMan…’)
#10 /var/www/html/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query(‘OCP\App\IAppMan…’, false)
#11 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OCP\App\IAppMan…’)
#12 /var/www/html/lib/private/Server.php(1919): OC\AppFramework\Utility\SimpleContainer->get(‘OCP\App\IAppMan…’)
#13 /var/www/html/lib/private/legacy/OC_App.php(384): OC\Server->getAppManager()
#14 /var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php(82): OC_App::getEnabledApps()
#15 /var/www/html/lib/base.php(640): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
#16 /var/www/html/lib/base.php(1083): OC::init()
#17 /var/www/html/console.php(48): require_once(’/var/www/html/l…’)
#18 /var/www/html/occ(11): require_once(’/var/www/html/c…’)
#19 {main}

I did restore /var/www/html to a backup from prior to the upgrade when I experienced the mariadb 10.6 compressed rows issue, and now I’m just loss. Any help would be appreciated!

Also, if there’s more information I can add to help, please let me know–I’m new to Nextcloud upgrades.

I understand the issue a little bit more now, in the thread attached evolozzy had php-psr and php-psr-container installed on his Ubuntu system. They seem to be included in the alpine image, but I cannot seem to delete those packages within the container–maybe I can roll them back somehow? Any advice?

only if you have a backup of your old database. that is to say the one that run with nc21.

that’s exactly what containers are made for. :wink:
you would need a new image. but since your error is in the “inconsistent” state of your setup you can fix this also with a new image.

do you have a “lot” of data in your database? contacts, calendar, app settings? otherwise just start over, re-import your data files and go on.

In the issue I linked, it seems as if the real fix for the user came from removing php-psr and php-psr-container–changing the server code led to this issue I posted. As the alpine base image comes with similar packages causing the checks, and I cannot remove them with an apk del command, it seems as if the current nextcloud container has a bug without a workaround.

/var/www/html # apk list | grep psr
php7-pecl-psr-1.1.0-r0 x86_64 {php7-pecl-psr} (BSD-2-Clause)
php8-pecl-psr-1.1.0-r0 x86_64 {php8-pecl-psr} (BSD-2-Clause)

apk del seems to do nothing. Is there any other way to disable the PSR checks within the container image?

Ah, seems as if the issue was something with the state, not me.