InvalidArgumentException: Index name "share_id_index" for table "NQo3N_onlyoffice_permissions" collides with the constraint on table "NQo3N_federated_reshares"

I have exactly the same problem, I posted a separate report as requested by Nextcloud as it went through the update process, and like most of you here, I have had no one come back and explain what seems to be the problem.

I did find this on Git though:

Hi @AndreasB92 ,

I had the exact same issue. I resolved it by running the following query against my database (MariaDB):

DROP INDEX share_id_index ON oc_onlyoffice_permissions;

This query, drops the index for table oc_onlyoffice_permissions. Afterwards the migration runs through and everything seems to work.

Hope that helps.