0

I'm trying to use the AWS dynamodb-local container to run a database locally. I run a docker-compose up command to get the container running with this compose file:

docker-compose.yml :

version: '3.7'
services:
  dynamodb:
    image:  amazon/dynamodb-local
    container_name: my-dynamodb
    hostname: dynamodb
    restart: always
    volumes:
      -  ./my-dynamodb-data:/home/dynamodblocal/data
    ports:
      - 8000:8000
    command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data/"

After this I attempt to create a table on this docker image using a specification in plans.json:

aws dynamodb create-table --cli-input-json file://./config/tables/plans.json --endpoint-url http://localhost:8000

This command works fine on MacOS but stalls on Ubuntu desktop.

The Docker container's logs repeatedly say:

Sep 06, 2022 8:30:49 AM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] SQLiteQueue[shared-local-instance.db]: stopped abnormally, reincarnating in 3000ms
Sep 06, 2022 8:30:52 AM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] cannot open DB[448]: com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
Sep 06, 2022 8:30:52 AM com.almworks.sqlite4java.Internal log
SEVERE: [sqlite] SQLiteQueue[shared-local-instance.db]: error running job queue
com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
        at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1480)
        at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282)
        at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:293)
        at com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464)
        at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641)
        at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)
        at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)
        at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)
        at java.lang.Thread.run(Thread.java:750)

I found this related post that suggests it may be a permissions issue but since this is running on a Docker container I don't know how to apply it. I don't have local Dynamodb files as far as I can tell - they're all on the container.

I'd like to be able to run the command above without errors on Ubuntu desktop. Since it works fine on MacOS I suspect it's some difference in how Ubuntu handles permissions.

Adam
  • 1
  • 1

0 Answers0