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.