I've just updated my instance from (19.0.3 via 19.0.4 RC1) to Nextcloud 20 and got this error during occ upgrade. I then did just execute occ upgrade again and that time it continued and went through without error.
@ChristophWurst I'm not sure if this is something relevant or just a side effect of the non direct update maybe? Just let me know if it's a relevant issue and I can of course provide additional information about the setup otherwise feel free to just close it.
user@example:/var/www/nextcloud$ sudo -u www-data php occ upgrade
...
Checked for update of app "logreader" in appstore
Checking for update of app lookup_server_connector in appstore
Checked for update of app "lookup_server_connector" in appstore
Checking for update of app mail in appstore
Update app mail from appstore
An unhandled exception has been thrown:
Error: Class 'OCA\Mail\AppInfo\BootstrapSingleton' not found in /var/www/nextcloud/apps/mail/lib/AppInfo/Application.php:35
Stack trace:
#0 /var/www/nextcloud/lib/private/ServerContainer.php(108): OCA\Mail\AppInfo\Application->__construct()
#1 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\ServerContainer->getAppContainer('mail', 'Mail')
#2 /var/www/nextcloud/lib/private/ServerContainer.php(138): OC\ServerContainer->getAppContainerForService('OCA\\Mail\\Migrat...')
#3 /var/www/nextcloud/lib/private/DB/MigrationService.php(444): OC\ServerContainer->query('OCA\\Mail\\Migrat...')
#4 /var/www/nextcloud/lib/private/DB/MigrationService.php(468): OC\DB\MigrationService->createInstance('1050Date2020062...')
#5 /var/www/nextcloud/lib/private/DB/MigrationService.php(414): OC\DB\MigrationService->executeStep('1050Date2020062...', false)
#6 /var/www/nextcloud/lib/private/legacy/OC_App.php(976): OC\DB\MigrationService->migrate()
#7 /var/www/nextcloud/lib/private/Installer.php(206): OC_App::updateApp('mail')
#8 /var/www/nextcloud/lib/private/Updater.php(452): OC\Installer->updateAppstoreApp('mail')
#9 /var/www/nextcloud/lib/private/Updater.php(260): OC\Updater->upgradeAppStoreApps(Array)
#10 /var/www/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade('20.0.0.9', '19.0.4.0')
#11 /var/www/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#12 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#18 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
user@example:/var/www/nextcloud$ sudo -u www-data php occ upgrade
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
Setting log level to debug
Updating database schema
Updated database
Updating <mail> ...
Purify and migrate collected mail addresses
Done
6/6 [============================] 100%
Insert background jobs for all accounts
Done
2/2 [============================] 100%
Updated <mail> to 1.5.0
Checking for update of app accessibility in appstore
Checked for update of app "accessibility" in appstore
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore
...
php version is 7.3
This sounds a bit like the autoloader is not working correctly. That class exists, right?
Also had the problem, and I guess it's similar to an issue we had in Talk at some point.
The problem is the app is already loaded while occ upgrade downloads a newer version from the appstore and so classes that where already used have the old content and everything that was not loaded yet runs the new code.
I met the same problem when I upgraded from 19.0.3.1 to 20.0.0.9 based on docker.
I met the same problem when I upgraded from 19.0.3.1 to 20.0.0.9 based on docker.
I fixed this issue as following steps:
JFYI, I just saw this issue and want to mention that I also opened a bug at nextcloud server:
https://github.com/nextcloud/server/issues/23793 because I wasn't sure where to fix it, mail app or nextcloud server?
I had the same issue in a docker-image when upgrading nextcloud from 19.0.4.2 to 20.0.1.1
I fixed it by calling this
docker exec --user www-data nextcloud_app_1 php occ upgrade
Then I got another error, which is described here already: https://github.com/nextcloud/news/issues/876
I fixed that by calling the upgrade again:
docker exec --user www-data nextcloud_app_1 php occ upgrade
docker exec --user www-data nextcloud_app_1 php occ maintenance:mode --off
Got exact same issue as @rubo77 upgrading from 19.0.5 to 20.0.2 using the command line upgrader.
Just upgraded from 19.0.6 to 20.0.3 and got the same issue (updated via commandline).
had this problem on cli updater "occ upgrade" today.
did the update from 19.0.6 to 20.0.4.
after rerunning the "occ upgrade" command it went through the installation.
Mail app being loaded seems to be the issue in my case.
I tried to upgrade from NC 19.0.6 to 20.0.4 today and got the error from the issue title.
Upgrade was done on command line with updater.phar
Rolled back my DB and NC instance to the state before the upgrade.
On second try I disabled Mail app and did the upgrade again, all went fine.
After that, upgraded en enabled the mail app, no issues.
An unhandled exception has been thrown:
Error: Class 'OCA\Mail\AppInfo\BootstrapSingleton' not found in /var/www/nextcloud/html/apps/mail/lib/AppInfo/Application.php:35
Stack trace:
#0 /var/www/nextcloud/html/lib/private/ServerContainer.php(108): OCA\Mail\AppInfo\Application->__construct()
#1 /var/www/nextcloud/html/lib/private/ServerContainer.php(171): OC\ServerContainer->getAppContainer('mail', 'Mail')
#2 /var/www/nextcloud/html/lib/private/ServerContainer.php(138): OC\ServerContainer->getAppContainerForService('OCA\\Mail\\Migrat...')
#3 /var/www/nextcloud/html/lib/private/DB/MigrationService.php(449): OC\ServerContainer->query('OCA\\Mail\\Migrat...')
#4 /var/www/nextcloud/html/lib/private/DB/MigrationService.php(473): OC\DB\MigrationService->createInstance('1050Date2020062...')
#5 /var/www/nextcloud/html/lib/private/DB/MigrationService.php(419): OC\DB\MigrationService->executeStep('1050Date2020062...', false)
#6 /var/www/nextcloud/html/lib/private/legacy/OC_App.php(976): OC\DB\MigrationService->migrate()
#7 /var/www/nextcloud/html/lib/private/Installer.php(206): OC_App::updateApp('mail')
#8 /var/www/nextcloud/html/lib/private/Updater.php(456): OC\Installer->updateAppstoreApp('mail')
#9 /var/www/nextcloud/html/lib/private/Updater.php(264): OC\Updater->upgradeAppStoreApps(Array)
#10 /var/www/nextcloud/html/lib/private/Updater.php(130): OC\Updater->doUpgrade('20.0.4.0', '19.0.6.2')
#11 /var/www/nextcloud/html/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#12 /var/www/nextcloud/html/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/nextcloud/html/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/nextcloud/html/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/nextcloud/html/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/nextcloud/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/nextcloud/html/console.php(100): OC\Console\Application->run()
#18 /var/www/nextcloud/html/occ(11): require_once('/var/www/nextcl...')
oopsy..
Re-running the ./occ upgrade did fix the issue. But its not nice.
Can confirm with PHP 7.4
Updating Nextcloud from 20.0.4 to 20.0.5 went without this issue.
Prior to updating Mail 1.8.0 was installed.
So perhaps it only happens in case of a major version upgrade?
So perhaps it only happens in case of a major version upgrade?
It only happened for upgrades where the previous version of Mail had the BootstrapSingleton class and the new one didn't. So this is a one-time error that will hopefully only cause trouble once.
In the scope of this app there is still nothing we can really do about this. Nextcloud would have to change the way it loads app before and/or after the actual upgrade.
Thanks for clarifying.
Most helpful comment
I fixed this issue as following steps: