Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Class 'OCA\Mail\AppInfo\BootstrapSingleton' not found in /var/www/nextcloud/apps/mail/lib/AppInfo/Application.php:35 #3727

Closed
violoncelloCH opened this issue Oct 5, 2020 · 17 comments

Comments

@violoncelloCH
Copy link
Member

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

@ChristophWurst
Copy link
Member

This sounds a bit like the autoloader is not working correctly. That class exists, right?

@nickvergessen
Copy link
Member

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.

@gamedebug
Copy link

I met the same problem when I upgraded from 19.0.3.1 to 20.0.0.9 based on docker.

@gamedebug
Copy link

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:

  1. $ sudo docker exec -u www-data my_nextcloud php occ maintenance:mode --off
  2. Access my nextcloud web URL via browser;
  3. Click "Start upgrade" and wait for it's done.

@ntlspck

This comment has been minimized.

@rubo77
Copy link

rubo77 commented Nov 4, 2020

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: nextcloud/news#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   

@loxK
Copy link

loxK commented Nov 28, 2020

Got exact same issue as @rubo77 upgrading from 19.0.5 to 20.0.2 using the command line upgrader.

@XueSheng-GIT
Copy link

Just upgraded from 19.0.6 to 20.0.3 and got the same issue (updated via commandline).

@kinimodmeyer
Copy link

kinimodmeyer commented Dec 16, 2020

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.

@mjanssens
Copy link

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.

@melroy89
Copy link

melroy89 commented Jan 6, 2021

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.

@okias
Copy link

okias commented Jan 12, 2021

Can confirm with PHP 7.4

@mjanssens
Copy link

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?

@ChristophWurst
Copy link
Member

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.

@mjanssens
Copy link

Thanks for clarifying.

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
@alexhass

This comment has been minimized.

@stale stale bot closed this as completed Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests