Restart loop - help troubleshoot, please
#1
Hi,

I'm running LibreElec 11.0.3 in a PC, with Kodi 20.2.0.

I had this problem in a previous version (19.x), but it somehow went away after a few weeks. This time I'd like to find the cause if possible, because it's quite annoying when it happens...

It seems to start when I add new movies to the library. Yesterday I added 3 of them to my storage. Then I updated the Kodi library. After that, if I either 1) start/stop watching any video, or 2) reboot the computer, Kodi goes into the restart loop until it reboots in safe mode. Then I stop Kodi, restore my latest backup, and reboot. And it's back to normal (apparently). If I update the library again, it all happens again.

I don't have many add-ons installed. But the Aeon Nox Silvo skin might be playing a part here too. I seem to remember I didn't have the same problem when I went back to Estuary. Didn't try this time (yet).

I'm looking at the logs but nothing stands out to me. Can someone please take a look and point me where to go? This is the latest crash log here.

Thank you,

VMat
Reply
#2
I can reproduce this with Aeon Nox Silvo @mikeSiLVO

Crashes in a python script which although I can't 100% confirm, appears to be script.skinshortcuts/resources/lib/entry_point.py.  Certainly, script.skinvariables is launched afterwards and appears to complete successfully.
Learning Linux the hard way !!
Reply
#3
(2024-01-13, 19:29)black_eagle Wrote: I can reproduce this with Aeon Nox Silvo @mikeSiLVO

Crashes in a python script which although I can't 100% confirm, appears to be script.skinshortcuts/resources/lib/entry_point.py.  Certainly, script.skinvariables is launched afterwards and appears to complete successfully.

Do you mind walking me through this? How did you get to that script?

The first instruction apparently logs a message somewhere ("script version ..."). I looked at the crash log but couldn't find it.

I'd like to add a try... except to see if I can bypass the error. But first I'd need to know what the error is.

Thanks,

VMat
Reply
#4
(2024-01-13, 23:55)vmat Wrote: Do you mind walking me through this? How did you get to that script?

So, I ran Kodi inside gdb so that when it crashed, I could get a backtrace.  That trace shows it crashes with Thread 54 "LanguageInvoker" received signal SIGSEGV, Segmentation fault.

LanguageInvoker is the Python interpreter and from the Kodi.log, the two scripts executed are skin.shortcuts and skin.skinvariables.  Estuary doesn't execute either of those.....

One of them appears to return correctly, leading me to assume that it's the other script.  However, due to asynchronous execution, it could be either of them.

If you run kodi inside gdb with something like gdb --args ./kodi-x11 -p

Then, when it crashes, do thread apply all bt.  Actually, you might be able to correlate the crashing thread in the gdb backtrace with a thread in the kodi log which would definitively show the faulty script (although I think its a python issue rather than a script issue).
Learning Linux the hard way !!
Reply
#5
OK, that's currently beyond my skills, but I'll see if I can do it. Thanks a lot for sharing!

So you think it's an issue with the Python interpreter? In that case, who could we expect to fix it? Or, could we (or @mikeSiLVO) still do something to the Python scripts to avoid the crash?

Thanks,

VMat
Reply
#6
Hi again,

Haven't tried that debug session yet. Just too much going on at home.

I've been adding more movies to my storage though. So yesterday I thought I could try another library update. But first I changed the skin to Estuary. Then updated the library, started playing a movie, let it play for a minute or two, and stopped. And Kodi crashed again. First crash log is here.

My next step will be to disable Aeon skin and try again. But if someone spots something in the log and figures this out, please let me know...

Thanks,

VMat
Reply
#7
Just did it (disabled Aeon, rebooted, tried again). Same thing. Sad

VMat
Reply
#8
OK, I went ahead and deleted the database. Step-by-step in case you're wondering:
  • Stop Kodi.
  • Rename .kodi/userdata/Database and .kodi/userdata/Thumbnails.
  • Start Kodi.
  • Set content in each of my (12!) sources - tedious...
  • Update items (database) for each source as I add them.

Now it's not crashing anymore. However:
  1. I had to set content in each source again. Tedious, as I said above.
  2. I lost all my watched flags and resume positions. Quite frustrating.
  3. I lost my whole configuration for Aeon.Silvo which I spent a lot of time preparing. Again, quite frustrating.
  4. I haven't even tried yet to set up Aeon.Silvo again. Don't have any time left today, will try in the next couple of days (hopefully) and post an update here.
Given that this has happened before, I can only assume it's likely to happen again.

Questions:
  1. Is there a way to clean up the database (to avoid the crashes) without losing the above?
  2. Otherwise, is there a way to merge the bad database with the new, empty database, without going back into the crash/restart loop?
  3. Sometimes I delete a movie from the database - typically when I upgrade from DVD to BD, i.e., I add the BD and delete the DVD. I select the DVD movie in the list, go to the context menu, then "manage", then "remove from library". Could this be corrupting the database? Is there a safer way to do it?

Thanks,

VMat
Reply
#9
Well, finally, some good news. Aeon.Silvo configuration wasn't lost. I enabled the addon again and it's all there, apparently.

As for the watched flags and resume positions, I found some records for my movies in the bookmark table that I could migrate to the new DB, but I guess the most important ones are the TV shows. And I don't have a lot of them, I can do it in the GUI.

I'd still like to have an answer to question #3 in the previous post, if anyone could chime in.

Thanks,

VMat
Reply
#10
fwiw you may have more responses posting on the LibreELEC forum since that's what you run

in response to 1-3 questions

