Clean Video Library or "This file is no longer available" not working

I’m sure this isn’t OSMC specific but I am unable to resolve this issue with my Kodi installs on my RPIs…

I currently have a few RPIs setup, 3 with OSMC (1 RPI B and 2 with B+) and another that is what I call my Media Server. The Media Server is running RaspiBian with mySQL that manages all my Music and Videos, SMB share, no password and static IP address.

I recently started removing Movies from my SMB share and Cleaning the Video Library, I noticed that my Movies were not being removed from the Movie list (after rebooting the Media Server and the RPIs). The next issue, when I go to play this deleted video it say “This file is no longer available”, which is correct, it asks me if I would like to remove it, if I say yes, the list refreshes but still shows the Movie in my list.

I was hoping that someone would be able to assist me in resolving this issue. I am hoping to avoid a purge of my SQL database, etc.

My advancedsetting.xml is pretty basic (perhaps “importwatchedstate” is doing something more?):

<advancedsettings>
        <videodatabase>
            <type>mysql</type>
            <host>192.168.0.x</host>
            <port>3306</port>
            <user>redacted</user>
            <pass>redacted</pass>
            <name>kodi_video</name>
            </videodatabase>
    <videolibrary>
            <importwatchedstate>true</importwatchedstate>
    </videolibrary>

    <musicdatabase>
            <type>mysql</type>
            <host>192.168.0.x</host>
            <port>3306</port>
            <user>redacted</user>
            <pass>redacted</pass>
            <name>kodi_music</name>
    </musicdatabase>
</advancedsettings>

My sources.xml file contains this and a few more sources that aren’t being used:

<location id="1">smb://192.168.0.x/</location>

redacted pass and user even if you dont mind it being posted there are people who thrive on information like that on the net :smile:

I’m not using the OSMC skin any longer, but the skin eminence. In this skin, it was not possible for me to clean the library for removed files - i had to switch to confluence skin and then go to Settings → Videos → Library and
activate advanced functions - then i was able to clean the library, which deletes all files that are no longer accesible.

After switching back to my normal skin eminence, it was possible to clean the skin from within here also. It may be the same for the OSMC skin? After i cleaned the library, i made a library update for good reasons :smile:

Thank you for the suggestions @Crunchy. I did a little more searching today within my log file, which lead me to this article: frodo B1 - Music DB Cleanup fails

The above article seemed to have resolved my issue. The mySQL config file has a thread_stack variable, my (like the article) was set to 128k, changing to 256k resolved the issue (after restarting the service for mysql and running Clean).

MySQL is on a Raspberry Pi, I may have found and article in the past that would optimize it running on a pi (which could have caused the issue), but I am unsure at this point. If I compare with a backup file I will report.