This error occurs when your application tries to access a DynamoDB table that doesn't exist, isn't in an ACTIVE state, or is in a different AWS region. The most common causes are typos in the table name, wrong region configuration, or the table still being created.
DynamoDB returns TableNotFoundException when you attempt an operation against a table that either doesn't exist in your current AWS account and region, is still being created (CREATING state), or has been deleted. This is a client-side error that indicates a resource lookup failure rather than an issue with the table's data or permissions. The table name lookup is case-sensitive and must match exactly.
Check your code for any typos in the TableName parameter. DynamoDB table names are case-sensitive, so 'MyTable' is different from 'mytable'. Open the AWS Management Console, go to DynamoDB, and confirm the exact spelling of your table name.
// Wrong - typo in name
await dynamodb.getItem({ TableName: 'UsersTable', Key: {...} });
// Correct - exact match
await dynamodb.getItem({ TableName: 'UsersTable', Key: {...} });DynamoDB tables are region-specific. Ensure your SDK client is configured to use the same region where your table exists. Check the AWS Console to see which region your table is in, then update your SDK configuration.
// Node.js/JavaScript - specify correct region
const dynamodb = new DynamoDBClient({ region: 'us-east-1' });
// Python/Boto3
import boto3
ynamodb = boto3.client('dynamodb', region_name='us-east-1')
// AWS CLI
aws dynamodb list-tables --region us-east-1Use the AWS CLI or Console to confirm the table exists and has ACTIVE status. If the table is in CREATING state, wait until it transitions to ACTIVE before accessing it.
# AWS CLI - describe table to check status
aws dynamodb describe-table --table-name UsersTable --region us-east-1
# AWS CLI - list all tables
aws dynamodb list-tables --region us-east-1In the output, look for "TableStatus": "ACTIVE". If it shows CREATING or DELETING, wait for the operation to complete.
If you're using Infrastructure as Code, verify that your CloudFormation stack or Terraform apply has completed successfully. Tables may take 10-30 seconds to reach ACTIVE state after creation.
# CloudFormation - check stack status
aws cloudformation describe-stacks --stack-name my-dynamodb-stack
# Terraform - check apply status
terraform apply # and wait for completion
terraform state show aws_dynamodb_table.my_tableIf you're developing locally with DynamoDB Local, ensure the local instance is running and accessible. The default endpoint is http://localhost:8000.
# Start DynamoDB Local (Java must be installed)
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar
# Configure SDK to use local endpoint
const dynamodb = new DynamoDBClient({
region: 'local',
endpoint: 'http://localhost:8000',
credentials: {
accessKeyId: 'local',
secretAccessKey: 'local',
},
});Ensure the IAM user, role, or service has permissions to describe and access the table. The principal needs at least dynamodb:DescribeTable and the specific operation permissions (e.g., dynamodb:GetItem).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:DescribeTable"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/UsersTable"
}
]
}Always wrap DynamoDB operations in try-catch blocks to handle TableNotFoundException gracefully. This helps you identify configuration issues early.
// Node.js - catching TableNotFoundException
try {
const response = await dynamodb.getItem({
TableName: 'UsersTable',
Key: { id: { S: '123' } },
});
} catch (error) {
if (error.name === 'ResourceNotFoundException' || error.name === 'TableNotFoundException') {
console.error('Table does not exist or is not ready yet');
} else {
throw error;
}
}
// Python - catching TableNotFoundException
try:
response = dynamodb.get_item(TableName='UsersTable', Key={'id': {'S': '123'}})
except dynamodb.exceptions.TableNotFoundException:
print('Table does not exist or is not ready yet')DynamoDB table creation is asynchronous - it can take 10-30 seconds for a newly created table to reach ACTIVE status. Always implement exponential backoff retry logic when accessing newly created tables. AWS SDKs handle some retries automatically, but you may need custom logic for table creation followed by immediate access. Global Tables use a different creation model than standard tables - when creating a global table, AWS automatically creates replicas in other regions, which takes longer. When using DynamoDB Local for development, remember that each table namespace is separate from AWS-hosted DynamoDB, so tables created locally won't exist in production unless explicitly created there. Cross-account access to DynamoDB requires additional IAM trust relationships and resource-based policies beyond standard table permissions.
ValidationException: The provided key element does not match the schema
How to fix "ValidationException: The provided key element does not match the schema" in DynamoDB
UnrecognizedClientException: The security token included in the request is invalid
How to fix "UnrecognizedClientException: The security token included in the request is invalid" in DynamoDB
TransactionCanceledException: Transaction cancelled
How to fix "TransactionCanceledException: Transaction cancelled" in DynamoDB
RequestLimitExceeded: Throughput exceeds the current throughput limit for your account
How to fix "RequestLimitExceeded: Throughput exceeds the current throughput limit for your account" in DynamoDB
InternalServerError: Internal Server Error
How to fix "InternalServerError" in DynamoDB