1. it's more likely to cause corruption by over cleaning the database rather than just allowing it to do it's own cleanups, there are triggers in the database that do this
2. you may or may not have success importing from the old database using sqlite browser or similar but it is generally not recommended for users to edit the database directly (expert or daring users should only attempt)
3. it's unlikely removing from the context menu caused database corruption but it's very difficult to say since specifics are not provided
- age of the disk
- brand of the disk
- did the disk exceed it's lifetime write limit
- duration of disk usage
- duration of database usage
- amount of database entries
- how many times the database was upgraded (is this a database that's been in use since v16 f.e.)
- how many records in total has the database had written and removed during it's lifetime

as you can see there are a lot of factors

since you removed thumbnails at the same time as database are you positive the database was causing it or was it just the thumbnails cache Textures.db and the Thumbnails folder
Reply
#11
(2024-02-03, 03:53)izprtxqkft Wrote: fwiw you may have more responses posting on the LibreELEC forum since that's what you run

in response to 1-3 questions

1. it's more likely to cause corruption by over cleaning the database rather than just allowing it to do it's own cleanups, there are triggers in the database that do this
2. you may or may not have success importing from the old database using sqlite browser or similar but it is generally not recommended for users to edit the database directly (expert or daring users should only attempt)
3. it's unlikely removing from the context menu caused database corruption but it's very difficult to say since specifics are not provided
- age of the disk
- brand of the disk
- did the disk exceed it's lifetime write limit
- duration of disk usage
- duration of database usage
- amount of database entries
- how many times the database was upgraded (is this a database that's been in use since v16 f.e.)
- how many records in total has the database had written and removed during it's lifetime

as you can see there are a lot of factors

since you removed thumbnails at the same time as database are you positive the database was causing it or was it just the thumbnails cache Textures.db and the Thumbnails folder

That helps. Also, as I read it, I start to remember things. E.g., I know now I had this same problem in September, and I deleted the database and started a new one from scratch - I'm pretty sure that's how the problem "went away". To answer your question, it may have been upgraded once - I can't remember if I started from scratch again after the Kodi upgrade.

The disk is a Kingston SSD I bought in December, 2022. But I think I didn't use it at least until May, 2023. Sometimes I use this machine for maybe 5-10h/week, sometimes I forget about it for a couple of weeks. It doesn't sound like disk wear is an issue (please correct me if I'm wrong).

I seem to have 842 movie titles available, and 13 TV shows, with a total of 306 episodes. I hope that's not too much, because I won't stop buying them anytime soon... Smile

About #2, I'm old school. I wrote a query to get the data from the old database (ran it directly in sqlite prompt in a terminal), and was about to write a couple of scripts to update the new one. If that broke anything, I could just delete the database again and start over. I agree that in normal conditions we shouldn't mess around with the database, but in my case, I wouldn't lose much more than I already did. I stopped when I realized I could do what I needed in the GUI. Which is about the TV shows - I don't care much about the movies at the moment.

And about #1, something else crossed my mind. Sometimes I will delete the old movie from my storage first. Then I go to Kodi and "play" it to get the dialog asking if I want to delete it from the database, and then I click on "Yes". Is this the trigger you referred to? Or were you referring to database triggers? Anyway, what is the recommended way to remove something from the database?

I'm not sure if it was the database or the thumbnails. I have backups of the whole .kodi folder when it crashed, I can restore one and delete the thumbnails only. I may give it a try. In a few days.

Thanks,

VMat
Reply
#12
pretty sure kingston is not a low end brand
one year use shouldn't be an excessive amount of time
842 movies/306 episodes is not "too much for kodi", a lot of people here have 10x that (not me)

database has delete triggers in it's schema, those are what i was referring to
you're not operating your kodi any differently than i am, i also allow kodi to remove things when i click on them after removing from disk as well as just use the context menu to remove

i do not see any red flags in what you are doing or what you are using
only leads me to think perhaps an environmental issue (dirty power, power surges) or simply bad luck because your drive was made on a Friday the 13th or something
Reply
#13
(2024-02-03, 19:15)izprtxqkft Wrote: pretty sure kingston is not a low end brand
one year use shouldn't be an excessive amount of time
842 movies/306 episodes is not "too much for kodi", a lot of people here have 10x that (not me)
database has delete triggers in it's schema, those are what i was referring to
you're not operating your kodi any differently than i am, i also allow kodi to remove things when i click on them after removing from disk as well as just use the context menu to remove

i do not see any red flags in what you are doing or what you are using
OK, good. Thanks.
 
(2024-02-03, 19:15)izprtxqkft Wrote: only leads me to think perhaps an environmental issue (dirty power, power surges) or simply bad luck because your drive was made on a Friday the 13th or something
Power is pretty stable here, as far as I can tell. There's always the chance of a power surge after an outage, but in that case all my equipment will be fully disconnected from power until I turn on the main switch.

The computer PSU might not be as stable, I guess. But I think I'd see other symptoms if it were fluctuating too much. Let's also keep in mind that @black_eagle reproduced the issue in his system - are we both affected by hardware issues? What are the odds?

I'll see if I can do the test with the thumbnails later today. If that fixes the problem, next time I'll know what to do.

Thank you,

VMat
Reply
#14
I did the test:
  1. Started the computer (and Kodi).
  2. Stopped Kodi.
  3. Moved .kodi into .kodi.OK.
  4. Restored the bad backup.
  5. Started Kodi.
  6. Kodi crashed.
  7. Stopped Kodi.
  8. Deleted Textures13.db and everything inside userdata/Thumbnails/.
  9. Started Kodi.
  10. Kodi crashed.
  11. Stopped Kodi.
  12. Deleted .kodi (+ subdirectories).
  13. Moved .kodi.OK back to .kodi.
  14. Started Kodi.
  15. All is well.
So it seems the database is at least part of the problem. Maybe combined with something else.

Thanks,

VMat
Reply

Logout Mark Read Team Forum Stats Members Help
Restart loop - help troubleshoot, please0