Open dartcafe opened 1 year ago
cc @nextcloud/server-backend
Same with https://github.com/nextcloud/mail/issues/8146 and https://github.com/nextcloud/calendar/issues/5191
Summary: the app migration/repair step are run with a mix of old app code and new app code.
I think the only possible fix is to run migrations and repair steps in a new process
https://github.com/search?q=repo%3Anextcloud%2Fmail+method_exists+path%3A%2F%5Elib%5C%2FMigration%5C%2F%2F&type=code for all the previous monkey patches
Obviously there are other problems with apps after an update and a not refreshed cache. I would say there should be a straight solution, since it seems there are a lot of people running into this trap, especially users of hosted Nextcloud solutions, who do not have the necessary admin experience to solve that on their own.
Recently problems after (not durien) an app update:
Let's keep separate issues separate
1) In-process replacement of code during an app update (this ticket) 2) Lack of opcache refresh after changed code: https://github.com/nextcloud/server/issues/39079
These require two distinct fixes.
I assumed, this could be the same fix. Nevermind, I'll hide my comment to avoid useless discussions.
Possibky this was fixed with https://github.com/nextcloud/server/pull/40349
Will check it with 28 beta
I tried to reproduce this error in 27.1.3 before updating to 28-beta1, but the migration runs thru with new methods. So it seems it is already fixed in 27.
In 28-beta1 the problem does not occur as well.
I do not think this is fixed. See https://github.com/nextcloud/server/issues/38158#issuecomment-1613535701 for the distinction of the two problems with caching code. One was fixed, the other wasn't.
Funny thing. If it is still present, then I did something weird while trying to reproduce it. I was sure, I provocated the issue by adding and calling new methods to the repais steps. I will try my luck again.
Reopen?
calling new methods to the repais steps
It works if the class hasn't been loaded prior to code replacement.
Works: 1) Nextcloud boots 2) Nextcloud replaces app code 3) Nextcloud runs upgrade routine 4) Upgrade routine loads app class
Doesn't work 1) Nextcloud boots and loads an app class 2) Nextcloud replaces app code 3) Nextcloud runs upgrade routine 4) Upgrade routine calls new method on the old version of the class
Related: #9781
⚠️ This issue respects the following points: ⚠️
Bug description
When updating an app (here it is Polls) via occ it seems that altered classes, which are used inside a repair step get not updated properly (caching??). A second update run then installs the app with out an exception.
Steps to reproduce
See details here: https://github.com/nextcloud/polls/issues/2900 and https://github.com/nextcloud/polls/issues/2793
Expected behavior
changed classes should be loaded properly while updating an app.
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
26
Operating system
None
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
The method OCA\Polls\Db\TableManager::deleteAllDuplicates() was added in the last Polls version (5.0.5).
The error trace is taken from https://github.com/nextcloud/polls/issues/2900 The system configuration is taken from my test instance, where I could observe this problem too.