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

Cannot update from v20.0.7.1 #5741

Closed
pseudoua opened this issue Nov 21, 2021 · 32 comments · Fixed by #5783
Closed

Cannot update from v20.0.7.1 #5741

pseudoua opened this issue Nov 21, 2021 · 32 comments · Fixed by #5783

Comments

@pseudoua
Copy link

pseudoua commented Nov 21, 2021

Updating \<mail\> ...
An unhandled exception has been thrown:
ArgumentCountError: Too few arguments to function OCA\Mail\Migration\ProvisionAccounts::__construct(), 0 passed in /srv/nextcloud/lib/private/Repair.php on line 127 and exactly 1 expected in /srv/nextcloud/apps/mail/lib/Migration/ProvisionAccounts.php:37
Stack trace:
#0 /srv/nextcloud/lib/private/Repair.php(127): OCA\Mail\Migration\ProvisionAccounts->__construct()
nextcloud/server#1 /srv/nextcloud/lib/private/legacy/OC_App.php(1035): OC\Repair->addStep()
nextcloud/server#2 /srv/nextcloud/lib/private/legacy/OC_App.php(979): OC_App::executeRepairSteps()
nextcloud/server#3 /srv/nextcloud/lib/private/Updater.php(379): OC_App::updateApp()
nextcloud/server#4 /srv/nextcloud/lib/private/Updater.php(258): OC\Updater->doAppUpgrade()
nextcloud/server#5 /srv/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade()
nextcloud/server#6 /srv/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
nextcloud/server#7 /srv/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
nextcloud/server#8 /srv/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run()
nextcloud/server#9 /srv/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
nextcloud/server#10 /srv/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
nextcloud/server#11 /srv/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
nextcloud/server#12 /srv/nextcloud/console.php(100): OC\Console\Application->run()
nextcloud/server#13 /srv/nextcloud/occ(11): require_once('/srv/nextcloud/...')
nextcloud/server#14 {main}
@szaimen szaimen transferred this issue from nextcloud/server Nov 21, 2021
@pseudoua
Copy link
Author

pseudoua commented Nov 21, 2021

When updating via the web, the database is not backed up?
Found only a directory tree in the backup folder. Those. I can't even roll back no
next.pdf
w

@pseudoua
Copy link
Author

image
Any user who is not even registered can click the refresh button

@ChristophWurst
Copy link
Member

/srv/nextcloud/lib/private/Repair.php on line 127

What version of Nextcloud is that?

@C-Magic
Copy link

C-Magic commented Nov 22, 2021

image

@ChristophWurst
Copy link
Member

This doesn't make sense. Your error said the exception was thrown on L127 but there is no such code there https://github.com/nextcloud/server/blob/68fecc1d9f6810e815c6a6ba80d4c13a0bde98b8/lib/private/Repair.php#L127

I would expect it to throw here instead https://github.com/nextcloud/server/blob/68fecc1d9f6810e815c6a6ba80d4c13a0bde98b8/lib/private/Repair.php#L143

@C-Magic
Copy link

C-Magic commented Nov 22, 2021

image

@miaulalala
Copy link
Contributor

@C-Magic can you compare your file to stable20 please? https://github.com/nextcloud/server/blob/stable20/lib/private/Repair.php#L129

@C-Magic
Copy link

C-Magic commented Nov 22, 2021

image
Difference:
blue - in git
green - in my

@miaulalala
Copy link
Contributor

How did you get your version? Did you pull it from Github?

@pseudoua
Copy link
Author

I do not remember. I remember trying to run it on docker, but there were a lot of problems in the finished solution, in particular, they were connected with ssl and Collabora, which were frozen, I launched it on LXC. Well, there were so many experiments that I can't even remember where I got the code from. But several times everything was updated normally through the console. This time I decided that once the product is a stable update via the web interface. And that's all. Everything is broken! Was it just lucky?

@no-response no-response bot removed the needs info label Nov 22, 2021
@pseudoua
Copy link
Author

If I just change this file, will it be correct?

@ChristophWurst
Copy link
Member

Replacing single files will likely cause more damage. Could you download an official package from https://download.nextcloud.com/server/releases/? E.g. the latest stable 20 and then replace your copy with that? As always: make backups before so you can restore the previous state.

@C-Magic
Copy link

C-Magic commented Nov 23, 2021

Found a snapshot of the previous update:
NextCloud 20.0.6 → 20.0.7 RC1
Collabora 3.7.11 → 3.7.14
Code 6.4.303 → 6.4.403
Polls 1.6.3 → 1.7.5
First version be latest-19.zip

