Cannot do operations on a non-existent table (DynamoDB Local)
TL;DR — This is DynamoDB Local's wording of ResourceNotFoundException, and the trap is that "non-existent" is scoped to the database file this instance opened for your current access key + region. Without -sharedDb, Local keeps a separate table set per credentials/region combo — so the table you created with the CLI can be invisible to your app. Run Local with -sharedDb (or pin identical dummy credentials + region everywhere), and remember -inMemory starts empty on every restart.
What it means
ResourceNotFoundException: Cannot do operations on a non-existent tableYour request reached a running DynamoDB Local, which looked for the table and didn't find it — in the database it's using for your request's identity. Real AWS words the same failure differently (Requested resource not found), so this exact message is a strong hint you're talking to an emulator.
Why it happens
- Credential/region split-brain (the classic). Without
-sharedDb, DynamoDB Local names its database file after the access key ID and region of each request. Your CLI (--profilewith keylocal, regionus-east-1) and your app (keyfake, regionlocal) therefore see two different table sets — each created the table "for itself". -inMemory+ a restart — in-memory mode keeps nothing on disk; every restart is a blank database.- A fresh container without a volume —
docker run amazon/dynamodb-localstarts empty; tables from the previous container are gone unless you mounted-dbPathstorage. - The table genuinely wasn't created — setup scripts didn't run, or created it against a different port/instance.
- Same code pointed at real AWS vs Local — the table exists in the cloud but not in the emulator (or vice versa).
How to fix it
See what THIS identity sees — list tables with exactly the credentials/region/endpoint your app uses:
AWS_ACCESS_KEY_ID=local AWS_SECRET_ACCESS_KEY=local \ aws dynamodb list-tables --endpoint-url http://localhost:8000 --region us-east-1If the table's missing here but exists "somewhere", it's the scoping.
Run Local with
-sharedDbso every client shares one database regardless of credentials/region:java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb # docker: docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDbOr pin one identity everywhere — the same dummy
accessKeyId,secretAccessKey, andregionin the CLI profile, SDK client config, and test setup.Persist across restarts — drop
-inMemory, set-dbPath, and (in Docker) mount it as a volume.Create tables in setup — for tests, create the table (and wait for it) in the suite's bootstrap so a fresh instance is never a surprise.
The scoping problem is much easier to see than to deduce — the DynoTable desktop app connects to DynamoDB Local and shows exactly which tables an endpoint + credential combo can see, so the split-brain is visible in one glance. Prepping seed data? The DynamoDB JSON converter turns plain JSON into typed items.
FAQ
Why does DynamoDB Local say the table doesn't exist when I just created it?
Without -sharedDb, DynamoDB Local keeps a separate database file per access key ID and region, so the table you created with the CLI can be invisible to your app if their credentials or region differ. Run Local with -sharedDb or pin identical dummy credentials and region everywhere.
Why did my DynamoDB Local tables disappear after a restart?
In -inMemory mode nothing is kept on disk, so every restart is a blank database. A fresh Docker container without a mounted volume starts empty too. Drop -inMemory, set -dbPath, and mount it as a volume to persist tables.
Related errors
- ResourceNotFoundException — the real-AWS flavor (wrong region/account/table name).
- Could not connect to DynamoDB Local (ECONNREFUSED)
- DynamoDB Local port 8000 in use
- Learn: Running DynamoDB Local · Connect to Local & LocalStack
References
- DynamoDB local usage notes — AWS DynamoDB Developer Guide (per-credential/Region
myaccesskeyid_region.dbfiles,-sharedDb→shared-local-instance.db,-inMemorykeeps nothing on disk) - Deploying DynamoDB locally on your computer — AWS DynamoDB Developer Guide (Docker Compose
-sharedDb -dbPath ./data+ volume pattern, dummy credentials) - amazon/dynamodb-local — Docker Hub (official image; fresh containers start empty without a mounted volume)
Last verified 2026-07-13 against the official AWS documentation linked above.