Unexpected key 'enableFaultInjection' found in params

5

suddenly,not able to deploy the task definition. It has "enableFaultInjection":false as default value but failing the deployment with the following error:

Error: Failed to register task definition in ECS: Unexpected key 'enableFaultInjection' found in params Error: Unexpected key 'enableFaultInjection' found in params

Here is the screenshot of my task definition JSON:

Enter image description here

  • I have a the same error but in Github during a deploy of ECS, any ideas how to fix it?

  • Same issue in Github deploy too. Tried the solution by oscarcrespo but no luck.

질문됨 한 달 전5.1천회 조회
3개 답변
8

You are likely using v1 of the ecs-deploy-task-defintion GitHub action, you should be using v2 as this was fixed there yesterday as well.

- name: Deploy Amazon ECS task definition
  uses: aws-actions/amazon-ecs-deploy-task-definition@v2
  with:
     task-definition: task-definition.json
답변함 한 달 전
profile pictureAWS
전문가
검토됨 한 달 전
  • That fixed it! Thank you

  • yep this worked! Thanks for the quick reply!

  • This fixed the issue for me as well. @Henrique Santana, do you happen to know what caused v1 to break?

-2

this is a temporary solution that fixes this. Add it to your action script after getting task definition

 - name: Remove enableFaultInjection from task-definition.json
      shell: bash
      run: |
        jq 'del(.enableFaultInjection)' task-definition.json > task-definition-fixed.json
        mv task-definition-fixed.json task-definition.json
답변함 한 달 전
  • This is the ChatGPT answer and will fix the problem, but it is fundamentally incorrect as it doesn't identify the root cause (AWS update) or deal with it (use updated definition).

-9

The error you're encountering suggests that there's an issue with the task definition JSON you're trying to deploy. The "enableFaultInjection" parameter is not a standard parameter in ECS task definitions, which is why you're seeing the "Unexpected key" error.

To resolve this issue, you should remove the "enableFaultInjection" field from your task definition JSON. This parameter is not recognized by ECS and is causing the deployment to fail.

Here are the steps you can take to fix this:

  1. Edit your task definition JSON.
  2. Remove the line containing "enableFaultInjection":false.
  3. Save the updated task definition.
  4. Try to deploy the task definition again.

If you're using some kind of infrastructure-as-code tool or template to generate this task definition, you may need to update that template to remove the "enableFaultInjection" parameter.

After removing this unexpected key, your task definition should deploy successfully, assuming there are no other issues with the configuration.

If you're wondering about the origin of this parameter, it's possible that it was inadvertently added during a copy-paste operation or through some automated process. It's not a standard ECS parameter, which is why it's causing the deployment to fail.

Remember to always validate your task definition JSON against the ECS task definition schema to catch these kinds of issues before attempting to deploy.
Sources
ECS deployment task failed (deployed on EC2) | AWS re:Post
How to debug failed ECS deployment? | AWS re:Post

profile picture
답변함 한 달 전
  • It was working fine until today. Tried to remove this from "task definition JSON " but it still comes with default value as "False".

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