-
Notifications
You must be signed in to change notification settings - Fork 141
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
“Error: Task definition file does not exist: ” when deploying Docker images to AWS ECS #68
Comments
I hadn't uploaded the task defintion file to my github repo with the thought that the GitHub will pull it from my AWS account. |
for anyone else finding this, it turns out |
my task-defintion.json file is directly under repo. How should I specify the path? |
In that case, path should be ./task-defintion.json |
In my case, I had forgotten to run the checkout step. |
Please anyone can help, failing at the same step as mentioned above. and i have my and my github is https://github.com/JohnQ1981/teachermonsters env: |
because your file is .yml but your path says .json |
I faced the same issue, then I figured out that I need to download the task definition first then update it with the new container image. that solved the issue and I was able to deploy to ECS.
|
Continuing on @chorsnell answer, I changed
|
I am trying to push docker images from GitHub Actions to AWS ECR then to ECS with a task to deploy the latest container in AWS ECS.
I am using the default aws.config file with changes only for AWS ECR repository name, AWS ECS cluster name and it's service name and docker image details to push docker images to AWS ECR to which could then to deployed as containers to AWS ECS by defining tasks. And I got an error message with defining tasks to deploy to ECS(in the section "Fill in the new image ID in the Amazon ECS task definition" in aws.yml) and it is:
Some information to prove everything is in place(presumably):
![enter image description here](https://camo.githubusercontent.com/1964e9f77d9edea405743efd36dd1a857812d0fb4a543dfa114b453cf7d6bd24/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f58516344612e706e67)
Here's me checking the existence of file and pushing the task from my terminal to AWS ECS:
And here's that very task definition with the revision number and task's family name shown in screenshot above:
![enter image description here](https://camo.githubusercontent.com/7ede790faf20493a3cb7ca34155549f489c20c5e3080184e0706e9094a9d4305/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f304e6e6e732e706e67)
So, as you can see task-definition file does exist, but GitHub doesn't recognise it. What has caused this error and how do I fix this?
Here's the complete build screenshot:
![enter image description here](https://camo.githubusercontent.com/3dfb0cd0a0cfa7905ceaaf3e9f1646c1ac08d0e56aec78d3419b026853d19eca/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f676b58494c2e706e67)
and this is the error:
![enter image description here](https://camo.githubusercontent.com/45ee12c9fbe2a68a432e416e9752ed5a9c8ed79e66abec10fcbd6998c5e2bfc3/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f45696a43312e706e67)
And here's the part of my ".github/workflows/aws.yml" in my repo for task definition (file can be found here in my repository)
Images are being pushed to my ECR repository without any problems, but the problem comes right before executing tasks to use those images and deploy as containers.
EDIT:
![enter image description here](https://camo.githubusercontent.com/fd638c64529700bc07247f876419ae266b9f639c43672c82e7527406dafddcca/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f4e333930732e706e67)
![enter image description here](https://camo.githubusercontent.com/8ffce007dc92e20d6d9b4ee4a8e3d92c17d2f4cece93a05c133c0c4b94b2df96/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f6c587863742e706e67)
Here's the cluster I have used in aws.yml file:
Here's the role I have specified in the task json file:
I have done as described in this article.
The text was updated successfully, but these errors were encountered: