Transcoder crashes on access errors

Server Version#: 1.18.0.1944

Having all sorts of issues with my latest PMS build on Win10 1903 - First I never could get hardware transcoding to work so I just disabled it, but I’m still having all sorts of issues with transcoding. Seems to only affect some players like Chromecast, or some media types such as HEVC. I didn’t notice it at first because I use Apple TV for 95% of what I watch, but my users tell me it crashes even on Apple TV when they watch HEVC content. Meanwhile I tried to use Chromecast today and it crashed 4 times during one stream. I note this from the logs that looks to line up with the crashes:

ERROR - [Transcoder] [tcp @ 00976b80] Connection to tcp://127.0.0.1:32400 failed: Error number -138 occurred
ERROR - [Transcoder] [stream_segment,ssegment @ 044d8080] Failed to open segment list ‘http://127.0.0.1:32400/video/:/transcode/session/E19A1115-30E8-4A59-A919-43DB7FEC9A61/d56f7cf6-3c15-41c5-b3a3-7d7ad8e1450b/seglist
ERROR - [Transcoder] av_interleaved_write_frame(): Unknown error
ERROR - [Transcoder] Error writing trailer of media-%05d.ts: Invalid argument

My logs for reference: https://www.dropbox.com/s/jjhv0cdd4lpthlm/Plex%20Media%20Server%20Logs_2019-10-15_17-07-42.zip?dl=1

Is there a solution on this? I have the same error.

I’m getting the same error and I’m not very happy to find this thread hasn’t been replied to since google searching error -138 for the TCP failure results in only 2 pages with this being one of them.

We’ve noticed that while we have NZBGet downloading we receive the errors much more frequently. If the NZBGet queue is paused then it seems to be a lot more stable (and if not a server restart is required to kick it back into gear). I investigated the logs expecting to find HDD locks as the culprit and was surprised to find the error to be pertaining to a failure to open a TCP session and downloading the segment list.

Feb 05, 2020 20:37:22.264 [8596] ERROR - [Transcoder] [tcp @ 0498a700] Connection to tcp://127.0.0.1:32400 failed: Error number -138 occurred
Feb 05, 2020 20:37:22.265 [27140] ERROR - [Transcoder] [stream_segment,ssegment @ 02656bc0] Failed to open segment list 'http://127.0.0.1:32400/video/:/transcode/session/5BA6CE38-DC7B-42BF-A855-BFBC2510F1BA/044f6401-4bc8-45b5-83db-c4d490278bc3/seglist'
Feb 05, 2020 20:37:22.276 [3540] ERROR - [Transcoder] av_interleaved_write_frame(): Unknown error
Feb 05, 2020 20:37:22.299 [21120] ERROR - [Transcoder] Error writing trailer of media-%05d.ts: Invalid argument
Feb 05, 2020 20:37:22.300 [8596] DEBUG - Request: [127.0.0.1:52313 (Loopback)] PUT /video/:/transcode/session/5BA6CE38-DC7B-42BF-A855-BFBC2510F1BA/044f6401-4bc8-45b5-83db-c4d490278bc3/progress?progress=12.9&size=-22&remaining=8163&vdec_packets=10095&vdec_sw_ok=10091&speed=9.7&vdec_hw_status=0 (9 live) Signed-in Token (Amoureux9) (range: bytes=0-) 
Feb 05, 2020 20:37:22.300 [2568] DEBUG - Completed: [127.0.0.1:52313] 206 PUT /video/:/transcode/session/5BA6CE38-DC7B-42BF-A855-BFBC2510F1BA/044f6401-4bc8-45b5-83db-c4d490278bc3/progress?progress=12.9&size=-22&remaining=8163&vdec_packets=10095&vdec_sw_ok=10091&speed=9.7&vdec_hw_status=0 (9 live) 0ms 355 bytes (pipelined: 90) (range: bytes=0-) 
Feb 05, 2020 20:37:22.315 [20332] DEBUG - Jobs: 'C:\Program Files (x86)\Plex\Plex Media Server\Plex Transcoder.exe' exit code for process 9564 is 1 (failure)
Feb 05, 2020 20:37:22.315 [15812] DEBUG - Streaming Resource: Terminating session 0x59ef128:E2E339AC-9B06-4902-AFB5-A6472305B978 which is using transcoder slot.  Used slots is now 0
Feb 05, 2020 20:37:22.316 [21776] DEBUG - Killing job.
Feb 05, 2020 20:37:22.316 [21776] DEBUG - Job was already killed, not killing again.
Feb 05, 2020 20:37:22.316 [21776] DEBUG - Stopping transcode session 5BA6CE38-DC7B-42BF-A855-BFBC2510F1BA
Feb 05, 2020 20:37:22.316 [15812] DEBUG - Streaming Resource: Terminated session 0x59ef128:E2E339AC-9B06-4902-AFB5-A6472305B978 with reason Conversion failed. The transcoder exited due to an error.

