Clean Library not working

Hi all.

Not sure if this is OSMC or KODI but I’m pretty sure it only started happening since I installed the September 2022 update. I’ve checked multiple years of posts and not found anything that relates to music.

I’m using a VERO 4k+ box.

I’ve remotely accessed my media disk and deleted several folders of songs. The entire folders are gone, no images or trailing files remain.

When i run Clean Library (under the music section) it finishes instantly and the tracks remain in my library. I’ve checked the logs and I’m seeing

2022-10-04 19:52:49.014 T:3047     INFO <general>: Cleanup: Starting musicdatabase cleanup ..
2022-10-04 19:52:49.029 T:3047    ERROR <general>: SQL: [MyMusic82.db] SQLite error SQLITE_ERROR (no such trigger: tgrDeleteSongArtist)
                                                   Query: DROP TRIGGER tgrDeleteSongArtist (no such trigger: tgrDeleteSongArtist)
2022-10-04 19:52:49.031 T:3047    ERROR <general>: Process error processing job MusicLibraryCleaningJob
2022-10-04 19:52:50.378 T:3446     INFO <general>: SEREN (-1): Seren, Running Path - {'action': 'cleanOrphanedMetadata'}

Logs located at:

Any ideas?

Additional info… Since I’ve found the actual error message I’ve now found a few relevant posts on KODI which suggest a database update has failed and that a possible solution is to delete and rebuild it. However I did just that only 2 days ago when I first noticed this issue. Of course the rebuild didn’t include deleted folders, but since then I have deleted more and the error has recurred.

And I’ve solved it.

Using the guide on this page (Music dabatase cannot be cleaned anymore) and the SQL editor recommended, I copied the “MyMusic82.db” file from “/home/osmc/.kodi/userdata/Database” to my PC and ran the commands to re-insert the missing procedures, copied it back and the clean ran perfectly.

Will leave all this here in case someone else encounters the same issue.