ECS 'Unknown volume' error

Adam Risser October 26, 2016

Hello,

I am trying to get our app to deploy to ECS thru pipelines, but do not understand how to take care of the following error

 

+ python ecs_deploy.py task_definition.json $DOCKER_IMAGE:$TAG 1 0 200 Failed to update the stack. An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Unknown volume 'etc'.

 

Here is what I have in my container definition for mount points

 

"mountPoints": [{
  "containerPath": "/home/app/etc",
  "sourceVolume": "etc",
  "readOnly": false
}],

I am following this example

https://bitbucket.org/awslabs/amazon-ecs-bitbucket-pipelines-python/src/a7f2ec188250?at=master

How do I make it aware of the volume? 

 

1 answer

1 vote
SebC
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 4, 2016

looks like your task definition contains a mountPoint but no volumes (to be mounted); see the example at http://docs.aws.amazon.com/cli/latest/reference/ecs/register-task-definition.html

 

{
      "family": "web-timer",
      "containerDefinitions": [
      {
              "name": "web",
              "image": "nginx",
              "cpu": 99,
              "memory": 100,
              "portMappings": [{
                      "containerPort": 80,
                      "hostPort": 80
              }],
              "essential": true,
              "mountPoints": [{
                      "sourceVolume": "webdata",
                      "containerPath": "/usr/share/nginx/html",
                      "readOnly": true
              }]
      }, {
              "name": "timer",
              "image": "busybox",
              "cpu": 10,
              "memory": 20,
              "entryPoint": ["sh", "-c"],
              "command": ["while true; do date > /nginx/index.html; sleep 1; done"],
              "mountPoints": [{
                      "sourceVolume": "webdata",
                      "containerPath": "/nginx/"
              }]
      }],
      "volumes": [{
              "name": "webdata",
              "host": {
                      "sourcePath": "/ecs/webdata"
              }}
      ]
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events