rdt-client icon indicating copy to clipboard operation
rdt-client copied to clipboard

OutofmemoryException - Downloads not completing / keep restarting

Open Mulanzo opened this issue 1 year ago • 9 comments

What version are you using? Latest (2.0.78)

Wat OS are you running? Unraid - 16GB ram

Are you using Docker or as a service? Docker

Which debrid provider are you using? Real-Debrid

Which downloader are you using? Internal Downloader

Please attach a log file here with the log setting set to debug [10:19:30 ERR] The operation was canceled. System.Threading.Tasks.TaskCanceledException: The operation was canceled. at System.Net.Http.CancellationHelper.ThrowOperationCanceledException(Exception innerException, CancellationToken cancellationToken) at System.Net.Http.CancellationHelper.ThrowIfCancellationRequested(CancellationToken cancellationToken) at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [10:19:30 ERR] The operation was canceled. System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException (125): Operation canceled --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Net.Http.HttpConnection.ReadAsync(Memory1 destination) at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [10:19:56 ERR] The decryption operation failed, see inner exception. System.IO.IOException: The decryption operation failed, see inner exception. ---> Interop+OpenSsl+SslException: Decrypt failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:0A000119:SSL routines::decryption failed or bad record mac --- End of inner exception stack trace --- at Interop.OpenSsl.Decrypt(SafeSslHandle context, Span1 buffer, SslErrorCode& errorCode) at System.Net.Security.SslStreamPal.DecryptMessage(SafeDeleteSslContext securityContext, Span1 buffer, Int32& offset, Int32& count) --- End of inner exception stack trace --- at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Net.Http.HttpConnection.ReadAsync(Memory1 destination) at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [10:21:11 ERR] Download reported an error: Exception of type 'System.OutOfMemoryException' was thrown. for download top.hat.1935.1080p.bluray.x264-regret.mkv. Completed: 0%, avg speed: 0bytes/s (cec02810-ff4f-4761-81ce-2ea73997eb6a) remoteID: 0d427636-b577-44fc-8be9-092a6d9b5c53 for torrent Top.Hat.1935.1080p.BluRay.x264-REGRET[rarbg] (XZ2OTT54SASYI - downloaded 100%) (601e7f01-d5f9-469f-ba06-9de38d84ea37) [10:21:11 ERR] Download reported an error: Exception of type 'System.OutOfMemoryException' was thrown. for download Little.Women.2019.1080p.BluRay.x264.DTS-HD.MA5.1-HDChina.mkv. Completed: 0%, avg speed: 0bytes/s (213152a3-e8aa-4f75-b089-3d835656e30f) remoteID: 43b523a4-8948-4cf7-97df-d1f4f5428942 for torrent Little.Women.2019.1080p.BluRay.x264.DTS-HD.MA5.1-HDChina (JKRW3GXSB4LZG - downloaded 100%) (711b5793-a087-499c-94fd-cd7b6ef0b2bf) [10:21:11 ERR] Download reported an error: Exception of type 'System.OutOfMemoryException' was thrown. for download Moonlight.2016 1080p BluRay x264 DTSHD 5.1 -DDR.mkv. Completed: 0%, avg speed: 0bytes/s (2a381d0b-45a3-4e96-b73c-5c37908b9d09) remoteID: 95c6ceb4-fa7b-468c-b853-e8cbbb59cbf5 for torrent Moonlight.2016 1080p BluRay x264 DTSHD 5.1 -DDR (W7N7WPH32R55S - downloaded 100%) (46d899a5-c4ba-46f2-bd3e-59a27cc3f621)

Mulanzo avatar May 23 '24 14:05 Mulanzo

I've been having trouble with downloads for the last few days and I'm chewing through download bandwidth like crazy, but the file either never complete or save. They just disappear after downloading TB's of data. I just noticed these errors today but hadn't paid attention to them until now. In Radarr, I see downloads starting, progressing, and sometimes completing or disappearing, but in the filesystem, the folders are often empty. Occassionaly a file will save and import but this is rare. I'm not sure the memory issue is related... But occasionally the whole Unraid system crashes and I need to reboot.

Mulanzo avatar May 23 '24 14:05 Mulanzo

I'm having the same problem. log file: 2024-05-26 18:03:33.545 +03:00 [ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool`1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken)

oriel007 avatar May 26 '24 15:05 oriel007

Same issues here as well over the last few days. I use torrent as a backup so just noticed as I was forcing a download. I am also on unRAID.

[ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool`1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken)

colt45rpm avatar May 28 '24 23:05 colt45rpm

I am having the same exact issue. Running v2.0.78 in a Docker container inside a linux container on Proxmox. This thing is really memory hungry and locks up my whole LXC and causes all the other containers to be useless. I have tried limiting the CPU and Memory to the Docker container but still, it has this problem. Please fix this if you can @rogerfar, much appreciated if you do!!

rmillspa avatar May 31 '24 03:05 rmillspa

I have noticed that this never happened before, only when updating to a newer version. I will downgrade to v2.0.74 and keep using that until this gets fixed. That version worked for me for a long time before updating. Hope this helps!

rmillspa avatar May 31 '24 03:05 rmillspa

Follow up: I tried v2.0.74 and still got the same issue. Downgraded all the way to v2.0.64 and it seems to be working just fine now. Not sure why this is happening. I downloaded a 30gb file and didn't have any problems.

rmillspa avatar May 31 '24 04:05 rmillspa

Follow up #2: Seems like you can just change the download client to Bezzad Downloader and that also fixes the problem, even in v2.0.78. Give it a try and see if that fixes it for you. The problem might just be with the Internal Downloader. Cheers!

rmillspa avatar May 31 '24 04:05 rmillspa

I'm getting this too on default client! I checked windows event manager and there were Resource-Exhaustion-Detector warnings like this:

Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: RdtClient.Web.exe (6844) consumed 39239663616 bytes, jellyfin.exe (14216) consumed 1204490240 bytes, and JDownloader2.exe (1960) consumed 482107392 bytes.

So this works out to RDT-Client consuming ~36.5 GB of virtual memory....Jellyfin and jdownloader just 1GB and 460MB which is fairly normal, I can even see that in task manager.

pavichokche avatar May 31 '24 12:05 pavichokche

Use the Bezadd downloader, or adjust the setting on the Download Client setting page. Especially the Parallel connections per download and Buffer Size. Putting them to lower numbers will result in less memory consumption, but slow down your downloads.

rogerfar avatar Jun 01 '24 17:06 rogerfar

Why is this closed? What is the resolution?

gibahjoe avatar Sep 19 '24 21:09 gibahjoe