Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Task not working when creating Docker Volume driver with capital letter "Local" #1161

Open
brewagebear opened this issue May 25, 2023 · 0 comments

Comments

@brewagebear
Copy link

brewagebear commented May 25, 2023

Summary

Screenshot 2023-05-25 at 22 46 58

As shown above, when entering the Driver on the AWS web console, you can see that the preview value is "Local".

However, when creating a docker volume like this, the error Run Tasks Failed Reasons : ["ATTRIBUTE"] occurs.

First, I tried to report this bug to the AWS web console, but I don't know how to report it, so I'm sorry to share it with this repository.

I wrote it down because I thought that using cli could cause similar problems.

Description

I spent a lot of time handling the Run Tasks Failed Reasons: ["ATTRIBUTE"] error.

I think we can prove that the capitalization Local is the problem through the Task Definition JSON file.

Config files

Error Case (Task Definition JSON)

{
   ... (ellipsis, omit) ...
    "volumes": [
        {
            "name": "reactapp",
            "dockerVolumeConfiguration": {
                "scope": "task",
                "driver": "Local" <<< This is the problem
            }
        }
    ],
    "status": "ACTIVE",
    "requiresAttributes": [
        {
            "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
            "name": "ecs.capability.execution-role-awslogs"
        },
        {
            "name": "ecs.capability.docker-plugin.Local"
        },
        {
            "name": "com.amazonaws.ecs.capability.ecr-auth"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
            "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
            "name": "ecs.capability.container-ordering"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.25"
        },
        {
            "name": "ecs.capability.execution-role-ecr-pull"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
        }
    ],
    ... (ellipsis, omit) ...
}

Normal Case (Task Definition JSON)

     ... (ellipsis, omit) ...
    "volumes": [
        {
            "name": "reactapp",
            "dockerVolumeConfiguration": {
                "scope": "task",
                "driver": "local" <<< This isn't the problem
            }
        }
    ],
    "status": "ACTIVE",
    "requiresAttributes": [
        {
            "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
            "name": "ecs.capability.execution-role-awslogs"
        },
        {
            "name": "com.amazonaws.ecs.capability.ecr-auth"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
            "name": "ecs.capability.docker-plugin.local"
        },
        {
            "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
            "name": "ecs.capability.container-ordering"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.25"
        },
        {
            "name": "ecs.capability.execution-role-ecr-pull"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
        }
    ],
   ... (ellipsis, omit) ...
}

If you compare the two JSON files above, you can see that the "requires Attributes" value is the same, only in different order.

However, the JSON file above had an error due to the lack of required attributes, but it was confirmed that the JSON file below works normally.

All of the above tasks were targeted at the same EC2 instance.

If it operates as cli, it is as follows.

Error Case JSON with ecs-cli

aws ecs run-task --cluster test --task-definition case:1 --launch-type="EC2"

{
    "tasks": [],
    "failures": [
        {
            "arn": "arn:aws:ecs:ap-northeast-2:97845804****:container-instance/0dd4f6bc68dd4f199fc91c49d52*****",
            "reason": "ATTRIBUTE"
        }
    ]
}

Nomal Case JSON with ecs-cli

aws ecs run-task --cluster test --task-definition case:2 --launch-type="EC2"

{
    "tasks": [
        {
            "attachments": [],
            "attributes": [
                {
                    "name": "ecs.cpu-architecture",
                    "value": "x86_64"
                }
            ],
    ... (ellipsis, omit) ...
    "failures": []
}

Expected Behavior

Therefore, if you specify it as capitalized Local, you may experience the following problems.

Observed Behavior

Screenshot 2023-05-25 at 23 06 03

Suggestions

If you look at the AWS ECS Developer Guide document, you can see that the value of the docker volume is registered in lowercase "local".

Screenshot 2023-05-25 at 23 08 05

So I'd suggest changing the preview to "local" instead of "Local" in the AWS web console, or making it case-insensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant