OSMC always crashes while scanning new videofiles

I run OSMC headless on an RPi3 just to rescan my videolibrary. I just noticed that OSMC crashes while doing so. I then connected my TV and saw a loop of starting, scanning, sadfacing and I don’t know what to make of it. The logs under https://paste.osmc.tv/joqegodofa are uploaded minutes after the latest crash. Can anyone please have a look at my logs and give me a hint? Thanks in advance!

Probably a corrupted file recently introduced.
Try moving it to a directory outside of the one you are scanning.

Is there anything in the logs that hints to which file im searching for? Which lines in the log indicate the crash or what would I have to search for in the logs?

Well the last entry in your kodi.log.old (which is created after the last Kodi stop) is the following which actually doesn’t indicate a Videofile.

2023-12-25 23:11:33.301 T:10489   debug <general>: CSMBFile::Open - opened smb://sky/share/audiobooks/Audible/mp3/Hörletter Mai 2009.m4b, fd=10002
2023-12-25 23:11:33.355 T:10485    info <general>: CActiveAESink::OpenSink - initialize sink
2023-12-25 23:11:33.355 T:10485   debug <general>: CActiveAESink::OpenSink - trying to open device ALSA:default
2023-12-25 23:11:33.355 T:10485    info <general>: CAESinkALSA::Initialize - Attempting to open device "default"
2023-12-25 23:11:33.362 T:10485    info <general>: CAESinkALSA - Unable to open device "default" for playback
2023-12-25 23:11:33.362 T:10485   error <general>: CAESinkALSA::Initialize - failed to initialize device "default"
2023-12-25 23:11:33.363 T:10485   error <general>: CActiveAESink::OpenSink - no sink was returned
2023-12-25 23:11:33.363 T:10484   error <general>: ActiveAE::InitSink - returned error
2023-12-25 23:11:33.431 T:10489   error <general>: ffmpeg[0x54931e8]: [mov,mp4,m4a,3gp,3g2,mj2] moov atom not found
2023-12-25 23:11:33.431 T:10489   debug <general>: CSMBFile::Close closing fd 10002

Also maybe monitor memory usage while scanning

1 Like

Thank you! This also explains why my music library isn’t updated anymore (a problem so old I forgot about it…). I’ll move the file and try again.

Is there a way to make Kodis scaning process either be transparent about such errors (some message on screen, or a separate log) or just skip broken files?

As in most such cases Kodi crashes quite “hard” there is not much to be done during the crash. There might be an option to display a snippet from kodi.old.log but that would require some magic to make it useable for end users.

Thanks again, for your help @fzinken! I endet up watching kodi.old.log with inotifywait and copying errors to a separate logfile. In case someone has the same problem and find’s this threat:

inotifywait -qe modify /home/osmc/.kodi/temp/kodi.old.log
grep 'error.*ffmpeg' /home/osmc/.kodi/temp/kodi.old.log >> /home/osmc/kodi.error-ffmpeg.log
/home/osmc/watch-kodi-log &

Save as /home/osmc/watch-kodi-log, chmod a+x watch-kodi-log, run with ./watch-kodi-log & and check /home/osmc/kodi.error-ffmpeg.log from time to time. Script runs for ever, kill it with killall watch-kodi-log

Did you find your problem?
If you do that script maybe include memory with free -ms 2