Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nodesocket opened this issue Jun 22, 2020 · 24 comments
Assignees

Comments

@nodesocket
Copy link

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 }}
@piradeepk piradeepk self-assigned this Jun 24, 2020
@allisaurus
Copy link
Contributor

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

@kyler-hyuna
Copy link

@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

@allisaurus
Copy link
Contributor

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

@kyler-hyuna
Copy link

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!

@peteroruba
Copy link

peteroruba commented Dec 23, 2020

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

@siddhant-mohan
Copy link

siddhant-mohan commented Jan 26, 2021

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

@kyler-hyuna
Copy link

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

@a-ruban-craftsoft
Copy link

a-ruban-craftsoft commented Jan 26, 2021

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

@allisaurus
Copy link
Contributor

allisaurus commented Jan 26, 2021

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
Copy link
Contributor

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

@a-ruban-craftsoft
Copy link

@allisaurus eu-west-1

@a-ruban-craftsoft
Copy link

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

@siddhant-mohan
Copy link

ap-south-1 @allisaurus

@siddhant-mohan
Copy link

@allisaurus
Copy link
Contributor

@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: #164

@a-ruban-craftsoft
Copy link

@allisaurus thanks for sorting this out

@allisaurus allisaurus transferred this issue from aws-actions/amazon-ecs-render-task-definition Mar 1, 2021
@ccppoo
Copy link

ccppoo commented Jan 17, 2022

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

@jhchill666
Copy link

jhchill666 commented Apr 29, 2022

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

@xophere
Copy link

xophere commented Jul 8, 2022

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.

@povisenko
Copy link

povisenko commented Aug 2, 2022

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

@peteroruba
Copy link

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

@kheengz
Copy link

kheengz commented Oct 26, 2022

@povisenko thanks, works well for me.

@jakeleventhal
Copy link

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

@guikcd
Copy link
Contributor

guikcd commented Jan 30, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

15 participants