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

Error when deploying to Fargate container that has awsfirelens log driver specified #164

Open
kellemar opened this issue Mar 19, 2021 · 5 comments

Comments

@kellemar
Copy link

Hi all,

I'm getting this issue when trying to deploy a new task with an updated task definition. I have awsfirelens configured which sends my logs to an external source such as Datadog.

botocore.errorfactory.ClientException: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: When awsfirelens log driver is specified in log configuration, a firelens configuration object must be configured in one of the containers.

Is there anything I can do to resolve this?

@fabfuel
Copy link
Owner

fabfuel commented Mar 19, 2021

Hi @kellemar,

just to double check: The container does have the firelens configuration before you do the re-deployment? Could you share your task definition or the relevant parts, please?

What versions of boto3 and botocore do you use?

Please try to update boto3 and botocore manually in the environment you run ecs-deploy in:

pip install boto3 botocore --upgrade

Does this solve the issue?

Thanks
Fabian

@kellemar
Copy link
Author

kellemar commented Mar 21, 2021

Hi Fabian,

Thanks for the help. Yup, the container has the firelens deployment. Here are my container definitions with Terraform.

I can update manually with either Terraform or in the AWS ECS console. But with Jenkins, and running ecs deploy, it fails with the above error.

Also, I've just updated boto3 and botocore, and awscli too. Boto to 1.17 and 1.20

container_definitions = jsonencode(
[
{
cpu = 0
environment = []
essential = true
image = "XXX.dkr.ecr.ap-southeast-1.amazonaws.com/nginx-sidecar-ec2:latest"
logConfiguration = {
logDriver = "awsfirelens"
options = {
Host = "http-intake.logs.datadoghq.com"
Name = "datadog"
TLS = "on"
apikey = "XXXX"
dd_message_key = "log"
dd_service = "tap-sg"
dd_source = "nginx"
dd_tags = "project:fluent-bit"
provider = "ecs"
}
}
memoryReservation = 128
mountPoints = []
name = "nginx"
portMappings = [
{
containerPort = 80
hostPort = 80
protocol = "tcp"
},
]
volumesFrom = []
},
{
cpu = 0
environment = []
essential = true
image = "XXXX.dkr.ecr.ap-southeast-1.amazonaws.com/prod-tap-sg:589c05"
logConfiguration = {
logDriver = "awsfirelens"
options = {
Host = "http-intake.logs.datadoghq.com"
Name = "datadog"
TLS = "on"
apikey = "XXXXX"
dd_message_key = "log"
dd_service = "tap-sg"
dd_source = "nodejs"
dd_tags = "project:fluent-bit"
provider = "ecs"
}
}
memoryReservation = 128
mountPoints = []
name = "reactjs"
portMappings = [
{
containerPort = 3000
hostPort = 3000
protocol = "tcp"
},
]
volumesFrom = []
},
{
cpu = 0
environment = []
essential = true
firelensConfiguration = {
type = "fluentbit"
}
image = "XXXX.dkr.ecr.ap-southeast-1.amazonaws.com/aws-for-fluent-bit:latest"
mountPoints = []
name = "log_router"
portMappings = []
user = "0"
volumesFrom = []
},
]
)
cpu = "512"
execution_role_arn = "arn:aws:iam::XXXX:role/ecsTaskExecutionRole"
family = "tap-fargate-nginx-reactjs-sg"
memory = "1024"
network_mode = "awsvpc"
requires_compatibilities = [
"FARGATE",
]
tags = {}
task_role_arn = "arn:aws:iam::XXXX:role/ecsTaskExecutionRole"

@kellemar
Copy link
Author

It also looks similar to this issue I found:
spinnaker/spinnaker#5203

@abertoldo
Copy link

Hello, did you manage to solve it? I have the same problem...

@fabfuel
Copy link
Owner

fabfuel commented Jul 28, 2022

Hi everyone, I can not reproduce this anymore in the current development version. The AWS FireLens configuration stays in tact, when deploying. Which version are you using @abertoldo?

Best
Fabian

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

3 participants