Insights has the following exception" System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 1 seconds elapsing."

Insights has the following exception " System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 1 seconds elapsing. "

Issue Description: Insights has the following exception

System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 1 seconds elapsing.

Root Cause:

By default the Orchestrator API call timeouts were set too low for some environments. This is fixed in all 22.10+ versions.

Diagnosing/Resolving:
  1. Typically this error would be discovered by following the steps outlined in this following KB article: How to Debug Insights License Issues?
  2. To resolve the issue, run the following powershell commands on the Insights machine.
    1. # Create a backup of the existing appsettings.json file
      Copy-Item -Path 'C:\Program Files (x86)\UiPath Insights\Insights\appsettings.json' -Destination 'C:\Program Files (x86)\UiPath Insights\Insights\appsettings_backup.json'
      

      Load the content of the existing appsettings.json file

      $json = Get-Content 'C:\Program Files (x86)\UiPath Insights\Insights\appsettings.json' | ConvertFrom-Json

      Add the 'Orch' property with nested 'timeoutInSeconds' property

      $json | Add-Member -Type NoteProperty -Name 'Orch' -Value @{timeoutInSeconds = '60'}

      Write the updated content back to the file

      $json | ConvertTo-Json -Depth 25 | Set-Content 'C:\Program Files (x86)\UiPath Insights\Insights\appsettings.json'


    2. Alternatively, the file C:\Program Files (x86)\UiPath Insights\Insights\appsettings.json can be updated to include an Orchestrator key like below:


      1. {
        "Orch": {
        "timeoutInSeconds": "60"
        }

      2. The 'Orch' is added to the root level as a new key. Its recommended to run the powershell script if unfamiliar with setting files in the json format


  3. After the change has been made, do an IISreset and try logging in again
  4. If this issue does not resolve the issue, go through How to Debug Insights License Issues, collecting the logs as describe in that article
    1. Make sure to record the time stamps of when the login attempt is made. Need to correlate events between Orchestrator and Insights

  5. Additionally, grab the IIS logs from Orchestrator
    1. IIS Logging Overview | Microsoft Learn
    2. These are typically under: C:\inetpub\logs\LogFiles\W3SVC2
      1. This location is customizable, so check your IIS settings if the location is different.
      2. The two in W3SVC2 represents the site number. Typically the default site occupies W3SVC1.


  6. With the correct logs gathered, raise a ticket with UiPath Support.