Now I'll try to change it to latest-20.zip

@C-Magic
Copy link

C-Magic commented Nov 23, 2021

post replace by latest-20.zip
image
image

@ChristophWurst
Copy link
Member

you need to provide the relevant section(s) of your nextcloud.log

But may I ask you to put the upgrade issues to https://help.nextcloud.com/c/support/7? Github is not a support forum and so far we don't see a clear indication of a bug in Mail. Please use the forums to get your instance to a working version of nextcloud. Once that is done you can try to reproduce the Mail migration error when you enable the app. Leave the app disabled until then.

@C-Magic
Copy link

C-Magic commented Nov 23, 2021

Sorry! Forgot to roll back the database. Here is the real post. The previous one was after a second restoration without restoring the database
image
image

@C-Magic
Copy link

C-Magic commented Nov 23, 2021

image
I rolled back to version 20.0.6, which had previously been successfully upgraded to 20.0.7 RC1.
And tried again to update from it to fresh. Error too!
image

@m4rduc
Copy link

m4rduc commented Dec 1, 2021

I have a very similar problem docker container on unraid

root@7dbf3a08b34e:/# sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
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
Maintenance mode disabled
root@7dbf3a08b34e:/# sudo -u abc php /config/www/nextcloud/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
Turned on maintenance mode
Updating database schema
Updated database
Updating <mail> ...
An unhandled exception has been thrown:
ArgumentCountError: Too few arguments to function OCA\Mail\Migration\ProvisionAccounts::__construct(), 0 passed in /config/www/nextcloud/lib/private/Repair.php on line 122 and exactly 1 expected in /config/www/nextcloud/apps/mail/lib/Migration/ProvisionAccounts.php:37
Stack trace:
#0 /config/www/nextcloud/lib/private/Repair.php(122): OCA\Mail\Migration\ProvisionAccounts->__construct()
#1 /config/www/nextcloud/lib/private/legacy/OC_App.php(1035): OC\Repair->addStep()
#2 /config/www/nextcloud/lib/private/legacy/OC_App.php(979): OC_App::executeRepairSteps()
#3 /config/www/nextcloud/lib/private/Updater.php(375): OC_App::updateApp()
#4 /config/www/nextcloud/lib/private/Updater.php(254): OC\Updater->doAppUpgrade()
#5 /config/www/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade()
#6 /config/www/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#7 /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
#8 /config/www/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run()
#9 /config/www/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
#10 /config/www/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
#11 /config/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#12 /config/www/nextcloud/console.php(100): OC\Console\Application->run()
#13 /config/www/nextcloud/occ(11): require_once('/config/www/nex...')
#14 {main}root@7dbf3a08b34e:/#  

@samtuke
Copy link

samtuke commented Dec 2, 2021

I have the same error. Installed NC originally from official release tarball. CLI logs:

sudo -u apache 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
Turned on maintenance mode
Updating database schema
Updated database
Updating <mail> ...
An unhandled exception has been thrown:
ArgumentCountError: Too few arguments to function OCA\Mail\Migration\ProvisionAccounts::__construct(), 0 passed in /var/www/website.com/html/lib/private/Repair.php on line 129 and exactly 1 expected in /var/www/website.com/html/apps/mail/lib/Migration/ProvisionAccounts.php:37
Stack trace:
#0 /var/www/website.com/html/lib/private/Repair.php(129): OCA\Mail\Migration\ProvisionAccounts->__construct()
#1 /var/www/website.com/html/lib/private/legacy/OC_App.php(1053): OC\Repair->addStep('OCA\\Mail\\Migrat...')
#2 /var/www/website.com/html/lib/private/legacy/OC_App.php(997): OC_App::executeRepairSteps('mail', Array)
#3 /var/www/website.com/html/lib/private/Updater.php(386): OC_App::updateApp('mail')
#4 /var/www/website.com/html/lib/private/Updater.php(260): OC\Updater->doAppUpgrade()
#5 /var/www/website.com/html/lib/private/Updater.php(132): OC\Updater->doUpgrade('20.0.14.2', '20.0.12.1')
#6 /var/www/website.com/html/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#7 /var/www/website.com/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))
#8 /var/www/website.com/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))
#9 /var/www/website.com/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))
#10 /var/www/website.com/html/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/website.com/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/website.com/html/console.php(100): OC\Console\Application->run()
#13 /var/www/website.com/html/occ(11): require_once('/var/www/nextcl...')
#14 {main}

@samtuke
Copy link

samtuke commented Dec 2, 2021

