Apps Storage Bucket Upload Returns Error Occurred While Uploading

UiPath Apps - Error upload file to storage bucket.

Issue Description

While uploading a file using storage buckets in Apps, the file fails to upload. The error might vary but typically the following errors may be seen:

  • "Error occurred while uploading"
image.png
  • "Storage Bucket Error"
image.png

Root Cause

To upload a file to a storage bucket the following happens:

  1. The app has to get a signed URL. This request is made by the apps service. If this request fails, the HTTP response seen by the user will be a 400.
  2. The browser takes the signed URL and uses it to upload the file. If this request fails, the most probable issue is that it was a CORS issue.

Resolution

Note: When gathering logs, it is important to record timestamps of when the issue happened.

  1. For most apps issues, the first thing to do is to get a HAR trace.
    1. The following KB article can be used for enabling the network trace and saving the log: How To Generate A HAR File?
    2. Enable the network trace and then reproduce the issue.
    3. Make sure to save the HAR trace, so that it can be sent to UiPath.
  1. After the HAR trace is saved, verify the network trace to see which request is failing. The request will always be in red. Locate the red request. The following is a screenshot of what the red request would look like:
image.png
  1. As can be seen in this example, two requests failed
  1. Once the request is located, it is important to pay attention to the "Status" field. If it says "CORS" make a note of that
  1. Once the request is located, click on it. After clicking on it, the display should look similar to:
image.png
  1. Notice that the full request URL is displayed in the Red Box. This shows the full URL and lets us know which endpoint is failing. Two requests might fail:
  1. The request for the signed URL. This request will look something like:
https://cloud.uipath.com/aif/apps_/default/api/v1/default/orchestrator/IDb31240ba96e245b38fc4572aff5d66cc/storage/1?contentType=&path=config_d8f634accdd44f1ba10f7bd8430322ba.yaml
image.png
  1. The request to upload the file. The request will look something like:
https://buckettest.eastus.cloudapp.azure.com/api/BlobFileAccess/Put?t=d5bd4618-34f9-4a7a-841f-998407b81e71&r=eyJFeCI6IjIwMjItMTAtMTVUMTk6MjY6MzUuMDgwOTA2NSswMDowMCIsIkJJZCI6IjFkMWFlYmNhLTYyOTgtNGEyZi04NDRlLTk3MjU4Njk1OGRhNiIsIkJGcCI6ImNvbmZpZ19kOGY2MzRhY2NkZDQ0ZjFiYTEwZjdiZDg0MzAzMjJiYS55YW1sIiwiQW0iOjF9&s=ASCLsggkm_5RJgiC2knKDp8SwF6XtE1rU7BYb6DGkz4.
See step five for an example screenshot.
  1. The main difference between the requests is that
    • The signed URL request is to the Apps service. So in this considered example, Cloud is used and the request is to the cloud service.
    • The request to upload the file is to an On-Prem Orchestrator instance, so the request is to the On-Prem Orchestrator URL that is being used in this example.
  1. If the signed URL request failed, it most likely means that the Apps service failed to request a signed URL from Orchestrator. In that case take the following steps:
    1. Make sure the bucket still exists. Log in to Orchestrator and make sure the bucket is present.
    2. If using cloud.uipath.com and this is an integration with on prem Orchestrator, then:
      • Make sure that Orchestrator is still accessible by the apps service. This can be done by creating a simple app that communicates with your on prem Orchestrator. When configuring the app, it will require us to login to Orchestrator. If that fails, then that most likely is the cause of the issue.
      • Possible causes could be: The Orchestrator instance is no longer reachable on the public internet, or that the credentials changed.
      • If the Orchestrator is still accessible by the Apps service, gather the Orchestrator event logs and open a ticket with UiPath.
How To Get Application Logs From The Event Viewer?
  1. If using Automation Suite, gather a support bundle.
    • Using the Automation Suite Support Bundle Tool
    • In the support bundle, verify the apps service logs. These are in the support bundle under logs/uipath/apps-runtime-*
    • It may be required to open a ticket with UiPath to understand the issue.
  2. If using cloud.uipath.com with a cloud instance of Orchestrator:
  1. If the issue fails on the request to upload the bucket, most likely this is a CORS error message.
    1. In such a case, the red error in the network trace will show CORS under the status field.
    2. Additionally in the network trace debug window, at the top is a tab for the 'Console'. Select 'Console'.
    3. There should be an error message here that mentions something about a CORS issue.
image.png
  1. Take a screenshot of this if a ticket is going to be opened with UiPath Support.
  2. A CORS issue means the browser blocked the request because it might be safe to send a request to the target storage location.
  3. How this is resolved, depends on the target location
    • For Orchestrator On-Prem with Cloud - The UiPath.Orchestrator.dll.config file needs to be updated to trust cloud.uipath.com
      • See Orchestrator DLL Config - Authorization
      • In the Orchestrator.UiPath.dll.config (under C:\Program Files (x86)\UiPath\Orchestrator\UiPath.Orchestrator.dll.config add the key under the AppSettings section:
i.e.
image.png
  • For external bucket providers (Azure,Minio,S3, etc)
    • CORS/ CSP Configuration
    • If using Orchestrator on Prem with Cloud Apps, then cloud.uipath.com needs to be added, along with the On-Prem Orchestrator URL.
  • If using Automation Suite, with Orchestrator storage, gather the support bundle and open a ticket with UiPath.
See Automation Suite - Support Bundle Tool
  • If the above article does not help resolve the issue open a ticket with UiPath.
When opening a ticket make sure to include all the information that was gathered as part of this article. (i.e. HAR trace, console logs, etc).