Closed pvasilyev closed 4 years ago
This is likely a failure to parse your task definition file, for example a missing required field. To confirm, you can turn on debug logs by setting the secret ACTIONS_STEP_DEBUG to true in your repo.
Added troubleshooting directions in 7dc1449a482e7ab2af6512344efcdfd4fc64ddb6
I have the same issue. Thanks for putting in the debug option @clareliguori ! But even though I can now see the task definition file being used, I still don't know what's wrong with it. I'm aware the error is being thrown in the aws sdk, but can someone give any more clues on how analyse/validate what could be wrong with the file?
This will give you the format:
aws ecs register-task-definition --generate-cli-skeleton
If you'd like to paste your generated task def here from the debug log (removing any sensitive info), I can take a look
Hi @clareliguori , thanks so much for getting back to me. I was already using a file generate using the command you have suggested. I have uploaded it here: https://gist.github.com/kaischwanke/aef290d2e90c0ff071803e6631da40cd Also, with ACTIONS_STEP_DEBUG=true I can see that the modified file in failing step (Deploy Amazon ECS task definition) looks a little different: https://gist.github.com/kaischwanke/a59a3e35cdce46c96a8d6080a1e08091
@kaischwanke I don't see where the two task defs you pasted are different, is the second one actually the same as the first?
Anyway, the generate command adds all the possible options and expects them all to be filled in or removed if you are not using them. For example, cpu and memory should be removed or set to non-zero values.
"cpu": 0,
"memory": 0,
It is easier to start from a task definition that is already registered, and store that in your repo:
aws ecs describe-task-definition --task-definition first-run-task-definition > ecs-task-definition.json
Sorry @clareliguori , seems I did upload the same file twice. I have updated the second one now. That's the output I see in the GitHub action. The first one is the one I have in my repository.
@kaischwanke I put up a fix for the 'null' error, but even when that is released, this is still not a valid task definition since it's expecting you to fill in more information or remove attributes you don't need. But, at least you'll get some better validation messages once the fix is released.
You're amazing, thanks @clareliguori !
I did get my service to work by using the existing task definition as you suggested:
aws ecs describe-task-definition --task-definition first-run-task-definition > ecs-task-definition.json
(I just had to unwrap the contents of the root key 'taskDefinition' from that JSON)
Thanks again!
Trying to use this action in my personal project (private repo so far). YML file is as follows: https://gist.github.com/pvasilyev/ceaf81d6943464bf77ac2a6a0b7602ad
I've verified that my aws user has all permissions listed in the https://github.com/aws-actions/amazon-ecs-deploy-task-definition#permissions but still w/o luck.
Logs excerpt: