Occ app:enable photos not work with Database error

Nextcloud 29.0.4
Photos 2.5.0
Memories 7.3.1

Hi,

after playing around with photos and memories and what related both apps to albums i can not enable photos because this error appear:

Database error when running migration 3000Date20240417075404 for app photos An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'papa-photos-photosSourceFolders' for key 'PRIMARY'

My question:

How can i fix this with mariadb-client?
Is there a way to remove ‘shipped’ apps like photos to reinstall this app?

Thanks a lot!
Regards

Can you provide the output of the following:

occ user:setting USERNAME photos

(adjust as appropriate for running occ commands in your environment)

www-data@nc:~/html$ php occ user:setting papa photos

  • photos:
    • croppedLayout: true
    • photosLocation: /Meins/Fotos
    • photosSourceFolder: /
    • photosSourceFolders: [“/Meins”,“/Heikes Fotos”]
  • settings:
    • display_name: papa

:thinking: Your environment looks like it’s already been running the newer Photos app version and/or ran that db migration previously.

You mentioned you’ve been playing around with Photos, but then can’t enable photos again.

Can you elaborate a bit on how you ended up here? How did Photos get disabled?

The output of the following might be interesting too, but it’s possible the issue isn’t the db migration itself, but that somehow you were running the newer Photos version then… well, I’m not sure how you ended up here. Just gathering info at the moment to maybe figure out the cause of this mystery. :slight_smile:

NC_debug=1 ./occ  migrations:status photos

Hi jtr,

thanks a lot for your support. I will answer later or tomorrow …

That’s it…

see also here:

https://github.com/nextcloud/photos/issues/2555