Endless cleaning database, now won't boot


I’m running an RPi with the latest November release of OSMC. I use NextPVR, which runs on my Windows 10 “server”. Yesterday, I upgraded to NextPVR V5 by simply changing the port on the NextPVR addon to the port number (8867) I chose for NextPVR V5. Before I did this on the RPi, I did it on the Windows 10 machine, which is also running Kodi (18.5). I had no problems with it.

RPi/OSMC ran fine for a few hours yesterday, then seemed to get “stuck” in an endless “cleaning database” cycle. I couldn’t cancel it, but once I managed to unplug the RPi and reboot it, then quickly selected a recorded program to watch. That worked fine, but when I quit watching it, the RPi returned to the “cleaning database” again. It stayed in this mode all night.

This morning, I tried another round of unplugging/rebooting, with the intention of quickly grabbing some logs to post here, but now the RPi begins to boot, then it suddenly seems to get no power. The TV asks if it’s “On”. The last thing I see on my TV screen before the “is it on?” message is the raspberry icon.

There is no response when I try to ssh into the RPi.

I know this isn’t much to go on, but I wonder if anyone here has seen anything similar. It sounds to me – from what I’ve learned here – like I may have a bad SD card or a bad power supply, but the recent change to NextPVR V5 coupled with the endless cleaning database cycle adds a possible additional factor.

Thanks very much for any help.


It seems like your SD card may be problematic.

Some SD cards are not genuine or have a lower capacity than advertised. Some simply fail over time.

Symptoms of SD cards not working correctly are:

  • Read-only behaviour, or changes made not persisting
  • A filesystem corruption error

Symptoms of counterfeit SD cards are:

  • Writing works until a certain filesystem size is reached, thereafter, writes seem to cause issues where existing data is lost or newly written data is not preserved.
  • SD card fails after a short amount of time.

Counterfeit cards are usually found on Amazon and eBay.

SD cards have a limited lifespan. I recommend you change SD card and suspect that issues will no longer persist with a good card. If you would like to be a good quality SD card purpose manufactured for OSMC, then you can find one in the Store.

Can you elaborate on this. What exactly is happening on your display and with the lights on the RPi between the period of time where you insert power and whatever “suddenly seems to get no power” means.

Thanks Sam.

I had a new SD card here at home and installed OSMC 2020.10-1 on it. I loaded it into my RPi and the installation process completed successfully. Then I set about configuring it. I never took a backup, so I’m at square 1 and I’m having some difficulty.

First, I enabled the NextPVR addon and configured it exactly as it had been configured before (port and PIN). I got the message that it could not be loaded; an unknown error had occurred. Usually, this means my server is down, so I checked that, and it’s up.

Then I tried to add my SMB shares by going to Videos>Files>Add videos…>Browse>Add network location… I entered the SMB protocol and my server name and clicked “OK”. I got the message “Connection timed out”. This was working previously.

Then I tried to create logs, but ended up with the message “Could not retrieve URL Copy logs to SD card instead?” I went ahead and said “Yes”, but I don’t know how to retrieve the logs and post them.

So, it looks like OSMC is working, but I can’t seem to configure anything important. It’s almost as if I’m not connected to my network/internet, and I’m not sure how to check that. I did enter my network credentials during the installation process.

Thanks again very much for your support.

During the boot process, the display eventually shows a white screen with a red raspberry in the middle of it. I think, but I’m not sure, that this screen is what shows right before the OSMC screen displays.

Right after this screen displays, my TV loses connection to the RPi and asks if it’s on. If I try to ssh into the RPi at that point, it’s as if it’s not there. I don’t know what happens, but it’s as if I unplugged the power cable to the RPi.

I replied to Sam that, upon loading OSMC up on a new SD card, I now have a working OSMC running, but I’m struggling to configure it.

That’s odd, you shouldn’t be seeing the Raspberry Pi logo with an OSMC install that was made with our installer. Since you have started over again I guess it doesn’t really matter at this point. As for your SMB issue please refer to your previous thread…

I’ve never touched the PVR stuff so I personally can’t help with that.

My previous setup used a noobs installer. The new one doesn’t.

I think I’ve gone beyond the subject of this thread. I’m now struggling with a fresh install, so I’ll start a new thread.

The problem I’m currently having is with internet connectivity. I use an OSMC wifi adapter and, try as I might, I’m getting “no internet” when I try to connect. I’m sure there’s something I need to do to disable the onboard adapter, but I’m not sure what it is. I’ll keep looking. Meanwhile, any help would be appreciated.

Where do you see the ‘no internet’ connectivity sign? It is not always a reliable indicator of connectivity.

Hi Sam,

Apologies for the long message!

First, regarding the title of this thread, you correctly diagnosed the problem as a bad SD card. I had a new card in a drawer, re-installed OSMC on that card, and proceed to configure it. My problems with connectivity occurred while trying to configure the “new” system.

