Salesforce

Handling file upload errors

« Go Back
Information
Handling file upload errors
000003955
Public
Product Selection
aiWare - aiWare
Article Details

While Veritone supports a number of methods for easily and securely uploading files, there are certain conditions that can cause an upload to fail. This topic discusses those below.

Also see:

Local system file upload error

Attempting to upload or attach a file that exceeds 100MB will return an HTTP 413 error response that looks similar to the following:

{
  "errors":[
    {
      "code":"LIMIT_FILE_SIZE",
      "field":"file",
      "storageErrors":[],
      "data":{
        "limitInBytes":104857600,
        "requestSize":"2295200106",
        "errorId":"ab3efd8f-c0de-4c84-b299-1d7698b4a9b8"
      },
      "name":"invalid_input",
      "message":"The file upload was larger than the limit allowed by this server. The maximum file upload size is 104857600 bytes (100 mb)."
    }
  ]
}

If the file exceeds the allowable limit, there are two options to work around the 100MB restriction:

  • Split the file into smaller chunks. Although 100MB is a reasonable size for most artifacts (such as long multimedia recordings), cognitive engine processing and analysis performs more efficiently and reliably with smaller object sizes.

Pre-signed URL upload error

A pre-signed URL upload failure will result in a 403 error. If this error occurs, be sure the request conforms to the following guidelines:

  • Verify it is HTTP PUT (not GET or POST) and that the URL has not expired. The expiresInSeconds field indicates the amount of time remaining (in seconds) before the URL expires.
  • If using a client-side HTTP library, check that no headers have been added to the request and that the URL has not been modified in any way.

Query size error

Requests that exceed the maximum allowed query size will return a HTTP 413 response with the following message in the response body:

{
  "errors":[
    {
      "data":{
        "limitInBytes":1000000,
        "requestSize":"1200011",
        "errorId":"752b9354-8fbd-4071-9a2b-522add55b944"
      },
      "name":"invalid_input",
      "message":"The request payload was larger than the limit allowed by this server. The maximum JSON request size is 10000000 bytes (10 mb)."
    }
  ]
}

Typically, this error is encountered when the request payload exceeds the maximum 10MB limit. Below are two common causes and recommended solutions.

Automated querying

A manually constructed query is unlikely to exceed the size capacity. However, queries that are machine-generated through a loop or other input type may attempt to retrieve or edit too many objects in batch and, as a result, they will exceed the allowable limit. Work around this issue by modifying the code and splitting the query into batches of bounded size. Then, submit the smaller queries using multiple sequential requests.

Arbitrary JSON input

Although some mutation and data type fields take arbitrary JSON as input, these fields are not designed to consume large objects. An input field with a large JSON representation could alone exceed the allowable 10MB limit and cause the request to fail. For example, the output field of the updateTask mutation could contain a large JSON input value. In this case, even though the base GraphQL query may be small, the size of the output field value could exceed the maximum query size limit. To work around this issue, simply reduce the size of the payload by either splitting the input into multiple objects or by uploading it as a file.

  • For an extensive collection of GraphQL example queries and mutations, see API examples.
Additional Technical Documentation Information
Properties
12/20/2023 7:28 PM
12/20/2023 7:30 PM
12/20/2023 7:30 PM
Documentation
Documentation
000003955
Translation Information
English

Powered by