I have an ECS cluster(Fargate) named test and a task definition that runs the nginx image as below. I am trying to test the task definition override functionality.
And am trying to use and run the following on Jenkins:
ecsTaskTemplate(
cloud: 'test',
label: 'fargate',
name: 'fargate', // Reusing the label as a name makes sense as long as it's unique
containerUser: 'ubuntu',
remoteFSRoot: '/home/ubuntu',
overrides: [],
taskDefinitionOverride: "arn:aws:ecs:ca-central-1:123456789:task-definition/nginx:12"
) {
node(fargate) {
stage("I dunno why you say goodbye"){
sh 'echo hello'
}
}
}
The error on running this is:
[test-fargate-mkcz4]: Error in provisioning; agent=com.cloudbees.jenkins.plugins.amazonecs.ECSSlave[test-fargate-mkcz4]
java.lang.NullPointerException
at com.cloudbees.jenkins.plugins.amazonecs.ECSService.runEcsTask(ECSService.java:426)
at com.cloudbees.jenkins.plugins.amazonecs.ECSLauncher.runECSTask(ECSLauncher.java:213)
at com.cloudbees.jenkins.plugins.amazonecs.ECSLauncher.launchECSTask(ECSLauncher.java:149)
at com.cloudbees.jenkins.plugins.amazonecs.ECSLauncher.launch(ECSLauncher.java:110)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:294)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
What could be wrong here, I am assuming this would create a template and then a task on Fargate.