3

I'm banging my head against a wall trying to figure out the source of the following error I get when trying to deploy this Dockerrun file to EB:

Error: parse Dockerrun.aws.json file failed with error json: invalid use of ,string struct tag, trying to unmarshal unquoted value into int

Here is the file in question:

{
  "AWSEBDockerrunVersion": "1",
  "Authentication": {
    "Bucket": "mybucket",
    "Key": "myconfig.json"
  },
  "Image": {
    "Name": "1234567890.dkr.ecr.us-east-2.amazonaws.com/myimage:tag",
    "Update": "true"
  },
  "Ports": [
    {
      "ContainerPort": "3001",
      "HostPort": "80"
    }
  ]
}

I've read over the documentation here: https://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/single-container-docker-configuration.html

I can't seem to find any issues with the file. I know that AWS has validators for CloudFormation templates, does something similar exist for Dockerrun files? How would one go about troubleshooting this error?

  • does this answer your question [Elastic Beanstalk :Error: Failed to parse Dockerrun JSON file: json: invalid use of ,string struct tag, trying to unmarshal unquoted value into int](https://stackoverflow.com/questions/62922546/elastic-beanstalk-error-failed-to-parse-dockerrun-json-file-json-invalid-use) – samtoddler Mar 27 '21 at 11:00

1 Answers1

2

It turns out the error was unrelated to the actual parsing of the file. I dug through the logs and realized that my ECR authentication token had supposedly expired. This was strange since I was using the same ECR authentication for other Elastic Beanstalk environments without issue. The solution was to generate a new authentication token for ECR, upload a new config file to S3, and point the Dockerrun authentication bucket and key fields to the new file.

If you run into a similar error, look further back in your eb-engine logs for other errors that may be the root of the problem.