Troubleshooting applications - Amazon MemoryDB for Redis
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Troubleshooting applications

MemoryDB provides specific and descriptive errors to help you troubleshoot problems while interacting with the MemoryDB API.

Retrieving errors

Typically, you want your application to check whether a request generated an error before you spend any time processing results. The easiest way to find out if an error occurred is to look for an Error node in the response from the MemoryDB API.

XPath syntax provides a simple way to search for the presence of an Error node, as well as an easy way to retrieve the error code and message. The following code snippet uses Perl and the XML::XPath module to determine if an error occurred during a request. If an error occurred, the code prints the first error code and message in the response.

use XML::XPath; my $xp = XML::XPath->new(xml =>$response); if ( $xp->find("//Error") ) {print "There was an error processing your request:\n", " Error code: ", $xp->findvalue("//Error[1]/Code"), "\n", " ", $xp->findvalue("//Error[1]/Message"), "\n\n"; }

Troubleshooting tips

We recommend the following processes to diagnose and resolve problems with the MemoryDB API.

  • Verify that MemoryDB is running correctly.

    To do this, simply open a browser window and submit a query request to the MemoryDB service (such as https://memory-db.us-east-1.amazonaws.com). A MissingAuthenticationTokenException or UnknownOperationException confirms that the service is available and responding to requests.

  • Check the structure of your request.

    Each MemoryDB operation has a reference page in the MemoryDB API Reference. Double-check that you are using parameters correctly. To give you ideas regarding what might be wrong, look at the sample requests or user scenarios to see if those examples are doing similar operations.

  • Check the forum.

    MemoryDB has a discussion forum where you can search for solutions to problems others have experienced along the way. To view the forum, see

    https://forums.aws.csdn.net/ .