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

Run task failed #535

Closed
DorrinPk opened this issue Sep 20, 2016 · 7 comments
Closed

Run task failed #535

DorrinPk opened this issue Sep 20, 2016 · 7 comments

Comments

@DorrinPk
Copy link

When I run my task with syslog or awslogs as logging options, I don't get any errors and it works just fine.

But when I change it to 'flunetd', I get : Run task failed. Reasons : ["ATTRIBUTE"]

I'm using the ECS AMI and the docker version is 1.11.2

@aaithal
Copy link
Contributor

aaithal commented Sep 20, 2016

@DorrinPk The fluentd logging driver is not enabled by default on the ECS AMI. You'd have to configure it via userdata if launching a new instance or manually login to the instance and edit the ECS Agent Config File and restart the Agent so that the Agent registers itself with this capability.

@DorrinPk
Copy link
Author

DorrinPk commented Sep 20, 2016

@aaithal I still get the same error after manually updating my userdata and updating the agents from the console.

I thought the point of using the drop down and choosing fluentd is to not have to play around with userdata. I don't have to edit the userdata for syslog or awslogs?

@aaithal
Copy link
Contributor

aaithal commented Sep 20, 2016

@DorrinPk can you please paste the userdata string that you're using?

I thought the point of using the drop down and choosing fluentd is to not have to play around with userdata. I don't have to edit the userdata for syslog or awslogs?

When you create the task definition, you add constraints on the task, one which is needing fluentd logging driver. By default, if using the ECS Optimized AMI, the ECS Agent is registered with json-file, syslog and awslogs logging drivers. We have had other feature requests (#454) for enabling other logging drivers by default. We are still debating about how to approach that issue.

@DorrinPk
Copy link
Author

@aaithal : the userdata is : ECS_AVAILABLE_LOGGING_DRIVERS='["awslogs","fluentd"]'

and I am using the ECS AMI.

@DorrinPk
Copy link
Author

@aaithal : I also see this in my event logs:

service xxxx was unable to place a task because no container instance met all of its requirements. The closest matching container-instance xxxxxxxxx is missing an attribute required by your task. For more information, see the Troubleshooting section.

@aaithal
Copy link
Contributor

aaithal commented Sep 20, 2016

@DorrinPk can you please paste the relevant part of your user-data script (including the #!/bin/bash directive and the part where you are overriding the ecs.config file)? You can also email the container instance arn/ec2 instance id and the region where you're launching this to aithal at amazon dot com. I suspect there's an issue in creating the config file that's leading to this. Here are the steps that I followed to register my container instance with fluentd logging driver:

  • Launch an EC2 Instance using the ECS Optimized AMI with user-data:
#!/bin/bash
echo ECS_LOGLEVEL=debug >> /etc/ecs/ecs.config
echo ECS_AVAILABLE_LOGGING_DRIVERS='["awslogs","fluentd"]' >> /etc/ecs/ecs.config
  • Login to the instance and verify that the ecs.config file is properly configured:
$ cat /etc/ecs/ecs.config
ECS_LOGLEVEL=debug
ECS_AVAILABLE_LOGGING_DRIVERS=["awslogs","fluentd"]
  • Describe the instance to verify that it's been registered with the fluentd capability:
$ aws ecs describe-container-instances --container-instance xxx --query 'containerInstances[0].attributes'
[
    {
        "name": "com.amazonaws.ecs.capability.privileged-container"
    },
    {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
    },
    {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
    },
    {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
    },
    {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.20"
    },
    {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
    },
    {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.22"
    },
    {
        "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
    },
    {
        "name": "com.amazonaws.ecs.capability.logging-driver.fluentd"
    },
    {
        "name": "com.amazonaws.ecs.capability.ecr-auth"
    },
    {
        "name": "com.amazonaws.ecs.capability.task-iam-role"
    },
    {
        "name": "com.amazonaws.ecs.capability.task-iam-role-network-host"
    }
]

@DorrinPk
Copy link
Author

Yes, once the fluentd driver is specified in ecs config and the fluentd is installed as a service, it works.

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

2 participants