Every time the transcoder crashes there’s a TCP failure just before it. I’m not aware of any place where we can translate the exit codes ourselves but if anyone finds one, please let me know and I’ll try to troubleshoot this myself.

I’ve upgraded and downgraded Plex, fresh installed, moved it to a new server, gave Plex it’s own disk and this error still plagues me. I think the time has come to jump to Emby. Plex was good once upon a time but this error is just the flavor of the month and once it’s fixed there’s no doubt a new one will follow.

I am looking into similar errors here Recording failures after update to 1.19.1 beta

Such errors previously were seen when Malwarebytes Premium was in use but the one I am looking into does not have that running and the security software in use Trend Micro Maximum Security was disabled but did not help

Is Malwarebytes Premium in use ?
When did these errors start. The one I am investigating appears to arise on 1.19.1 but not 1.18.8.2527

I’m having the same issues and don’t have any Malwarebytes or Trend Micro software installed at all.

I have PMS (1.19.1.2645) running on a Windows 10 machine and the media is streaming to the Plex App on a 2015 Nvidia Shield.

Media will play for about 20 minutes before throwing up a transcode error. The logs say the following:

Apr 09, 2020 21:36:48.759 [9736] ERROR - [Transcoder] [tcp @ 02615ac0] Connection to tcp://127.0.0.1:32400 failed: Error number -138 occurred
Apr 09, 2020 21:36:48.759 [9736] ERROR - [Transcoder] [stream_segment,ssegment @ 02e255c0] Failed to open segment list 'http://127.0.0.1:32400/video/:/transcode/session/344c0f196dbe5b7d-com-plexapp-android/8cd5ab3b-53f3-4978-9870-bd8dcd23d81a/seglist?X-Plex-Http-Pipeline=infinite'
Apr 09, 2020 21:36:48.759 [9736] ERROR - [Transcoder] av_interleaved_write_frame(): Unknown error
Apr 09, 2020 21:36:53.811 [9704] ERROR - [Transcoder] [tcp @ 02615ac0] Connection to tcp://127.0.0.1:32400 failed: Error number -138 occurred
Apr 09, 2020 21:36:53.811 [9704] ERROR - [Transcoder] [stream_segment,ssegment @ 02e255c0] Failed to open segment list 'http://127.0.0.1:32400/video/:/transcode/session/344c0f196dbe5b7d-com-plexapp-android/8cd5ab3b-53f3-4978-9870-bd8dcd23d81a/seglist?X-Plex-Http-Pipeline=infinite'
Apr 09, 2020 21:36:53.817 [9704] ERROR - [Transcoder] Error writing trailer of media-%05d.ts: Error number -138 occurred
Apr 09, 2020 21:36:53.877 [11336] ERROR - Transcoder: Failed to delete session directory (boost::filesystem::remove: The process cannot access the file because it is being used by another process: "C:\Users\Cameron\AppData\Local\Plex Media Server\Cache\Transcode\Sessions\plex-transcode-344c0f196dbe5b7d-com-plexapp-android-8cd5ab3b-53f3-4978-9870-bd8dcd23d81a\media-00006.ts")
Apr 09, 2020 21:36:53.909 [18268] WARN - Transcode runner appears to have died.
Apr 09, 2020 21:36:54.319 [6484] ERROR - Session 0x54a4398 terminated
Apr 09, 2020 21:36:58.964 [16068] WARN - Got a request to stop a transcode session without a session GUID (or with an invalid one).
Apr 09, 2020 21:36:59.066 [13116] ERROR - Unknown metadata type: folder
Apr 09, 2020 21:36:59.118 [13096] WARN - Got a request to stop a transcode session without a session GUID (or with an invalid one).

