retail-store-sample-app icon indicating copy to clipboard operation
retail-store-sample-app copied to clipboard

Cart Service (carts-db) doesn’t auto-create DynamoDB table using docker-compose or Kubernetes manifests

Open stacksimplify opened this issue 2 months ago • 0 comments

Cart Service (carts-db) doesn’t auto-create DynamoDB table in docker-compose or Kubernetes manifests

Issue Description

When running the Cart service with the provided docker-compose.yaml or kubernetes.yaml manifests from this repo, the associated DynamoDB Local container (carts-db) starts successfully, but the required Items table is not created automatically.

The Cart service logs confirm it expects the Items table, but reports it as missing:

cart-1  | 2025-09-20T10:55:04.645Z  INFO 1 --- [           main] c.a.s.c.c.DynamoDBConfiguration          : DynamoDB table: Items
cart-1  | 2025-09-20T10:55:04.721Z  INFO 1 --- [           main] c.a.s.c.c.DynamoDBConfiguration          : DynamoDB endpoint: http://carts-db:8000
cart-1  | 2025-09-20T10:55:10.411Z  WARN 1 --- [           main] c.a.s.c.s.DynamoDBCartService            : Dynamo table not found

Expected Behavior

The Cart service should either:

  1. Auto-create the Items table (when RETAIL_CART_PERSISTENCE_DYNAMODB_CREATE_TABLE=true is set), or
  2. Provide clear instructions in the documentation to manually create the Items table before starting the service.

Actual Behavior

  • carts-db container starts successfully.
  • Cart service connects to DynamoDB Local but the Items table does not exist, causing warnings and failed persistence.

Steps to Reproduce

  1. Clone the repo and run docker compose up (or apply the provided Kubernetes manifests).
  2. Wait for cart and carts-db to become healthy.
  3. Check Cart service logs:
docker compose up -d
docker compose logs -f cart

You will see:

cart-1  | 2025-09-20T10:55:10.411Z  WARN 1 --- [           main] c.a.s.c.s.DynamoDBCartService            : Dynamo table not found

Suggestion

  • Ensure the Items table is created automatically at startup when using the default manifests, or
  • Update documentation with explicit instructions on creating the table manually.

stacksimplify avatar Sep 20 '25 11:09 stacksimplify