amazon-ecs-deploy-task-definition icon indicating copy to clipboard operation
amazon-ecs-deploy-task-definition copied to clipboard

[warning ] Ignoring property 'compatibilities', 'taskDefinitionArn', 'requiresAttributes', 'revision', 'status' in the task definition file

Open nodesocket opened this issue 4 years ago • 23 comments

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 avatar Jun 22 '20 17:06 nodesocket

@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 avatar Aug 11 '20 15:08 allisaurus

@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 avatar Aug 11 '20 15:08 kyler-hyuna

@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?

allisaurus avatar Aug 14 '20 21:08 allisaurus

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!

kyler-hyuna avatar Aug 14 '20 23:08 kyler-hyuna

Is there anything that speaks against simply not setting those properties?

peteroruba avatar Dec 23 '20 12:12 peteroruba

@allisaurus this is breaking the build now. Pls help.

siddhant-mohan avatar Jan 26 '21 16:01 siddhant-mohan

@siddhant-mohan when did you see this? I did a build today, with no issues

kyler-hyuna avatar Jan 26 '21 18:01 kyler-hyuna

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

a-ruban-craftsoft avatar Jan 26 '21 18:01 a-ruban-craftsoft

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.

allisaurus avatar Jan 26 '21 19:01 allisaurus

@siddhant-mohan @a-ruban-craftsoft which AWS regions are you deploying to, for context?

allisaurus avatar Jan 26 '21 19:01 allisaurus

@allisaurus eu-west-1

a-ruban-craftsoft avatar Jan 26 '21 19:01 a-ruban-craftsoft

@allisaurus I guess it is might be related to sdk been updated to v2.829.0 but I may be wrong

a-ruban-craftsoft avatar Jan 26 '21 19:01 a-ruban-craftsoft

ap-south-1 @allisaurus

siddhant-mohan avatar Jan 26 '21 19:01 siddhant-mohan

https://github.com/aws-actions/amazon-ecs-render-task-definition/issues/84

siddhant-mohan avatar Jan 26 '21 19:01 siddhant-mohan

@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 avatar Jan 26 '21 20:01 allisaurus

@allisaurus thanks for sorting this out

a-ruban-craftsoft avatar Jan 26 '21 20:01 a-ruban-craftsoft

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

ccppoo avatar Jan 17 '22 07:01 ccppoo

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

jhchill666 avatar Apr 29 '22 09:04 jhchill666

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.

xophere avatar Jul 08 '22 19:07 xophere

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 avatar Aug 02 '22 17:08 povisenko

@povisenko really cool, works like a charm. Thanks!

peteroruba avatar Aug 02 '22 18:08 peteroruba

@povisenko thanks, works well for me.

kheengz avatar Oct 26 '22 08:10 kheengz

This is a hack, but a proper fix is still needed

jakeleventhal avatar Dec 15 '23 16:12 jakeleventhal