Troubleshooting

The REST API attempts to use appropriate HTTP status codes to indicate any errors that occur while processing requests. These error responses provide detailed information on the underlying fault that can be used for debugging the error as well as providing user friendly feedback in the app.

Error Reporting

All Kinvey REST APIs return error responses using standard HTTP Error codes. The error reporting is designed to make the APIs usable - easy to implement and debug. Starting with API version 1, error responses are consistent across all REST API endpoints and use a structured format.

Every error response uses a universal dictionary to describe the error. The dictionary may see some updates from time to time but any updates are only expected to add new types of errors. Individual REST API methods will describe any behavior that diverges from the dictionary.

ErrorStatusCodeDescription
ParameterValueOutOfRange400The value specified for one of the request parameters is out of range
InvalidQuerySyntax400The query string in the request has an invalid syntax
MissingQuery400The request is missing a query string
JSONParseError400Unable to parse the JSON in the request
MissingRequestHeader400The request is missing a required header
IncompleteRequestBody400The request body is either missing or incomplete
MissingRequestParameter400A required parameter is missing from the request
InvalidIdentifier400One of more identifier names in the request has an invalid format
FeatureUnavailable400Requested functionality is unavailable in this API version
CORSDisabled400Cross Origin Support is disabled for this application
APIVersionNotAvailable400This API version is not available for your app. Please retry your request with a supported API version
BadRequest400Unable to understand request
BLRuntimeError400The Business Logic script has a runtime error. See debug message for details
InvalidCredentials401Invalid credentials. Please retry your request with correct credentials
InsufficientCredentials401The credentials used to authenticate this request are not authorized to run this operation. Please retry your request with appropriate credentials
WritesToCollectionDisallowed403This collection is configured to disallow any modifications to an existing entity or creation of new entities
IndirectCollectionAccessDisallowed403Please use the appropriate API to access this collection for this app backend
AppProblem403There is a problem with this app backend that prevents execution of this operation. Please contact support@kinvey.com for assistance
EntityNotFound404This entity not found in the collection
CollectionNotFound404This collection not found for this app backend
AppNotFound404This app backend not found
UserNotFound404This user does not exist for this app backend
BlobNotFound404This blob not found for this app backend
UserAlreadyExists409This username is already taken. Please retry your request with a different username
StaleRequest409The time window for this request has expired
KinveyInternalErrorRetry500The Kinvey server encountered an unexpected error. Please retry your request
KinveyInternalErrorStop500The Kinvey server encountered an unexpected error. Please contact support@kinvey.com for assistance
DuplicateEndUsers500More than one user registered with this username for this application. Please contact support@kinvey.com for assistance
APIVersionNotImplemented501This API version is not implemented. Please retry your request with a supported API version
APIVersionNotAvailable501This API version is not available for your app. Please retry your request with a supported API version
BLSyntaxError550The Business Logic script has a syntax error(s). See debug message for details
BLTimeoutError 550The Business Logic script did not complete in time. See debug message for details
BLViolationError550The Business Logic script violated a constraint. See debug message for details
BLInternalError550The Business Logic script did not complete. See debug message for details

The body of the response will contain information on the error. The body is JSON formatted like regular responses. Errors are guarenteed to remain unchanged when using a specific API version. Each error response body will have an HTTP response Status Code and up to three attributes - two mandatory and one optional:

  • The error attribute will always be present and contain a String value representing the type of the error.
  • The StatusCode is the HTTP response code associated with the error.
  • The description attribute will always be present and contain a short user friendly description of the error. The description may be passed up to the application user if desired. Kinvey may choose to change the exact text of a description in the future depending on developer feedback.
  • The debug attribute is optional and exists solely to help debug the error. An app may choose to log this debug message if the application is running in debug mode. The Kinvey backend may or may not populate this attribute depending on the exact scenario encountered. The goal with this attribute is to provide useful information that will make it very easy to isolate the root cause and implement a fix.
HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
    “error”: “InsufficientCredentials”
    “description”: “The credentials used to authenticate this request are not authorized to run this operation. Please retry your request with appropriate credentials”
    “debug”: “Please authenticate as an app End User or as the app admin using the Master secret to run this operation”
}

Error Handling

The Kinvey backend handles errors by aborting the request and immediately returning an error response to the client. Requests that result in errors because of bad client behavior can be re-attempted after fixing the underlying fault. Requests that fail because of permanent server side failures are indicated accordingly in the response. For such requests, please contact support@kinvey.com for help.

Debugging

Since all of Kinvey's libraries are built on top of Kinvey's HTTP REST API it is frequently useful to view the HTTP messages that are being sent and received. All requests to Kinvey servers are logged, and all responses, valid or not, include a X-Kinvey-Request-ID header. The request id will be helpful when emailing support@kinvey.com for a particular issue.

Mac users may wish to use WireShark or Charles.

Windows developers can use Fiddler which is the preferred tool at Kinvey.

There are a few open source and proprietary Java tools listed at Ask Ubuntu and, of course, one can always use FireBug through Firefox.

The API Console in the Kinvey console is a great resource for debugging REST API requests. You can use the API console to test any REST API request to the app's backend on Kinvey. Use REST API version 1 or higher to make use of detailed error reporting from Kinvey for isolating the root cause.

Got a question?