CircleCI Docker Exited with code 137

Viewed 2050

I'm using - image: peopleperhour/dynamodb for a docker image in my CircleCI config file.

In CircleCI it's outputting the following.

Initializing DynamoDB Local with the following configuration:
Port:   8000
InMemory:   false
DbPath: /var/dynamodb_local
SharedDb:   false
shouldDelayTransientStatuses:   false
CorsParams: *


Exited with code 137

The first tests pass fine and Exited with code 137 doesn't happen until later on. But once that error happens all the tests start failing.

I saw this link and changed my code to the following with no luck.

  - image: peopleperhour/dynamodb
    environment:
        MAX_HEAP_SIZE: 2048m
        HEAP_NEWSIZE: 512m

Any ideas on how to fix this?

4 Answers

I ran into the same issue. I ended up just using localstack for it, as the memory footprint seems to be lower.

My config for that container looks like:

- image: localstack/localstack
    environment:
      SERVICES: dynamodb:4570
      DEFAULT_REGION: us-west-2

You can try 3 other things.

1:

Add resource limits to your docker section of the config.yml resources:

            requests:
              memory: "2Gi"
            limits:
              memory: "4Gi"

The default resource is Medium with 2 vCPUs and 4GB of ram.

2:

Use Java option environment vars to set memory limits. https://circleci.com/blog/how-to-handle-java-oom-errors/

3:

If you are using a non-basic account you can tell Circleci to use a different machine resource_class. You have to have the performance plan for this. https://circleci.com/docs/2.0/configuration-reference/#resource_class

I use the amazon/dynamodb-local container to start DynamoDB local on CircleCI. I was having the same issue and setting MAX_HEAP_SIZE and Java options through the container wasn't really working for me, either. I found that the best way to do this was to override the entry-point for the container:

docker:
- image: amazon/dynamodb-local:1.13.1
  entrypoint: java -Djava.library.path=./DynamoDBLocal_lib -Xmx256m -jar DynamoDBLocal.jar -sharedDb -port 8000
Related