Solved Nextcloud - update to 20.0.2 failed
Our nextcloud instance made an update to 20.0.2
The migration script is failing...
Add primary key to the filecache_extended table
--> can't add primary key on fileid
The server is in a deadloop where the migration script is launched
We need to get our instance back
Help would be really appreciated
indeed you are not the first one to hit this. Unfortunately some Nextcloud instances for some so far unknown reason created duplicate file ids in the database and the latest version requires a primary key on those (meaning also that they have to be unique)
I saw that you contacted us on support with SSH enabled, I will take a look to see if we can find a solution besides restoring the app instance to the previous version.
@girish Thanks but how can we have this settled ?
I have already sent an email to support
What's their usual reponse time ?
@dimitri-veny We try to respond as quickly as we can. Not sure which plan you are on, but we only have priority support for the paid plans - https://www.cloudron.io/pricing.html
https://github.com/nextcloud/server/issues/19494 seems to be a similar upstream issue.
@dimitri-veny Just a heads up, we are close to a solution.
So it looks like the following SQL snippet will fixup that table and then lets Nextcloud create that primary key and thus be up and running again:
CREATE TABLE foobar AS SELECT fileid, metadata_etag, creation_time, MAX(upload_time) AS upload_time FROM oc_filecache_extended GROUP BY fileid, metadata_etag, creation_time; DROP TABLE oc_filecache_extended; ALTER TABLE foobar RENAME TO oc_filecache_extended;
I will try to test this on another instance first and then we make a new app package with that fix for others.
@Dimitri-Veny can you please report if your instance works as expected?
@nebulon thanks a lot for your help !!
I confirm that our instance works correctly now