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:
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.
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
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
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%
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.
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)
@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
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.
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.
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.