Sonic Analysis getting stuck on a few specific files

Server Version#: Windows 10 with 1.24.0.4930
Player Version#: N/A

I’ve mentioned this in some other threads, but since this seems to be a legit bug I though it merited a new thread with more info.

Problem: Sonic Analysis spins up transcoder processes, but it is possible for a transcoder process to get stuck on a file and run indefinitely. This will completely stop SA from making further progress. It also consumes some CPU, indefinitely. (Well, maybe not indefinitely… but I waited a couple of days in one case and it didn’t fix itself.)

If you manually kill a stuck transcoder process, per the debug log SA will resume and the completion percent will start counting up again.

When SA completes scanning, it will let you use the feature. It will also go back to the files it missed, and get stuck again, consuming CPU power.

In my library I found 2 mp3 files that SA could not transcode. I checked them with all the MP3 validation tools I have, and the files seemed to be fine.

However, in Plex, the files have runtimes that are clearly absurd.

I re-downloaded the files and put them in the library, replacing the originals. There was no change (and the files still look good in other software).

I then tried re-writing a bad file by using LAME to transcode it from 320 CBR to 320 CBR. When I put the refreshed file in my library the runtime changed from about 24 hours to about 6 hours. I don’t know anything about how LAME works in detail, so maybe this left some info in the file that Plex hated.

OK, the nuclear option… with another tool I transcoded the MP3 to a WAV file. Then with LAME, I crunched it back to a CBR 320 mp3. Believe it or not, the transcoder got stuck again.

But, I cannot be sure that something isn’t cached.

One last try. I deleted the MP3, rescanned the library, emptied the trash, cleaned bundles, and even rebooted. The file is no longer visible in Plex, no metadata can be hanging around. Then I made a new MP3 by expanding the original MP3 to a WAV, and then making a new MP3 with LAME. OK, now the MP3 in Plex has the correct runtime. And, SA saw the changed album and analyzed it without the transcoder getting stuck.

I re-made the other MP3 file in the same way and everything seems OK now.

So may be a few problems depending on how you look at it.

  • PMS may be overly picky about the MP3 file format since it saw a bad runtime for a file that every other tool I have thought was OK
  • Transcoding a “bad” file may lead to a transcode process that won’t quit.
  • If during Sonic Analysis a transcoder gets stuck, it stops SA from proceeding. There should be a watchdog of some sort. I guess.

If your SA gets stuck, use Process Explorer to see what any transcoder processes are working on. Inspect those files in your Plex library to see if they have any odd metadata, like an abnormal runtime. If so, try to replace/refresh those files and be sure to Empty Trash and maybe even restart the server to be sure nothing hinky is cached.

2 Likes

thanks for the heads up. i had about 50-100 mp3s that got cross-linked on a windows drive. when windows “repaired” them they ended up corrupted (actually switching between 2 songs in an mp3) they’re hidden within my tens of thousands of tracks.

im watching the SA process using htop in terminal on my ubuntu server and saw it stuck on a specific mp3 in perpetuity

hopefully SA will just hang on each bad mp3 and i’ll finally figure out where these trashed mp3s are. 1 down. thanks again

2 Likes

hi, i think i have the same problem. SA stuck in 7729 albums left for three days already. Keeps happening even after I restart my server. I wonder what the steps are to find out which file may be corrupt? would appreciate some help thanks. running plex on a Mycloudpr4100 NAS

You need a way to inspect the actual processes that are running. If it’s like my problem there will be a transcode process stuck on one file. Does your NAS let you log in to a shell or otherwise inspect what is running?

I found the exact point where the analysis got stuck by downloading the Plex Server logs. Basically, one Album’s route looked as follows: Author/CDname/cd1/cd1/trackfolder. Cd1 folder was unnecessarily repeated twice and that might have caused some redundancy on the scanner whatsoever. In the logs, the error was repeating itself endlessly as you explained. Just fixing the file folder structure, empty trash and refresh, now the scanner is back to work :slight_smile:

2 Likes

Van_Vics, the Sonic Analysis keeps getting stuck on two albums, but I am not able to find them. I looked at the server logs but am still not able to find them.Plex Media Server Logs_2021-10-31_09-33-18.zip (2.2 MB)

How do I find the track or albums that are stopping the sonic analysis from completing?
I will delete and replace the files from new RIPs

I have followed what Van_Vics suggested but am not able to find the tracks that are causing the issue

See this thread for a few more hints Sonic Analysis - has processed 6 albums in 40 minutes - #210 by OttoKerner

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.