You need to sign in or sign up before continuing.
RunTask should check the response for failures and not just assume there's Tasks[0]
panic: runtime error: index out of range [0] with length 0
/builds/gitlab-org/ci-cd/custom-executor-drivers/fargate/aws/fargate.go:147 +0x7a3
Now it just assumes that task can be started if err is nil, that isn't the case.
taskOutput, err := a.ecsSvc.RunTaskWithContext(ctx, &taskInput)
if err != nil {
return "", fmt.Errorf("error starting AWS Fargate Task: %w", err)
}
taskARN := *taskOutput.Tasks[0].TaskArn
taskOutput can contain nothing in Tasks, but there can be failures.
"failures": [
{
"arn": "string",
"detail": "string",
"reason": "string"
}
],
It would be nice to log those failures and handle the situation by returning the details in failures. As if failures happen for some reason it is pretty annoying to figure out as the failures aren't logged and you are just getting index out of range.
On a side note does anyone have any idea what "The requested CPU configuration is above your limit" means? Is there some service quotas for fargate task cpu values and what is it? 2048 seems to work but 4096 doesn't and it gives that as reason for failure and gitlab-runner + AWS Fargate driver just crashes using index out of range.