amazon-ecs-deploy-task-definition
amazon-ecs-deploy-task-definition copied to clipboard
[warning ] Ignoring property 'compatibilities', 'taskDefinitionArn', 'requiresAttributes', 'revision', 'status' in the task definition file
Just noticed the following warnings started coming back (worked before)
Deploy new ECS task definition
Deployment started. Watch this deployment's progress in the Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=***#/clusters/stage/services/stage-web/events
Run aws-actions/amazon-ecs-deploy-task-definition@v1
##[warning]Ignoring property 'compatibilities' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
##[warning]Ignoring property 'taskDefinitionArn' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
##[warning]Ignoring property 'requiresAttributes' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
##[warning]Ignoring property 'revision' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
##[warning]Ignoring property 'status' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Deployment started. Watch this deployment's progress in the Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=***#/clusters/stage/services/stage-web/events
Here is the relevant config is the Github action .yaml
:
- name: Download current ECS task definition
run: aws ecs describe-task-definition --task-definition stage-web --query taskDefinition > task-definition.json
- name: Render new ECS task definition
id: render-task-definition
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: stage-web
image: ${{ env.GA_DOCKER_IMAGE }}
@nodesocket looks like your task definition contains a number of properties that are invalid register-task-definition
input. Your deployment still succeeds (based on your pasted output), but the warnings can be avoided if you remove the listed properties from your task definition file. If you only recently started seeing these, maybe you recently copy/pasted task definition JSON from the console into your project?
@allisaurus I think most workflows include downloading the existing task definition and then updating the image tag. So the values you mentioned will be there.
This way we don't have to keep the task definition in the repo
@kyler-hyuna that's a good point. I think this action was originally envisioned for use with a task definition file in the repo, but pulling one that exists elsewhere and modifying it is a common pattern.
I don't have any immediate suggestions re: how to make the warnings less annoying, but since it's not a deployment blocker how about we mark this as a feature request for now so we don't lose track of it?
Yep sounds good. The warnings are correct in that the fields aren't needed, however, maybe we can do either 2 things:
- flag to silence warnings
- flag to indicate we're using an existing task definition
Either one is fine!
Is there anything that speaks against simply not setting those properties?
@allisaurus this is breaking the build now. Pls help.
@siddhant-mohan when did you see this? I did a build today, with no issues
It started failing today, it says:
Warning: Ignoring property 'compatibilities' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Warning: Ignoring property 'taskDefinitionArn' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Warning: Ignoring property 'requiresAttributes' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Warning: Ignoring property 'revision' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Warning: Ignoring property 'status' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Error: Failed to register task definition in ECS: There were 2 validation errors:
* UnexpectedParameter: Unexpected key 'registeredAt' found in params
* UnexpectedParameter: Unexpected key 'registeredBy' found in params
Error: There were 2 validation errors:
* UnexpectedParameter: Unexpected key 'registeredAt' found in params
* UnexpectedParameter: Unexpected key 'registeredBy' found in params
hmm sounds like ECS itself may now be failing on the presence of these values. We will follow up on this and post an update.
@siddhant-mohan @a-ruban-craftsoft which AWS regions are you deploying to, for context?
@allisaurus eu-west-1
@allisaurus I guess it is might be related to sdk been updated to v2.829.0 but I may be wrong
ap-south-1 @allisaurus
https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/84
@siddhant-mohan @a-ruban-craftsoft it looks like the failure is actually coming from the amazon-ecs-deploy-task-definition action, which is failing on the presence of the new fields.
We are actively working on a fix and will post updates here: https://github.com/aws-actions/amazon-ecs-deploy-task-definition/issues/164
@allisaurus thanks for sorting this out
hmm... is this still in the air?
or is copying task definition from ECS-Task definitions-<task definition>
is deprecated?
I'm still getting the warnnings
Ignoring property 'compatibilities' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Ignoring property 'taskDefinitionArn' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Ignoring property 'requiresAttributes' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Ignoring property 'revision' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Ignoring property 'status' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
deploying at region : ap-northeast-2
Not sure if still bugging people, but here's my approach:
- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition api --query taskDefinition | jq -r 'del(
.taskDefinitionArn,
.requiresAttributes,
.compatibilities,
.revision,
.status,
.registeredAt,
.registeredBy
)' > task-definition.json
That jq filter is great. But it does seem like it might make sense to do it in the action. Especially if it is never valid to push those values.
Not sure if still bugging people, but here's my approach:
- name: Download task definition run: | aws ecs describe-task-definition --task-definition api --query taskDefinition | jq -r 'del( .taskDefinitionArn, .requiresAttributes, .compatibilities, .revision, .status, .registeredAt, .registeredBy )' > task-definition.json
I would use it in that way
echo $(cat task-definition.json | jq 'del(
.taskDefinitionArn,
.requiresAttributes,
.compatibilities,
.revision,
.status,
.registeredAt,
.registeredBy
)') > task-definition.json
otherwise was getting task-definition.json: Unexpected end of JSON input
when calling aws-actions/amazon-ecs-render-task-definition@v1
with task-definition: task-definition.json
@povisenko really cool, works like a charm. Thanks!
@povisenko thanks, works well for me.
This is a hack, but a proper fix is still needed