UiPath.Executor.UnhandledException: Unhandled exception: System.ArgumentNullException ---> System.ArgumentNullException: Value cannot be null

How to solve this Windows Event Viewer error UiPath.Executor.UnhandledException: Unhandled exception: System.ArgumentNullException ---> System.ArgumentNullException: Value cannot be null?

Issue Description

A Windows or Cross-platform automation process developed in UiPath that utilizes a Get Asset activity is causing the UiPath Executor to crash immediately upon completion of the execution.

After the crash, the following error details are logged in the Windows Event Viewer:

UiPath.Executor 25.10.1.0 

UnhandledException: System.ArgumentNullException: Value cannot be null.

Parameter name: source

at System.Linq.Enumerable.Where[TSource](IEnumerable1 source, Func2 predicate)

at UiPath.OrchestratorClient.Utilities.AssetCacheManager.CacheAssetToFile()

at UiPath.OrchestratorClient.Utilities.AssetCacheManager.<>c.<.ctor>b__14_0(Object sender, EventArgs e), HResult -2147467261

or

UiPath.Executor 25.10.1.0

UiPath.Executor.UnhandledException: Unhandled exception: System.ArgumentNullException —> System.ArgumentNullException: Value cannot be null.

Parameter name: source

at System.Linq.Enumerable.Where[TSource](IEnumerable1 source, Func2 predicate)

at UiPath.OrchestratorClient.Utilities.AssetCacheManager.CacheAssetToFile()

at UiPath.OrchestratorClient.Utilities.AssetCacheManager.<>c.<.ctor>b__14_0(Object sender, EventArgs e)

— End of inner exception stack trace —, HResult -2146233088

Root Cause

The crash is caused by a bug present in older versions of the UiPath.System.Activities package.

Specifically, by using a version of the package lower than 22.10.5, the Get Asset activity triggers a failure in the Asset Cache Manager when the process terminates. The executor attempts to cache asset data but fails due to a null source parameter, resulting in the unhandled exception and crash.

This specific issue was resolved in the v22.10.5 release of the UiPath.System.Activities package.

Resolution

To resolve the issue, an upgrade for the UiPath.System.Activities package in the impacted project is necessary.

Step-by-Step Guide

  1. Open the impacted project in UiPath Studio.

  2. In the "Design" tab, click on Manage Packages.

  3. Go to the Installed tab.

  4. Search for UiPath.System.Activities.

  5. Check the current installed version.

    • If the version is below 22.10.5 (e.g., 22.10.4 or older), an upgrade is required.

  6. Go to the All Packages tab, search for the same package, and select a version that is 22.10.5 or higher.

    • Note: It is recommended to use the latest stable version available unless compatibility with other dependencies is a concern.

  7. Click Install/Update, then save the project.

  8. Republish the process and trigger a new execution.

Verification

  1. Run the unattended process again from UiPath Orchestrator.

  2. Verify that the process completes successfully.

  3. Ensure that no new error events are logged in the Windows Event Viewer under Windows Logs > Application.

Reference: UiPath.System.Activities v22.10.5 Release notes