Downloader icon indicating copy to clipboard operation
Downloader copied to clipboard

Corrupted files

Open JuanCalle1606 opened this issue 5 months ago • 6 comments

Hi, I'm using version 4.0.2 of the library and I'm experiencing a problem: I'm downloading large files of 25 GB and the data I get is not what I expected:

This is what i have in my server:

Image

And this is what i get:

Image

The DownloadService doesn't thrown any error and when DownloadFileCompleted triggers it says AsyncCompletedEventArgs.Error is null but when i pass a Logger in the Service i get this spammed all the time in the console:

fail: Downloader.DownloadService[0]
      Task time-outed on download chunk 1. Retry ...
      System.Threading.Tasks.TaskCanceledException: The operation was canceled.
         at System.Net.Http.Http2Connection.Http2Stream.<>c.<WaitForDataAsync>b__88_0(Object s, CancellationToken cancellationToken)
         at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
         at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
         at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
         at System.Threading.TimerQueue.FireNextTimers()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
      --- End of stack trace from previous location ---
         at System.Net.Http.Http2Connection.Http2Stream.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
         at Downloader.ThrottledStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ThrottledStream.cs:line 100
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 158
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 160
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 147
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 122
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 123
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 51
fail: Downloader.DownloadService[0]
      Task time-outed on download chunk 2. Retry ...
      System.Threading.Tasks.TaskCanceledException: The operation was canceled.
         at System.Net.Http.Http2Connection.Http2Stream.<>c.<WaitForDataAsync>b__88_0(Object s, CancellationToken cancellationToken)
         at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
         at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
         at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
         at System.Threading.TimerQueue.FireNextTimers()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
      --- End of stack trace from previous location ---
         at System.Net.Http.Http2Connection.Http2Stream.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
         at Downloader.ThrottledStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ThrottledStream.cs:line 100
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 158
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 160
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 147
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 122
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 123
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 51
fail: Downloader.DownloadService[0]
      Task time-outed on download chunk 5. Retry ...
      System.Threading.Tasks.TaskCanceledException: The operation was canceled.
         at System.Net.Http.Http2Connection.Http2Stream.<>c.<WaitForDataAsync>b__88_0(Object s, CancellationToken cancellationToken)
         at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
         at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
         at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
         at System.Threading.TimerQueue.FireNextTimers()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
      --- End of stack trace from previous location ---
         at System.Net.Http.Http2Connection.Http2Stream.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
         at Downloader.ThrottledStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ThrottledStream.cs:line 100
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 158
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 160
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 147
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 122
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 123
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 51
fail: Downloader.DownloadService[0]
      Task time-outed on download chunk 3. Retry ...
      System.Threading.Tasks.TaskCanceledException: The operation was canceled.
         at System.Net.Http.Http2Connection.Http2Stream.<>c.<WaitForDataAsync>b__88_0(Object s, CancellationToken cancellationToken)
         at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
         at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
         at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
         at System.Threading.TimerQueue.FireNextTimers()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
      --- End of stack trace from previous location ---
         at System.Net.Http.Http2Connection.Http2Stream.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
         at Downloader.ThrottledStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ThrottledStream.cs:line 100
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 158
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 160
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 147
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 122
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 123
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 51
fail: Downloader.DownloadService[0]
      Task time-outed on download chunk 0. Retry ...
      System.Threading.Tasks.TaskCanceledException: The operation was canceled.
         at System.Net.Http.Http2Connection.Http2Stream.<>c.<WaitForDataAsync>b__88_0(Object s, CancellationToken cancellationToken)
         at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
         at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
         at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
         at System.Threading.TimerQueue.FireNextTimers()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
      --- End of stack trace from previous location ---
         at System.Net.Http.Http2Connection.Http2Stream.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
         at Downloader.ThrottledStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ThrottledStream.cs:line 100
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 158
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 160
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 147
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 122
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 123
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 51
Download progress: 0%
fail: Downloader.DownloadService[0]
      Task time-outed on download chunk 4. Retry ...
      System.Threading.Tasks.TaskCanceledException: The operation was canceled.
         at System.Net.Http.Http2Connection.Http2Stream.<>c.<WaitForDataAsync>b__88_0(Object s, CancellationToken cancellationToken)
         at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
         at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
         at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
         at System.Threading.TimerQueue.FireNextTimers()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
      --- End of stack trace from previous location ---
         at System.Net.Http.Http2Connection.Http2Stream.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
         at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
         at Downloader.ThrottledStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ThrottledStream.cs:line 100
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 158
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 160
         at Downloader.ChunkDownloader.ReadStream(Stream stream, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 147
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 122
         at Downloader.ChunkDownloader.DownloadChunk(Request request, PauseToken pauseToken, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 123
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 51
Download progress: 0%
fail: Downloader.DownloadService[0]
      Error during parallel download: The operation was canceled.
      System.OperationCanceledException: The operation was canceled.
         at System.Threading.CancellationToken.ThrowOperationCanceledException()
         at System.Threading.CancellationToken.ThrowIfCancellationRequested()
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 80
         at Downloader.ChunkDownloader.ContinueWithDelay(Request request, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 99
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 58
         at Downloader.DownloadService.DownloadChunk(Chunk chunk, Request request, PauseToken pause, CancellationTokenSource cancellationTokenSource) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 325
         at Downloader.DownloadService.DownloadChunk(Chunk chunk, Request request, PauseToken pause, CancellationTokenSource cancellationTokenSource) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 330
         at Downloader.DownloadService.ParallelDownload(PauseToken pauseToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 246
warn: Downloader.DownloadService[0]
      Download was cancelled
      System.OperationCanceledException: The operation was canceled.
         at System.Threading.CancellationToken.ThrowOperationCanceledException()
         at System.Threading.CancellationToken.ThrowIfCancellationRequested()
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 80
         at Downloader.ChunkDownloader.ContinueWithDelay(Request request, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 99
         at Downloader.ChunkDownloader.Download(Request downloadRequest, PauseToken pause, CancellationToken cancelToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\ChunkDownloader.cs:line 58
         at Downloader.DownloadService.DownloadChunk(Chunk chunk, Request request, PauseToken pause, CancellationTokenSource cancellationTokenSource) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 325
         at Downloader.DownloadService.DownloadChunk(Chunk chunk, Request request, PauseToken pause, CancellationTokenSource cancellationTokenSource) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 330
         at Downloader.DownloadService.ParallelDownload(PauseToken pauseToken) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 246
         at Downloader.DownloadService.StartDownload(Boolean forceBuildStorage) in C:\Users\bezzad\source\repos\Personal\Downloader\src\Downloader\DownloadService.cs:line 78

But it just continue downloading, I don't know if the problem is with the server, the files are serve also in c# with just asp PhysycalFile ActionResult: return PhysicalFile(path, mimeType, enableRangeProcessing: true);

My app is running in: Linux archlinux 6.15.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 17 Jul 2025 21:05:29 +0000 x86_64 GNU/Linux

JuanCalle1606 avatar Jul 28 '25 23:07 JuanCalle1606

Please provide the Downloader configs which is used in your apps. Thanks.

bezzad avatar Aug 09 '25 11:08 bezzad

Hi, I have a similar problem with this app, it appeared after migration to version 4.0.2 in ver 7.13.3 https://github.com/2dust/v2rayN/commit/ad5d21db5af6301a68460cbbee597bedba50b0bf#diff-d4d938be6f3333d7e2ad48e252a26dc32c003eab0d6689acb4b30e7b238f577d

If you look at the histogram of the file downloaded through the browser and through the application, then the files are very different in terms of binary content Image

Image

this one is broken

The file sizes are almost the same The broken one weighs less Image

Each time, the same file is downloaded, equally broken, that is, if you compare them through a hex editor, they are the same as the previous broken file

Solved https://github.com/2dust/v2rayN/issues/7682#issuecomment-3172504394

Sameguyy avatar Aug 09 '25 13:08 Sameguyy

Please provide the Downloader configs which is used in your apps. Thanks.

Im using always this config

readonly DownloadConfiguration _downloadConfiguration = new()
	{
		ChunkCount = 10,
		BufferBlockSize = 8000,
		ParallelDownload = true,
		MaximumMemoryBufferBytes = 1024 * 1024 * 1024,
		CheckDiskSizeBeforeDownload = true,
	};

Im using dotnet sdk 9.0.303

JuanCalle1606 avatar Aug 09 '25 18:08 JuanCalle1606

According to the logs you provided, the Downloader library is encountering timeouts while reading data from the web stream during the chunked download process. This is evident from messages like "Task time-outed on download chunk X. Retry ...", which indicate that the read operation for a specific chunk exceeded the configured timeout (default is 1000ms per block read). The library automatically retries the failed chunk up to the value set in DownloadConfiguration.MaxTryAgainOnFailure (default is 5 attempts).

Once the maximum retries are exhausted for a chunk, it triggers an OperationCanceledException, which cancels the overall download task. This leads to the "Download was cancelled" warning and sets the download status to DownloadStatus.Stopped. As a result, the DownloadFileCompleted event fires with AsyncCompletedEventArgs.Error as null (since it's not treated as an unhandled error), but AsyncCompletedEventArgs.Cancelled should be true, indicating the download was interrupted.

The corrupted file you're seeing is likely due to the incomplete download—some chunks may have partially succeeded before the cancellation, but the full file wasn't assembled properly. To handle this better in your code, make sure to check the Cancelled property in the event args and perhaps retry the entire download or notify the user.

If this persists, consider adjusting your DownloadConfiguration to make it more resilient for large files like 25GB:

  • Increase the Timeout (e.g., to 5000ms or higher) to allow more time for data to arrive during slow network conditions.
  • Raise MaxTryAgainOnFailure (e.g., to 10 or more) for additional retry attempts.
  • If parallel downloading is enabled (ParallelDownload = true), try disabling it or reducing ParallelCount to simplify the process and reduce concurrent stream pressures.
  • Ensure your server properly supports range requests (your ASP.NET PhysicalFile with enableRangeProcessing: true looks correct, but verify headers like Accept-Ranges: bytes in the response).

If you can share your download initiation code (including the config settings), I can help debug further. In the meantime, this should prevent the silent "completion" and give you a more robust setup.

bezzad avatar Aug 10 '25 06:08 bezzad

@bezzad after ajusting the settings to this one no more Task Cancellation is spammed on logs, but the file is still corrupted after completion, no error, no cancelation to true, it just thinks everything is fine and dont even downloaded the entire file, i verified the server is not the problem, range download works just fine and the browser can download the entire file without problems.

On this file Downloader.cs is where i handle the Download service, can you tell me if im doing something wrong?

JuanCalle1606 avatar Aug 10 '25 19:08 JuanCalle1606

I want to write back that my problem was fixed, but why it was not clear, for some reason the downloader 4.0.2 did not accept the link https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-rules-dat@release/sing-box/rule-set-geoip/geoip-ru-blocked.srs Image

and here is the link suitable for it https://raw.githubusercontent.com/runetfreedom/russia-v2ray-rules-dat/release/sing-box/rule-set-geoip/geoip-ru-blocked.srs Image

That is, without changing the configuration, just change the link and everything starts working Although it seems that there are requirements for the site (Content-Length...Range..etc) only if you download in chunks, but v2rayn download in 1 chunk anyway And I didn't find any other requirements for the site How do these links differ, why does 2nd work, but the first is not? Or are there any other requirements that I have not found?

Sameguyy avatar Aug 13 '25 12:08 Sameguyy