julien-nc / phonetrack

Nextcloud app to create tracking sessions to display phones position in real time and export activity to gpx.
GNU Affero General Public License v3.0
47 stars 6 forks source link

Error updating to Nextcloud 28.0.2 - Index name "phonetrack_timestamp_index" for table "oc_phonetrack_points" collides with the constraint on table "oc_phonetrack_points_test". #31

Closed michal0202 closed 3 months ago

michal0202 commented 4 months ago

While updating to Nextcloud 28.0.2 from 27.1.6(Nextcloud Updater - version: v27.1.0rc3-15-gfa7af53, Phonetrack 0.7.7 – 2023-12-13) I got this error.

Log from the updater: Nextcloud Updater - version: v27.1.0rc3-15-gfa7af53

Current version is 27.1.6.

Update to Nextcloud 28.0.2 available. (channel: "stable") Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-28.0.2.zip Open changelog ↗

Updater run in non-interactive mode.

Start update

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files [✔] Check for write permissions [✔] Create backup [✔] Downloading [✔] Verify integrity [✔] Extracting [✔] Enable maintenance mode [✔] Replace entry points [✔] Delete old files [✔] Move new files in place [✔] Done

Update of code successful. Updater run in non-interactive mode - will start "occ upgrade" now.

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 Repair step: Repair MySQL collation Repair info: All tables already have the correct collation -> nothing to do Repair step: Copy data from accounts table when migrating from ownCloud Repair step: Drop account terms table when migrating from ownCloud Updating database schema Exception: Database error when running migration 28000Date20230906104802 for app core Index name "phonetrack_deviceid_index" for table "oc_phonetrack_points" collides with the constraint on table "oc_phonetrack_points_test". Update failed Maintenance mode is kept active Resetting log level

Updater run in non-interactive mode - will disable maintenance mode now. 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

Maintenance mode is disabled 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

Running "occ upgrade" returns:

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 Updating database schema Exception: Database error when running migration 28000Date20230906104802 for app core Index name "phonetrack_timestamp_index" for table "oc_phonetrack_points" collides with the constraint on table "oc_phonetrack_points_test". Update failed Maintenance mode is kept active Resetting log level

julien-nc commented 3 months ago

Hmmm the oc_phonetrack_points_test table is not supposed to exist. Did you create it manually?

michal0202 commented 3 months ago

No. This is my production instance, I don't mess with the database. Can I manually remove it to update nextcloud?

julien-nc commented 3 months ago

If the oc_phonetrack_points_test table really exists in your DB, yes you can drop it, it is not used.

michal0202 commented 3 months ago

After deleting the table, I was able to update nextcloud it without any problems.