Skip to content

dynamodb mocking reports cannot create preexisting table if there are more than 100 tables. #14270

@pacteraou

Description

@pacteraou

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

22

Amplify CLI Version

13, 14 and others

What operating system are you using?

Mac OS

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

nothing

Describe the bug

  1. define more than 100 tables in schema graphql file like
        type Table000 @model {
        id: String
        }
        
        type Table001 @model {
        id: String
        }
...
        type Table101 @model {
        id: String
        }
 
  1. start mock server with command amplify mock api
  2. shut down mock server after server up with tables created.
  3. start mock server again with command amplify mock api. it will fails with error
Creating new table XXXTable
Failed to start API Mocking. Running cleanup tasks.
Reason: Cannot create preexisting table

Expected behavior

it should not create new tables because it's already created.

Reproduction steps

  1. define more than 100tables in schema graphql file.
  2. start mock server with command amplify mock api
  3. shut down mock server after tables created.
  4. start mock server again. it will fails with error Reason: Cannot create preexisting table

Project Identifier

No response

Log output

# Put your logs below this line

Creating new table XXTable
Failed to start API Mocking. Running cleanup tasks.
Reason: Cannot create preexisting table

Additional information

The cause is that DynamoDB Java Client's listTables method is limited to return 100 tables by default, the Local Dynamodb doesnt implement to list all tables that cause it trying to create exiting tables at mock server starting.

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions