

# Neptune Service Errors
<a name="errors"></a>

Amazon Neptune has two different sets of errors:
+ The graph engine errors that are for the Neptune DB cluster endpoints only.
+ The errors that are associated with the APIs for creating and modifying Neptune resources with the AWS SDK and AWS Command Line Interface (AWS CLI).

**Topics**
+ [Insufficient DB instances available](insufficientDBInstancesAvailable.md)
+ [Graph Engine Error Messages and Codes](errors-engine-codes.md)
+ [DB Cluster Management API Error Messages and Codes](CommonErrors.md)
+ [Neptune Loader Error and Feed Messages](loader-message.md)

# Insufficient DB instances available
<a name="insufficientDBInstancesAvailable"></a>

 The `InsufficientDBInstanceCapacity` error can be returned when you try to create, start, or modify a DB instance. It can also be returned when you try to restore a DB instance from a DB snapshot. When this error is returned, a common cause is that the specific DB instance class isn't available in the requested Availability Zone. You can try one of the following to solve the problem: 
+  Retry the request with a different DB instance class. 
+  Retry the request with a different Availability Zone. 
+  Retry the request without specifying an explicit Availability Zone. 

 For information about troubleshooting instance capacity issues for Amazon EC2, see [ Insufficient instance capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshooting-launch.html#troubleshooting-launch-capacity) in the Amazon EC2 User Guide. 

# Graph Engine Error Messages and Codes
<a name="errors-engine-codes"></a>

Amazon Neptune endpoints return the standard errors for Gremlin and SPARQL when encountered. 

Errors that are specific to Neptune can also be returned from the same endpoints. This section documents Neptune error messages, codes, and recommended actions.

**Note**  
These errors are for the Neptune DB cluster endpoints only. The APIs for creating and modifying Neptune resources with the AWS SDK and AWS CLI have a different set of common errors. For information about those errors, see [DB Cluster Management API Error Messages and Codes](CommonErrors.md).

## Graph Engine Error Format
<a name="errors-format"></a>

Neptune error messages return a relevant HTTP error code and a JSON-formatted response.

```
HTTP/1.1 400 Bad Request
x-amzn-RequestId: LDM6CJP8RMQ1FHKSC1RBVJFPNVV4KQNSO5AEMF66Q9ASUAAJG
Content-Type: application/x-amz-json-1.0
Content-Length: 465
Date: Thu, 15 Mar 2017 23:56:23 GMT

{
    "requestId": "0dbcded3-a9a1-4a25-b419-828c46342e47",
    "code": "ReadOnlyViolationException",
    "detailedMessage": "The request is rejected because it violates some read-only restriction, such as a designation of a replica as read-only."
}
```

## Graph Engine Query Errors
<a name="errors-query"></a>

The following table contains the error code, message, and HTTP status.

It also indicates whether it is OK to retry the request. Generally, it is OK to retry the request if it might succeed on a new try. 


| Neptune Service Error Code | HTTP status | Ok to Retry? | Message | 
| --- |--- |--- |--- |
| AccessDeniedException | 403 | No | Authentication or authorization failure. | 
| BadRequestException | 400 | No | The request could not be completed. | 
| BadRequestException | 400 | No | Request size exceeds max allowed value of 157286400 bytes. | 
| CancelledByUserException | 500 | Yes | The request processing was cancelled by an authorized client. | 
| ConcurrentModificationException | 500 | Yes | The request processing did not succeed due to a modification conflict. The client should retry the request. | 
| ConstraintViolationException | 400 | Yes | The query engine discovered, during the execution of the request, that the completion of some operation is impossible without violating some data integrity constraints, such as persistence of in- and out-vertices while adding an edge. Such conditions are typically observed if there are concurrent modifications to the graph, and are transient. The client should retry the request. | 
| FailureByQueryException  | 500 | Yes | Calling fail() caused request processing to fail. The client may retry the request presuming the logic in the query could be expected to succeed on a later attempt. As a result, the choice to retry will be query specific. | 
| InternalFailureException | 500 | No | The request processing has failed. | 
| InvalidNumericDataException | 400 | No | Invalid use of numeric data which cannot be represented in 64-bit storage size. | 
| InvalidParameterException | 400 | No | An invalid or out-of-range value was supplied for some input parameter or invalid syntax in a supplied RDF file. | 
| MalformedQueryException | 400 | No | The request is rejected because it contains a query that is syntactically incorrect or does not pass additional validation. | 
| MemoryLimitExceededException | 500 | Yes | The request processing did not succeed due to lack of memory, but can be retried when the server is less busy. | 
| MethodNotAllowedException | 405 | No | The request is rejected because the chosen HTTP method is not supported by the used endpoint. | 
| MissingParameterException | 400 | No | A required parameter for the specified action is not supplied. | 
| QueryLimitExceededException | 500 | Yes | The request processing did not succeed due to the lack of a limited resource, but can be retried when the server is less busy. | 
| QueryLimitException | 400 | No | Size of query exceeds system limit. | 
| QueryTooLargeException | 400 | No | The request was rejected because its body is too large. | 
| ReadOnlyViolationException | 400 | No | The request is rejected because it violates some read-only restriction, such as a designation of a replica as read-only. | 
| ThrottlingException | 500 | Yes | Rate of requests exceeds the maximum throughput. OK to retry. | 
| TimeLimitExceededException | 500 | Maybe | The request processing timed out. | 
| TooManyRequestsException | 429 | Yes | The rate of requests exceeds the maximum throughput. OK to retry. | 
| UnsupportedOperationException | 400 | No | The request uses a currently unsupported feature or construct. | 

**Important**  
Whether or not to retry an error often involves important nuances related to the nature of the failure, the workload, and the error patterns you observe. For detailed guidance on developing a practical retry strategy, see [Exception Handling and Retries](transactions-exceptions.md).

## IAM Authentication Errors
<a name="errors-iam-auth"></a>

These errors are specific to cluster that have IAM authentication enabled.

The following table contains the error code, message, and HTTP status.


| Neptune Service Error Code | HTTP status | Message | 
| --- |--- |--- |
| Incorrect IAM User/Policy | 403 | You do not have sufficient access to perform this action. | 
| Incorrect or Missing Region | 403 | Credential should be scoped to a valid Region, not 'region'. | 
| Incorrect or Missing Service Name | 403 | Credential should be scoped to correct service: 'neptune-db'. | 
| Incorrect or Missing Host Header / Invalid Signature | 403 | The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. Host header is missing or hostname is incorrect. | 
| Missing X-Amz-Security-Token | 403 | 'x-amz-security-token' is named as a SignedHeader, but it does not exist in the HTTP request | 
| Missing Authorization Header | 403 | The request did not include the required authorization header, or it was malformed. | 
| Missing Authentication Token | 403 | Missing Authentication Token. | 
| Old Date | 403 | Signature expired: 20181011T213907Z is now earlier than 20181011T213915Z (20181011T214415Z - 5 min.) | 
| Future Date | 403 | Signature not yet current: 20500224T213559Z is still later than 20181108T225925Z (20181108T225425Z \$1 5 min.) | 
| Incorrect Date Format | 403 | Date must be in ISO-8601 'basic format'. Got 'date'. See [https://en.wikipedia.org/wiki/ISO_8601](https://en.wikipedia.org/wiki/ISO_8601). | 
| Unknown/Missing Access Key or Session Token | 403 | The security token included in the request is invalid.  | 
| Unknown/Missing Secret Key | 403 | The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. Host header is missing or hostname is incorrect. | 
| TooManyRequestsException | 429 | The rate of requests exceeds the maximum throughput. OK to retry. | 

# DB Cluster Management API Error Messages and Codes
<a name="CommonErrors"></a>

These Amazon Neptune errors are associated with the APIs for creating and modifying Neptune resources with the AWS SDK and AWS CLI.

The following table contains the error code, message, and HTTP status.


| Neptune Service Error Code | HTTP status | Message | 
| --- |--- |--- |
| AccessDeniedException | 403 |  You do not have sufficient access to perform this action.  | 
| IncompleteSignature | 400 |  The request signature does not conform to AWS standards.  | 
| InternalFailure | 500 |  The request processing has failed because of an unknown error, exception, or failure.  | 
| InvalidAction | 400 |  The action or operation requested is invalid. Verify that the action is typed correctly.  | 
| InvalidClientTokenId | 403 |  The X.509 certificate or AWS access key ID provided does not exist in our records.  | 
| InvalidParameterCombination | 400 |  Parameters that must not be used together were used together.  | 
| InvalidParameterValue | 400 |  An invalid or out-of-range value was supplied for the input parameter.  | 
| InvalidQueryParameter | 400 |  An invalid or out-of-range value was supplied for the input parameter.  | 
| MalformedQueryString | 400 |  The query string contains a syntax error.  | 
| MissingAction | 400 |  The request is missing an action or a required parameter.  | 
| MissingAuthenticationToken | 403 |  The request must contain either a valid (registered) AWS access key ID or X.509 certificate.  | 
| MissingParameter | 400 |  A required parameter for the specified action is not supplied.  | 
| OptInRequired | 403 |  The AWS access key ID needs a subscription for the service.  | 
| RequestExpired | 400 |  The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for presigned URLs), or the date stamp on the request is more than 15 minutes in the future.   | 
| ServiceUnavailable | 503 |  The request has failed due to a temporary failure of the server.  | 
| ThrottlingException | 500 |  The request was denied due to request throttling.  | 
| ValidationError | 400 |  The input fails to satisfy the constraints specified by an AWS service.  | 

# Neptune Loader Error and Feed Messages
<a name="loader-message"></a>

The following messages are returned by the `status` endpoint of the Neptune Loader. For more information, see [Get-Status API](load-api-reference-status.md).

The following table contains loader feed code and description.


| Error or Feed Code | Description | 
| --- |--- |
|  LOAD\$1NOT\$1STARTED  |  Load has been recorded but not started.  | 
|  LOAD\$1IN\$1PROGRESS  |  Indicates that loading is in progress and specifies the number of files currently being loaded. When the loader parses a file, it creates one or more chunks to load in parallel. Because a single file can produce multiple chunks, the file count included with this message is usually less than the number of threads being used by the bulk load process.  | 
|  LOAD\$1COMPLETED  |  Load has completed without any errors or errors within an acceptable threshold.  | 
|  LOAD\$1CANCELLED\$1BY\$1USER  |  Load has been cancelled by user.  | 
|  LOAD\$1CANCELLED\$1DUE\$1TO\$1ERRORS  |  Load has been cancelled by the system due to errors.  | 
|  LOAD\$1UNEXPECTED\$1ERROR  |  Load failed with an unexpected error.  | 
|  LOAD\$1FAILED  |  Load failed as a result of one or more errors.  | 
|  LOAD\$1S3\$1READ\$1ERROR  |  Feed failed due to intermittent or transient Amazon S3 connectivity issues. If any of the feeds receive this error, overall load status is set to LOAD\$1FAILED.  | 
|  LOAD\$1S3\$1ACCESS\$1DENIED\$1ERROR  |  Access was denied to the S3 bucket. If any of the feeds receive this error, overall load status is set to LOAD\$1FAILED.  | 
|  LOAD\$1COMMITTED\$1W\$1WRITE\$1CONFLICTS  |  Loaded data committed with unresolved write conflicts. The loader will try to resolve the write conflicts in separate transactions and update the feed status as the load progresses. If the final feed status is LOAD\$1COMMITTED\$1W\$1WRITE\$1CONFLICTS, then try resuming the load and it will likely succeed without write conflicts. A write conflict is not usually related to bad input data, but duplicates in data can increase the likelihood of write conflicts.  | 
|  LOAD\$1DATA\$1DEADLOCK  | Load was automatically rolled back due to deadlock. | 
|  LOAD\$1DATA\$1FAILED\$1DUE\$1TO\$1FEED\$1MODIFIED\$1OR\$1DELETED  |  Feed failed because file was deleted or updated after load start.  | 
|  LOAD\$1FAILED\$1BECAUSE\$1DEPENDENCY\$1NOT\$1SATISFIED  |  The load request was not executed because its dependency check fails.  | 
|  LOAD\$1IN\$1QUEUE  |  The load request has been queued up and is waiting to be executed.  | 
|  LOAD\$1FAILED\$1INVALID\$1REQUEST  |  The load failed because the request was invalid (for example, the specified source/bucket may not exist, or the file format is invalid).  | 