Failed to process document. Exception: mscorlib : Attempted to access an element as a type incompatible with the array

Hello All,

I’m trying to run a DU automation which worked well in attended mode, but in unattended mode, it throws an error before the document kicks into action center, Error is as follows.

Failed to process document. Exception: mscorlib : Attempted to access an element as a type incompatible with the array.

Process was aborted due to: System.ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array. at System.Collections.Generic.List`1.Add(T item) at UiPath.DocumentUnderstanding.Persistence.UiPathWebApi.Initialize() at UiPath.DocumentUnderstanding.Persistence.ActivityContextExtensions.GenerateClientFromContext(ActivityContext context, Int32 timeoutMs, String folderPath, CancellationToken cancellationToken) at UiPath.DocumentUnderstanding.Persistence.OrchestratorService.GetOrchestratorClient(ActivityContext context, Int32 timeoutMs, String folderPath, CancellationToken cancellationToken) at UiPath.IntelligentOCR.Activities.BaseOrchestratorClientAsyncActivity.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state) at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Hi @sharon.palawandram ,

Could you let us know maybe by Debugging which exact activity the Error happens ?

Also, If using the DU framework certain assets need to be configured. Is that already done ? We do see these errors happen when certain Orchestrator related configuration (Setting up of Assets) is not done completely.

This comes when documents are kicked into action center.

It works perfectly fine in attended mode, how is this possible?

@sharon.palawandram ,

When using the DU framework in Unattended Mode, we have the Create Document Data Validation Action activity.
image

When using the DU framework in Attended mode, we have the Present Validation Station Activity.
image

If observed, we do not have the Storage Bucket and Action Catalog properties for the attended case scenario. Hence, these configurations are required in an Unattended case (Catalog maybe optional).

If the errors are happening at this activity then we would suggest to re-check if all the Config and Orchestrator values are set for this to work properly.

Hey Arpan,

Thank you for your reply. For my attended automation I have already added create and wait for data validation (both) That’s how I knew the automation always kicks into the action center in the same orchestrator connected. Here are my variables.

I have checked the config and orchestrator values and it doesn’t work with everything in place in unattended mode. Any suggestions?

@sharon.palawandram

Can you try adding .ToString to all the config values…

As per error its failing at creation of serialized array…and in nee .net type casting is important…so this might help in solving the issue

Cheers

Hey Anil,

Thank you for your reply. I’ve changed all AC configs to string values, but the error still persists,

image

Any help would be appreciated.

@sharon.palawandram

Are there any other datatypes that were declared in the same scope as this is present…

Ideally persistent activities are to be run in the main flow only. I believe you would have considered the same

Cheers

Correct, I have added AC in the main flow. I will check on this.

1 Like