Regarding your question about “no internet”: When I navigate to My OSMC>Network then click on “Wireless”, I see “status” showing as “No internet”. Moreover, when I see this, then I also observe the following:

  • I can’t upload logs because My OSMC>Logs reports “can’t retrieve URL”. I believe this is evidence of no internet connection

  • I can’t access my PVR (NextPVR). I believe this is evidence of no local connection

  • I can’t SSH into the Pi. I believe this is also evidence of no local connection

So, evidently for me, when I get the message “No internet” in My OSMC, it means that I’ve got no connectivity whatsoever, local or internet.

The good news for me is that, after going through several long-running threads about 5G and the OSMC adapter (including one that I started in 2016), I realized (remembered?) that I needed to do the following to get full (internet and local net) connectivity with the OSMC adapter:

Add the line dtoverlay=sdhost to config.txt via My OSMC>Pi Config. This disables the onboard wifi adapter. Next, enter the following command on the Linux command line and reboot:

sudo mv /lib/firmware/mt7610u_sta.template.dat /lib/firmware/mt7610u_sta.dat

Upon doing these two things, I have full network connectivity at 5G. That said, a couple things linger:

When I reboot the Pi, I often end up without an internet connection (see above), and I end up re-connecting to my 5G SSID, including re-entering my credentials. I’m also not sure I’m getting the best speed out of the adapter, but it seems adequate for now. Finally, the adapter appears to see only 5G SSIDs now. If I wanted to connect to my 2.4G SSID, I could not. I don’t need to connect at 2.4G right now, so that’s not a big deal.

Having said the above, and acknowledging that I seem to be in OK shape for now, I’d like to pursue understanding these wireless connectivity problems with the OSMC adapter more deeply. I realize that solutions to these problems are becoming less and less interesting because newer hardware includes onboard 5G wifi adapters, but I have what I have and I’d like figure out how to get the most out of it if I can.

I’ve read many posts here on this topic and I summarize below what I’ve come to understand given my shallow Linux knowledge. Maybe I can use what I’ve read, fill some gaps in my knowledge, and get improved results from my adapter?

The consensus of most related posts here seems to be that the adapter is supposed to configure itself automatically, but sometimes it fails to do so correctly or completely. I’ve not seen any reason for this reported here. Regardless, it seems – to me anyway – that the result of the auto-configuration process is the creation (or updating) of this file:


I’m guessing that this file contains data needed by the OSMC adapter to connect.

Guessing again, in some cases, either this file does not get created or gets created with “bad” data in it, and the result is that the OSMC adapter can’t connect properly. Fortunately, a “template” file containing “good”, but not “perfect”, data is available in OSMC:


So when the configuration process fails, a “fix” is to replace the auto-generated file with the template file via a “move” command and rebooting. Most people, including me, report that this enables connectivity, but some note that the resulting connectivity is “slow” and sometimes unstable, with dropped connections. The fix for these issues seems to involve two (or three) things:

First, force the adapter to configure itself “automatically” again. I can’t tell exactly how to do this. I guess you either delete /lib/firmware/mt7610u_sta.dat or replace it with something else (.bak?) and reboot. Next, if the connection is unstable, edit /lib/firmware/mt7610u_sta.dat and manually enter the country code and the wireless mode. My country code is “US”, but I’m not sure what my wireless mode is. Finally, an occasional recommendation is to disable background scanning by adding the line

BackgroundScannign=false in /etc/connman.conf.

I’m wondering if my level of understanding is sufficiently good to pursue a better solution to my setup,maybe increased speed, visibility to 2.4G SSIDs, and maintenance of the wireless connection on reboot.

Should I try messing around with this or just accept what I have or maybe consider upgrading to a Pi 3B + or Pi 4? (Or Vero 4K?)

Thanks for your help. I appreciate the support I get here and enjoy using OSMC.


Sorry for the late reply. I wanted to read through this thoroughly and ensure that I gave you an adequate response.

This could simply mean that there’s no DNS, or default route, but there could still be an established connection.

My personal recommendation is that when you have connectivity issues, you should attach a keyboard and show us the output of route and compare it to the output when you have an established, working connection.

This can improve performance significantly in some situations; as the chipset doesn’t tolerate scanning for new networks while holding an existing connection that well. If you already have an established connection, there’s no need to search for newer connections.

I’d personally recommend sticking with 5Ghz for the best performance. Otherwise you’re not really going to benefit over the Pi’s built in wireless adapter which can handle 2.4Ghz quite adequately



Thanks Sam. No problem. And thanks for your patience in reading my long post above.

I will do this next time I have problems. The most frustrating part of my re-install process was gaining a network connection. I fiddled around for at least two hours. I’ll report my experience in another thread in case anyone is interested or could benefit from my experience.

Adding this line did improve my performance by about 50 percent. I agree, there’s no point in using 2.4G if I can get a 5G connection. I mentioned it only because I thought something might be wrong, or I was doing something wrong, which might have caused the 2.4 network to be “invisible” to the adapter.