Integrity constraint violation: duplicate entry

Hi, I’m running NCP docker container on a Raspberry pi. I found the server in maintenance mode today, it says Music app needs an update but when I press update, it fails. I tried updating from NCP web panel and with occ command with docker exec. All fails. This is what I’m getting:

Cannot load Zend OPcache - it was already loaded
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
Set log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Updating …
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing ‘UPDATE oc_music_albums SET hash = ? WHERE id = ?’ with params [“ea9a343e944251f0130d99602272e1e2”, “14689”]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘-ea9a343e944251f0130d99602272e1e2’ for key ‘ma_user_id_hash_idx’
Update failed
Maintenance mode is kept active
Reset log level

I appreciate the help. Thanks!

I see that too. After updating to 17.0.5. The latter might just be a coincidence.

If it is only ncp struggling, it might be a good idea to post/move this to the ncp section of this forum.

Thanks mate. I moved the entry back to NCP section.
Is there anyway I could at least disable the app from occ so instance functions until I could fix the problem? Our family stuff like calendar, tasks etc… runs on it and its unusable at the moment.

You can use

sudo -u www-data php /var/www/nextcloud/occ app:disable music

if you can ssh into your server.

This issue should hopefully be fixed by Music v0.13.2 which was just released.

1 Like

Yea, fixed. Thanks!

1 Like