Author Topic: Timeout when downloading large files  (Read 242 times)

Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Timeout when downloading large files
« on: July 19, 2019, 11:04:41 AM »
Our firewall scans all downloads before forwarding. For this reason, the proxy temporarily sends only very small data packets until the virus scan is completed. Currently, however, Patch My PC cancels the download after only 40 seconds ("An error occurred while downloading the file:  The operation has timed out"). This is too small for larger downloads like LibreOffice.

Is it possible to configure the (proxy) timeout for downloading applications?

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 1834
    • View Profile
    • Patch My PC Support
Re: Timeout when downloading large files
« Reply #1 on: July 19, 2019, 11:41:56 AM »
We will have to look into the methods available in .NET to see if increasing the timeout may help in your scenario.

Our firewall scans all downloads before forwarding. For this reason, the proxy temporarily sends only very small data packets until the virus scan is completed. Currently, however, Patch My PC cancels the download after only 40 seconds ("An error occurred while downloading the file:  The operation has timed out"). This is too small for larger downloads like LibreOffice.

Is it possible to configure the (proxy) timeout for downloading applications?

Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Timeout when downloading large files
« Reply #2 on: August 12, 2019, 11:04:34 AM »
Have you possibly found a way to adjust the proxy timeout? 

The problem also affects other applications (such as Adobe Acrobat DC). By the way, it is currently not 40 seconds to the timeout as I wrote before, but 1 minute and 40 seconds.

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 1834
    • View Profile
    • Patch My PC Support
Re: Timeout when downloading large files
« Reply #3 on: August 12, 2019, 11:06:35 AM »
Curious if you have run any type of network capture during the download timeout?

Have you possibly found a way to adjust the proxy timeout? 

The problem also affects other applications (such as Adobe Acrobat DC). By the way, it is currently not 40 seconds to the timeout as I wrote before, but 1 minute and 40 seconds.

Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Timeout when downloading large files
« Reply #4 on: August 12, 2019, 11:27:18 AM »
I haven't done a network capture yet. However, most other downloads work fine. The proxy always waits for the complete download to complete, so that it can perform a virus scan before forwarding it to the client. For the affected products the download is obviously too slow to download the file within 100 seconds, check for viruses and then forward it to the Patch-My-PC service. I currently assume that adjusting the proxy timeout to e.g. 300 seconds could solve the problem.

However, I will check again in the next few days via network capture whether there could be another cause.

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 1834
    • View Profile
    • Patch My PC Support
Re: Timeout when downloading large files
« Reply #5 on: August 12, 2019, 11:29:48 AM »
As a workaround, you could use this option for now?


Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Timeout when downloading large files
« Reply #6 on: August 12, 2019, 11:42:13 AM »
Yes, as a workaround this is possible. However, I would like to avoid manual downloads in the future.

In principle, we can also switch off the virus scan for these downloads on the proxy as a workaround. Then the downloads will be forwarded to the Patch-My-PC service as supplied by the source. However, I would like to avoid this for security reasons.

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 1834
    • View Profile
    • Patch My PC Support
Re: Timeout when downloading large files
« Reply #7 on: August 12, 2019, 11:47:43 AM »
We already perform VirusTotal scans. Can you exclude it for just the server? https://patchmypc.com/deep-dive-into-security-validation-of-third-party-software-updates-in-microsoft-sccm

Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Timeout when downloading large files
« Reply #8 on: August 12, 2019, 12:03:02 PM »
I'll check that out.

Please consider the following note. If you are using the HttpClient from .Net, then the download time can be extended via the Timeout property.  It is 100 seconds by default, which corresponds to the time where the download is currently aborted in Patch-My-PC (which may also be a coincidence) https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.timeout?view=netframework-4.8

Offline Justin Chalfant

  • Patch My PC Support
  • Administrator
  • Hero Member
  • *****
  • Posts: 1834
    • View Profile
    • Patch My PC Support
Re: Timeout when downloading large files
« Reply #9 on: August 12, 2019, 12:18:00 PM »
There are some other things we need to take into account when increasing the timeout. What's the longest you see for the largest update when downloading through your proxy.

Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Timeout when downloading large files
« Reply #10 on: August 13, 2019, 09:50:56 AM »
I ran some tests on the server with the download URLs aborted by Patch-My-PC using the Powershell function Invoke-WebRequest (which has a -TimeoutSec switch for extending the timeout). Whether the values would be comparable with the .Net download function you used, I cannot estimate.

http://ftp.osuosl.org/pub/tdf/libreoffice/stable/6.1.6/win/x86_64/LibreOffice_6.1.6_Win_x64.msi
640 sec
http://armdl.adobe.com/pub/adobe/acrobat/win/AcrobatDC/1901220035/AcrobatDCUpd1901220035.msp
539 sec
https://cdn.devolutions.net/download/Setup.RemoteDesktopManager.2019.1.39.0.msi
1468 sec

But the main reason seems to be that these sources provide the files only with limited bandwidth.

As already written, for all other downloads we use, the 100 sec time window seems to be sufficient for the download.

Offline quertest

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Timeout when downloading large files
« Reply #11 on: August 14, 2019, 12:20:13 PM »
I repeated the tests because I didn't really trust the very high values of yesterday. This time I used the Powershell function Start-BitsTransfer. The download times are much shorter and probably more comparable with Patch-My-PC.

http://ftp.osuosl.org/pub/tdf/libreoffice/stable/6.1.6/win/x86_64/LibreOffice_6.1.6_Win_x64.msi
195 sec
http://armdl.adobe.com/pub/adobe/acrobat/win/AcrobatDC/1901220035/AcrobatDCUpd1901220035.msp
120 sec
https://cdn.devolutions.net/download/Setup.RemoteDesktopManager.2019.1.39.0.msi
21 sec

The Remote Desktop Manager was probably a temporary problem yesterday.

On the basis of these measured times an extension of the timeout to 300 seconds would seem to be good.