Errors

Operations that you perform with Bulk API 2.0 can trigger error codes. This list shows the most common error codes and the Bulk API 2.0 action that possibly triggered them.

For HTTP response codes, see Status Codes and Error Responses.

Tip

ClientInputError
The operation failed with an unknown client-side error.
For binary attachments, the request content is provided both as an input stream and an attachment.
ExceededQuota
The job or batch you tried to create exceeds the allowed number for the past 24-hour period.
FeatureNotEnabled
Bulk API 2.0 isn’t enabled for this organization.
InvalidBatch
The batch ID specified in a batch update or query is invalid.
This error code is returned for binary attachments when the zip content is malformed or these conditions occur:
  • The request.txt file can't be found, can't be read, is a directory, or contains invalid content.
  • The decompressed size of a binary attachment is too large.
  • The size of the zip file is too large.
  • The total decompressed size of all the binary attachments is too large.

A StatusCode of INVALID_FIELD is returned for the following conditions:

  • A binary file referenced in the batch data is missing or is a directory.
  • A binary file referenced in the batch data doesn't start with #.

Note

For more information about binary attachment limits, see the “General Limits” section in Bulk API and Bulk API 2.0 Limits and Allocations.
InvalidJob
The job ID specified in a query or update for a job, or a create, update, or query for batches is invalid.
The user attempted to create a job using a zip content type in API version 19.0 or earlier.
InvalidJobState
The job state specified in a job update operation is invalid.
InvalidOperation
The operation specified in a URI for a job is invalid. Check the spelling of “job” in the URI.
InvalidSessionId
The session ID specified is invalid.
InvalidUrl
The URI specified is invalid.
InvalidUser
Either the user sending a Bulk API 2.0 request doesn't have the correct permission, or the job or batch specified was created by another user.
InvalidXML
XML contained in the request body is invalid.
MethodNotAllowed
HTTP Method '<displays incorrect method>' not allowed. Allowed are <displays correct method(s)>.
NotFound
The requested resource does not exist. Check the job id, api version, and URI.
Timeout
The connection timed out. This error is thrown if Salesforce takes too long to process a batch. To resolve timeouts, see
TooManyLockFailure
Too many lock failures while processing the current batch. This error may be returned during processing of a batch. To resolve, see General Guidelines for Data Loads.
Unknown
Exception with unknown cause occurred.

In addition, Bulk API 2.0 uses the same status codes and exception codes as SOAP API. For more information on these codes, see “ExceptionCode” in the SOAP API Developer Guide.