Thanks for reporting this. The case I am investigating appears to be tcp port exhaustion

Please open Windows Event Viewer, Select the Windows System Log and then filter current view on “Event ID” 4227 and see if this is logged at time of these errors

Please also get the error to arise and then get me the full Plex Media Server logs zip (but please enable debug logging beforehand and restart the server before the test) and also need the output from the following commands

  • Start an elevated command line window (start / cmd / right click on command prompt and select run as administrator) - enter this command

netstat -anobq > "%localappdata%\netstat_2020-Apr-10a.txt"

The netstat to be done after the failure is logged

and also get me the output from

netsh int ipv4 show dynamicport tcp > "%localappdata%\tcpipv4-portrange.txt"

and let me have the Plex Media Server zipped logs and the two files
netstat_2020-Apr-10a.txt and tcpipv4-portrange.txt which were saved above to %localappdata%

Thanks

Found some non standard tcp dynamic port range on the system I am investigating - so would definitely like to see the output from

netsh int ipv4 show dynamicport tcp
and do ipv6 as well
netsh int ipv6 show dynamicport tcp

Also exactly what version of Windows 10 and build identifier - including the build number after the fullstop

@sa2000 it looks like I am having the exact same issues (same exact error code).
Here are my log files along with the two requested commands from your previous post.
Also, runs on Windows 10 1909 and do not have any 3rd party anti-virus or security software.
Thanks!
Plex Media Server Logs_2020-04-18_15-02-46.zip (6.2 MB)
tcpipv4-portrange.txt (122 Bytes) netstat_2020-Apr-18a.txt (28.7 KB)

-tech

Thank you

Port range looks ok

I need now windows event logs - you can zip and send me in PM - event viewer and save each of:

  • System
  • Application
  • Setup

Also would like to know the exact Windows 10 Version 1909 OS build number with both parts of the build number

How soon after the error was the netstat captured ?

To update, the following is what I have done :
1 : set scan interval to 12 hours and didn’t have errors until about 12 hours later.
2 : set back to 1 hour (where it has been forever) and started to have errors in 30-45 mins.
3 : turned off Windows Virus and Threat protection and then turned back on. Didn’t affect errors.
4 : have correlated Event id 4227 to some of the errors (happened at exact same time), but have not had an event for all of the Plex errors.

@sa2000 Here is all the info. Just ran them all and the errors occured in the last 15-30 mins
Plex Media Server Logs_2020-04-19_12-32-48.zip (6.5 MB) Documents.zip (564.5 KB)

Windows Version : 18363.720

thanks for the help!

Yes it is the scanner status update requests that lead to the high volume of requests.

But … the issue went away after a windows update when investigating the problem last time round - whilst the volume of scanning status update requests remained at the same level.

Could you try to apply thes updates - getting each update from the update catalogue

Windows 10 Version 1909 18363.720 to 18363.752

KB4541335
March 24, 2020—KB4541335 (OS Builds 18362.752 and 18363.752)

You can get it from the updates catalogue
https://www.catalog.update.microsoft.com/home.aspx
Search for KB4541335
For windows 10 version 1909 x64, the relevant update should be

https://www.catalog.update.microsoft.com/ScopedViewInline.aspx?updateid=42b2f858-5eb3-447d-80a9-1b84d259d957

Complete this update and restart the PC and then

Windows 10 Version 1909 18363.752 to 18363.753

