UiPath.DocumentUnderstanding.Persistence.OrchestratorException document understanding

 message: UiPath.DocumentUnderstanding.Persistence.OrchestratorException: Cannot access a closed Stream. ---> System.Exception: System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.ObjectDisposedException: Cannot access a closed Stream. at System.IO.Stream.CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken) at System.Net.Http.DelegatingStream.CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken) at System.Net.Http.StreamToStreamCopy.CopyAsync(Stream source, Stream destination, Int32 bufferSize, Boolean disposeSource, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpContent.<LoadIntoBufferAsyncCore>d__49.MoveNext() --- End of inner exception stack trace --- at System.Net.Http.HttpContent.<LoadIntoBufferAsyncCore>d__49.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at UiPath.DocumentUnderstanding.Persistence.Buckets.<GetWithHttpMessagesAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.DocumentUnderstanding.Persistence.BucketsExtensions.<GetAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.DocumentUnderstanding.Persistence.OrchestratorClient.<InternalExecuteAsync>d__11`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.DocumentUnderstanding.Persistence.OrchestratorClient.<GetBucketIdByNameAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at UiPath.IntelligentOCR.Activities.CreateDocumentClassificationAction.<OnExecuteAsync>d__6.MoveNext() --- End of inner exception stack trace --- at UiPath.DocumentUnderstanding.Persistence.TaskExtensions.ThrowIfNeeded(Task task, Boolean suppressThrowException) at UiPath.IntelligentOCR.Activities.BaseOrchestratorClientAsyncActivity.ThrowIfNeeded(Task task, Boolean suppressThrowException) at UiPath.IntelligentOCR.Activities.BaseOrchestratorClientAsyncActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
level: Error
logType: User 

Hi,

From time to time I get this exception when working with documentunderstanding validation actions. I do not get where it is coming from as most actions do not give this exception. I also do not know what activity gives this exception as the source of the exception is named UiPath.DocumentUnderstanding.Persistence.

I will not be able to share my xaml files, but it only consists of a parrallel for each with the standard document understanding steps like digitize, classify and exctract, without any ML/AI.

The files used are pdf and the orchestrator is an on-prem installation.

Thanks you for your help

1 Like

Hi @Barend,

Have you tried running the solution in debug mode that will help pinpoint the issue better?

Also, Is there any particular instance where/when you face this error?

Regards
Sonali

It does not happen in debug mode

It does not happen in debug mode It only happens in unattended (production) use. I also have not find when or where it happens. It looks like it has to do with the data used in the action not being able to be found in the orchestrator, but i’m not sure.

Hi @Barend,

I would suggest to refer DU template as mentioned in below link.

Looks like you project is missing something which might get resolved if you shift to this template provided by uipath for DU processes.

Hope this helps.

Regards
Sonali

Have you found a solution for this issue? I encountered the same error at Validation/Create data Validation action step.

The error message is not helpful at all unfortunately, and that will be fixed in a future version. It’s just how the .net httpClient behaves when you interrupt it while processing a response. It’s a strange kind of timeout caused by too much parallelism. The executor was doing too much work and didn’t manage to process a response that probably came in time.

This can be easily fixed by setting a higher TimeoutMs value on the Create Validation Action activity, OR you could get rid of that ParallelForEach. The digitization is already sufficiently parallelized as is, and I’m not sure how much sense it would make to simply run the whole flow on each document at the same time (especially if you have no safeguards on how many documents you will process at the same time).

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.