Error: Call to undefined method OCA\Federation\AppInfo\Application::setupCron() in /var/www/nextcloud/apps/federation/appinfo/update.php:23

sudo -u www-data php occ upgrade
sudo: unable to resolve host nextcloud
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
Set log level to debug
Turned on maintenance mode
Checking whether the database schema can be updated (this can take a long time depending on the database size)
Done
27/27 [============================] 100%
Checked database schema update
Checking updates of apps
Checking whether the database schema for can be updated (this can take a long time depending on the database size)
Done
2/2 [============================] 100%
Checking whether the database schema for can be updated (this can take a long time depending on the database size)
Done
10/10 [============================] 100%
Checking whether the database schema for can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <files_sharing> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <files_trashbin> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checked database schema update for apps
Updating database schema
Updated database
Updating …
An unhandled exception has been thrown:
Error: Call to undefined method OCA\Federation\AppInfo\Application::setupCron() in /var/www/nextcloud/apps/federation/appinfo/update.php:23
Stack trace:
#0 /var/www/nextcloud/lib/private/legacy/app.php(1228): include()
#1 /var/www/nextcloud/lib/private/Updater.php(402): OC_App::updateApp(‘federation’)
#2 /var/www/nextcloud/lib/private/Updater.php(278): OC\Updater->doAppUpgrade()
#3 /var/www/nextcloud/lib/private/Updater.php(151): OC\Updater->doUpgrade(‘9.1.1.5’, ‘9.0.52.0’)
#4 /var/www/nextcloud/core/Command/Upgrade.php(292): OC\Updater->upgrade()
#5 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(259): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(844): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/nextcloud/3rdparty/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/nextcloud/lib/private/Console/Application.php(146): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/nextcloud/console.php(90): OC\Console\Application->run()
#11 /var/www/nextcloud/occ(11): require_once(’/var/www/nextcl…’)
#12 {main}root@nextcloud:/var/www/nextcloud