Error "One or more errors occurred" encountered when trying to upload file to SharePoint using Office 365 activities

How to troubleshoot error "One or more errors occurred" that occurs with Office 365 activities while uploading files to SharePoint?

Issue Description: While uploading a file to a SharePoint site using Upload File activity from UiPath.MicrosoftOffice365.Activities, an error "One or more errors occurred" is thrown.

Root Cause: The issue occurs if the uploading file size is 0 KB.

Resolution:

  • Make sure to upload a file whose size is greater than 0 KB

To confirm if the issue mentioned in this article is same as what you are observing, validate the following:

  1. Execute the project from UiPath Studio in the Debug mode, click on the highlighted magnifying glass icon next to the 'exceptionDetails' and check if the exception stack trace matches exactly as mentioned below.
  2. This can be validated based on the logs in the Orchestrator as documented in the KB Article Code: generalException [Microsoft Office 365].

image (20).png

RemoteException wrapping System.AggregateException: One or more errors occurred.  
---> RemoteException wrapping System.Threading.Tasks.TaskCanceledException: A task was canceled. 

--- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
   at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
   at UiPath.Shared.Activities.ContinuableAsyncCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
   at UiPath.MicrosoftOffice365.Activities.Office365BaseClientActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
   at UiPath.MicrosoftOffice365.Activities.Office365ClientActivity`2.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)