KB4554364
March 30, 2020—KB4554364 (OS Builds 18362.753 and 18363.753)

Windows Updates Catalogue
https://www.catalog.update.microsoft.com/home.aspx
Search for KB4554364
For windows 10 version 1909 x64, the relevant update should be
https://www.catalog.update.microsoft.com/ScopedViewInline.aspx?updateid=0631ba1d-ff4a-4a00-b246-eb74f4ee1126

Complete this update and restart the PC

Then run windows update - check for updates in case of any further updates needed for .753

At the end, check the windows 10 Version 1909 build number
I expect it to be 18363.753

check the tcp v4 and ipv6 dynamic port ranges

netsh int ipv4 show dynamicport tcp
netsh int ipv6 show dynamicport tcp

please make sure debug logging is enabled before you launch Plex Media Server

Try to break it with tcp connection -138 error and event log event ID 4227

If it still happens, please let me have a fresh set of diagnostics

  • logs zip
  • netsh output for tcp4 and tcp6
  • netstat (taken as soon as you see the fail as the ports get freed soon after - netstat in elevated command prompt and with arguments -anobq )
  • application / system / Setup event logs

@sa2000 Thanks for that extremely detailed response. I will try it tonight as soon as most of my users get off the server. Then I will turn the scanning back to every hour and keep an eye on it throughout the day tomorrow, but will be at work so it may be tomorrow evening before I have anything to report.
Thank you once again for all of this and I will be in touch soon. Stay safe in the meantime!

I would like the logs to cover the whole period from launch to failure - so restart the server before embarking on a test that may lead to failure - that will make sure we start with a fresh set of logs

Thanks

Will do. Thanks!

only the latest of the updates above would install. Said something to the effect of “this update does not apply to your system”. I double checked that I :
1 : am on 1909
2 : selected the 1909 and not 1903 update
3 : selected the x64 and not the ARM64 update

I am now on 18363.778
I am about to turn the scanning back down to 1 hour and will reset server to get fresh logs.
Thanks.

Ran it this morning and had the same error happen. Didn’t have time to get those logs so I started over when i got home from work.
Restarted whole machine before changing scanning frequency to 1 hour.
Errors appear to happen when scanning is occuring no matter if it is every hour or every 12 hours.
Here are the logs (PMS logs / Windows Event Logs / Netstat commands)
PMS Logs : Plex Media Server Logs_2020-04-20_17-26-27.zip (5.5 MB)
Event Logs : Events.zip (274.6 KB)
Netstat : netstat_2020-APR-20.txt (356 Bytes)

Please note that the server that PMS runs on was somehow set to a different time zone and thus times are an hour behind of when they actually happened. I have since fixed that.

I have now turned it back to 12 hours for scanning so that it doesn’t happen to my users as much.

Thanks again!

1 Like

Thanks for the logs and other diagnostics

The failure was during scan of movies library with 4000 movies and after 8000 requests the proces could not get tcp request through due to port exhaustion.

When did this problem start ? I presume you had the same size libraries before

@sa2000 it started about 2 weeks ago and I have had about 4100 movies for a few months, but did recently add about 75-100 movies within the past 2-3 weeks.

Thanks!

Just to chime in since everything seems to match up between this thread and my own issues. I had no complaints from users for months and then all of a sudden everyone started complaining (about 2-3 weeks ago). The only two things that I can figure that changed were Windows updates and Plex updates (both set to auto update). I downgraded Plex back to 1.18.9.2578 (was on 1.19.1.2645) and the issue initially seemed to be resolved but I still seem to notice it during library scans. The only thing I can guess is that a Windows update is the root cause of the issue. For reference, I have 2643 movies, 197 cartoons, 514 Japanese anime series, 467 tv shows, and 744 music albums. My library hadn’t grown considerably at all for the last few months before the issue started due to being out of storage space. Anyways, my logs and detailed info are here (Transcoding errors starting 2-3 days ago) in case it may help. I do swear that the issue was worse in 1.19, but two different issues cropping up at the same time seems unlikely.