Coder Social home page Coder Social logo

Q: Error: Invalid task definition: Could not find container definition with matching name about amazon-ecs-render-task-definition HOT 14 CLOSED

aws-actions avatar aws-actions commented on June 17, 2024 1
Q: Error: Invalid task definition: Could not find container definition with matching name

from amazon-ecs-render-task-definition.

Comments (14)

 avatar commented on June 17, 2024 2

I was able to render a task def with this action. In one project it works just fine, in the other it does not work, and it throws Invalid task definition: Could not find container definition with matching name

Both projects have the same task def. Structure. This is super confusing.

Any fix or workaround?

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024 1

Update: the same task definition and GH workflow work with [email protected].
I'll be glad to send you debug output in private.

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024 1

Any updates?

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024 1

@roman-parkhunovskyi - it's good news for me, so I'm not crazy :-)
My plan B is forking v1.1.2, update @actions/core and rebuild - I already did that for about GHA (Slack notification). Of course, I'll publish it.

set-output deprecation notice and might stop working after May 31

Did GH already announce this date?

from amazon-ecs-render-task-definition.

brennh-animoca avatar brennh-animoca commented on June 17, 2024 1

I'm also having this issue. When will they fix this?

from amazon-ecs-render-task-definition.

 avatar commented on June 17, 2024 1

Strange...
Even with Run aws-actions/amazon-ecs-render-task-definition@v1 getting same: Error: Invalid task definition: Could not find container definition with matching name

Here my current action step:

      - name: Create new AWS ECS task definition on Stage (DEV)
        id: dev-task-def
        uses: aws-actions/[email protected]
        with:
          task-definition: task-definition.json
          container-name: ${{ inputs.ECS_CONTAINER_NAME }}
          image: ${{ steps.dev-image-build.outputs.image }}

I'm wondering if you really want to keep this issue closed.

from amazon-ecs-render-task-definition.

roman-parkhunovskyi avatar roman-parkhunovskyi commented on June 17, 2024

v1.1.2 appears to work, thanks @vitalykarasik. But it has set-output deprecation notice and might stop working after May 31.
v1.1.3 has this bug, described in the issue.

from amazon-ecs-render-task-definition.

brennh-animoca avatar brennh-animoca commented on June 17, 2024

Was able to resolve. Issue was lack of quotes around the name in the yaml file. The yaml file would parse but this would fail. Make sure that your container name is quoted.

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024

@brennh-animoca - thanks! Can you please provide more details:

  1. "I'm also having this issue" - your original config didn't work with v1.1.3, but worked with v1.1.2?
  2. "Issue was lack of quotes around the name in the yaml file" - do you mean task definition file? I'm using JSON format, and as far as I see all strings are quoted. Can you please share some example?

from amazon-ecs-render-task-definition.

brennh-animoca avatar brennh-animoca commented on June 17, 2024

I'm unclear what fixed it but i changed the task definition to have ALL hardcoded values until I got it working. Then when i went back through slowly, the only thing that I think could have changed is this:
"image": "${{ INPUT_IMAGE }}",

originally, there were not quotes around "${{ INPUT IMAGE }}". However, looking quickly at the code for the plugin, I'm still not sure.

Once I got it working, I moved back to v1.1.3 and it still was functioning.

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024

@brennh-animoca - thank you for the details.
Weird...
As far as I can see, all my task definitions are 99% similar, and I had an issue with one of them with v1.1.3.
It's more or less

"containerDefinitions": [
        {
            "name": "servicename",
            "image": "XXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/server-name:hashhashhashhashhash",

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024

I rechecked this issue today and I'm going to close my issue.
According to my today's tests, all my task definitions are compatible with amazon-ecs-render-task-definition@v1, i.e. with 1.1.3.
(I have no idea what happened to me in February :-)

from amazon-ecs-render-task-definition.

vitalykarasik avatar vitalykarasik commented on June 17, 2024

@Abdullah-Shahen - does your workflow works with v1.1.2?
My workflow seems almost the same:

- name: Fill in the new image ID in the Amazon ECS task definition
      id: task-def
      uses: aws-actions/amazon-ecs-render-task-definition@v1
      with:
        task-definition: ${{ env.ECS_TASK_DEFINITION }}
        container-name: ${{ env.CONTAINER_NAME }}
        image: ${{ steps.build-image.outputs.image }}

and relevant of a task definition is

"containerDefinitions": [
        {
            "name": "core-p",
            "image": "xxxxxx.dkr.ecr.us-east-1.amazonaws.com/core-p:7da9b252999a69d0cc1ab1ed52f769f29f960e1d",

Again - I have no idea why I met this issue in Feb, but cannot reproduce now - neither action not my task definitions weren't modified as far as I see...

As for this issue - I prefer not to be an owner of it as far as I cannot reproduce it. Of course, you're welcome to reference or just copy-paste my issue in yours.

from amazon-ecs-render-task-definition.

 avatar commented on June 17, 2024

I'll copy the issue and reference to it as well. Thanks for the approval to do so.

from amazon-ecs-render-task-definition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.