ECS 'Unknown volume' error

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

0 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,408 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you