If you need an urgent workaround to get your NC install up and running again (as I did), then follow the instructions here to disable the mail app from CLI, then your NC should finish the upgrade and work correctly: https://help.nextcloud.com/t/how-to-remove-apps-from-the-terminal/63569

@Rello
Copy link

Rello commented Dec 3, 2021

exact same issue here.
disabling the mail app works to finish the NC upgrade.

enabling the app afterwards again is still not possible

{"reqId":"YapRg-gUCT4nQS25-a15nwAAACc","level":3,"time":"2021-12-03T17:19:03+00:00","remoteAddr":"91.64.208.252","user":"BDAdminNC","app":"index","method":"POST","url":"/settings/apps/enable","message":{"Exception":"Exception","Message":"Too few arguments to function OCA\\Mail\\Migration\\ProvisionAccounts::__construct(), 0 passed in /homepages/34/d849701472/htdocs/nextcloud/lib/private/Repair.php on line 129 and exactly 1 expected","Code":0,"Trace":[{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.AppSettings.enableApps"}]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":110,"Previous":{"Exception":"ArgumentCountError","Message":"Too few arguments to function OCA\\Mail\\Migration\\ProvisionAccounts::__construct(), 0 passed in /homepages/34/d849701472/htdocs/nextcloud/lib/private/Repair.php on line 129 and exactly 1 expected","Code":0,"Trace":[{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/Repair.php","line":129,"function":"__construct","class":"OCA\\Mail\\Migration\\ProvisionAccounts","type":"->","args":[]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/legacy/OC_App.php","line":1053,"function":"addStep","class":"OC\\Repair","type":"->","args":["OCA\\Mail\\Migration\\ProvisionAccounts"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/Installer.php","line":160,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["mail",["OCA\\Mail\\Migration\\AddMissingDefaultTags","OCA\\Mail\\Migration\\AddMissingMessageIds","OCA\\Mail\\Migration\\FixCollectedAddresses","OCA\\Mail\\Migration\\FixBackgroundJobs","OCA\\Mail\\Migration\\MakeItineraryExtractorExecutable","OCA\\Mail\\Migration\\ProvisionAccounts"]]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":453,"function":"installApp","class":"OC\\Installer","type":"->","args":["mail"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":[["mail"],[]]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.AppSettings.enableApps"}]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/homepages/34/d849701472/htdocs/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/homepages/34/d849701472/htdocs/nextcloud/apps/mail/lib/Migration/ProvisionAccounts.php","Line":37},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15","version":"20.0.14.2"}

@ChristophWurst
Copy link
Member

@Rello you can still reproduce after the upgrade? This is great. You can help us 🤗

Do you remember the trick to track down a injected service that can't be loaded by the DI container? It must be something like that here. Could you comment out some of the constructor args of ProvisionAccounts or nested classes?

@ChristophWurst
Copy link
Member

nextcloud/server@40507ca was only added for 21. Therefore your installations also do 💥 when ILDAPProviderFactory can't be found.

@ChristophWurst
Copy link
Member

The fix can be found at #5783.

https://patch-diff.githubusercontent.com/raw/nextcloud/mail/pull/5783.patch is the patch. https://docs.nextcloud.com/server/latest/admin_manual/issues/applying_patch.html will guide you through the patching process.

I would appreciate if two of you could test and verify the patch. Once I got your confirmation I'll merge, backport and release.

✌️

@C-Magic
Copy link

C-Magic commented Dec 6, 2021

Weird!
Updated! (On the second try)
The service has started.
Proposed to upgrade to 21.0.7
Updating in progress

@ChristophWurst
Copy link
Member

Well welcome to Nextcloud 21.

I need test results for 20. 21 won't be affected. You won't see the error.

@C-Magic
Copy link

C-Magic commented Dec 6, 2021

Well my problem is solved, I was able to update from 20.07.
Thanks!
image
There is no mistake anymore

@C-Magic
Copy link

C-Magic commented Dec 6, 2021

If necessary, I can roll back to 20.0.6 and update again
...in progress

@Rello
Copy link

Rello commented Dec 6, 2021

Hi,
also confirmed to be working on 20.0.14
thank you!

@C-Magic
Copy link

C-Magic commented Dec 6, 2021

20.0.6 (mail 1.4.2 to 1.11.0) - OK (post patch)!
20.0.7 (mail 1.8.0 to 1.11.0) - OK (post patch)!

@ChristophWurst
Copy link
Member

Thanks for the quick testing feedback @Rello @C-Magic! ✌️

@C-Magic
Copy link

C-Magic commented Dec 6, 2021

pseudoua is also me (from home)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants