Kodi failing to read files, needs mediacenter restart

For a few days (perhaps ever since the latest update, but I can’t be sure) Kodi works fine for a while until eventually it starts having issue loading files from disk. The log reports:

06:10:50 386815.156250 T:1692415008 ERROR: COMXImageFile::ReadFile special://masterprofile/Thumbnails/1/153333a4.jpg not found
06:10:50 386815.156250 T:1692415008 NOTICE: LoadJpeg: unable to load special://masterprofile/Thumbnails/1/153333a4.jpg
06:10:50 386815.156250 T:1692415008 ERROR: DoWork - Direct texture file loading failed for special://masterprofile/Thumbnails/1/153333a4.jpg
06:10:50 386815.156250 T:1692415008 ERROR: CCurlFile::Stat - Failed: Couldn’t resolve host name(6) for http://image.tmdb.org/t/p/original/8rI9pNiTmugkEbI249evLygl9TC.jpg
06:10:50 386815.156250 T:1591358496 ERROR: COMXImageFile::ReadFile special://masterprofile/Thumbnails/5/5047d615.jpg not found
06:10:50 386815.156250 T:1591358496 NOTICE: LoadJpeg: unable to load special://masterprofile/Thumbnails/5/5047d615.jpg
06:10:50 386815.156250 T:1591358496 ERROR: DoWork - Direct texture file loading failed for special://masterprofile/Thumbnails/5/5047d615.jpg
06:10:50 386815.156250 T:1591358496 ERROR: CCurlFile::Stat - Failed: Couldn’t resolve host name(6) for http://image.tmdb.org/t/p/original/lxwPthqCYWIr9C57W26lcbjctJZ.jpg
06:11:00 386825.187500 T:1616917536 ERROR: COMXImageFile::ReadFile special://masterprofile/Thumbnails/2/2a0220bc.jpg not found
06:11:00 386825.187500 T:1616917536 NOTICE: LoadJpeg: unable to load special://masterprofile/Thumbnails/2/2a0220bc.jpg
06:11:00 386825.187500 T:1616917536 ERROR: DoWork - Direct texture file loading failed for special://masterprofile/Thumbnails/2/2a0220bc.jpg
06:11:00 386825.187500 T:1616917536 ERROR: CCurlFile::Stat - Failed: Couldn’t resolve host name(6) for http://image.tmdb.org/t/p/original/3H3lsEnlskAVjA2l3JMSFPmYsAG.jpg

And so on and so on. For a while this doesn’t prevent Kodi from working, but eventually it gets locked. More errors in the log make it sound like other important files are attempted to be read but without success:

10:45:47 403312.312500 T:1958396464 ERROR: unable to load:/home/osmc/.kodi/addons/skin.arctic.zephyr/1080i/DialogProgress.xml, Line 0
Failed to open file
10:48:45 403490.843750 T:1958396464 ERROR: Unable to load: /usr/share/kodi/addons/screensaver.xbmc.builtin.dim/resources/settings.xml, Line 0
Failed to open file

Through the command line I can see that the files are there and work just fine, so this is not a problem with the filesystem. It appears that whatever that Kodi is using to open files is just borked.

The only way to solve this is to restart the mediacenter through systemctl, then Kodi works again as usual, for some time.

I am using Zephyr as a skin, which is constantly showing backdrops and thumbnails of movies when the mediacenter is idle. I suspect that this might be exposing a bug somewhere, perhaps due to the amount of files it is constantly opening from the thumbnails cache.

I have similar situation i reckon many errors in the log eventually causes mediacenter to restart or like last night totally lock/freeze it.

To me it seems many errors eventually cause ’ ERROR: Open - Unhandled exception’ and ‘Too many open files’ messages which will lead to mediacenter in a frozen state. I can restart mediacenter from SSH/command line OK. I am now debug running with one problematic repository removed (and thus error messages are gone) just to see it is the cause… but still i understand error situations should not cause mediacenter to freeze.

Full debug logs http://paste.osmc.io/eqatenodif

Yeah, I think it’s a “too many open files” situation.