'Cannot start Jenkins agent on AWS ECS
I am deploying Jenkins slaves on ECS. I followed the following article and provisioned it with AWS CDK link. However, when I started the task definition for Jenkins agent, the status of task was stuck at PROVISIONING. I checked the CloudWatch logs and got the following error:
2022-05-20 17:34:36.687+0000 [id=194] INFO c.c.j.p.amazonecs.ECSLauncher#launchECSTask: [ecs-cloud-ecs-xnsn0]: ContainerInstanceArn: null
com.amazonaws.waiters.WaiterUnrecoverableException: Resource never entered the desired state as it failed.
Here is the task definition of the Jenkins agent:
{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::251623506909:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "ECSLogGroup-jenkins-for-ecs-with-agents",
"awslogs-region": "us-east-2",
"awslogs-stream-prefix": "jenkins-agent"
}
},
"entryPoint": null,
"portMappings": [
{
"hostPort": 8080,
"protocol": "tcp",
"containerPort": 8080
}
],
"command": null,
"linuxParameters": null,
"cpu": 1024,
"environment": [],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": null,
"memoryReservation": 2048,
"volumesFrom": [],
"stopTimeout": null,
"image": "jenkins/inbound-agent:windowsservercore-1809",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": false,
"name": "ecs-cloud-jenkins-agent"
}
],
"placementConstraints": [],
"memory": "2048",
"taskRoleArn": "arn:aws:iam::251623506909:role/ecsTaskRole",
"compatibilities": [
"EC2",
"FARGATE"
],
"taskDefinitionArn": "arn:aws:ecs:us-east-2:251623506909:task-definition/ecs-cloud-jenkins-agent:136",
"family": "ecs-cloud-jenkins-agent",
"requiresAttributes": [
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.execution-role-awslogs"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.task-iam-role"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.task-eni"
}
],
"pidMode": null,
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"runtimePlatform": {
"operatingSystemFamily": "WINDOWS_SERVER_2019_CORE",
"cpuArchitecture": "X86_64"
},
"cpu": "1024",
"revision": 136,
"status": "ACTIVE",
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": []
}
I tried with port 50000 and different OS and images but it keeps failing. The security groups for Jenkins master and agent are set to allow all traffic.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
