Invalid action configuration: Exception while trying to read the task definition artifact file

Question:

I have a Codepipeline that deploys an ECR image to an ECS cluster using an ECS Blue / Green Deployment action. The pipeline contains two sources: one for the ECR image using an AWS ECR action and another one for fetching the configuration from Github using a ThirdParty Github action. The ECR action outputs an image artifact while the Github action outputs a config artifact. Both of these artifacts are provided as an input to the ECS Blue / Green Deployment action.

The pipeline fails at the ECS Blue / Green Deployment action with the following error (visible from AWS console):

Invalid action configuration

Exception while trying to read the task definition artifact file from: config

Here is the structure of the pipeline (some details are edited for anonymity):

I have checked the compressed artifact in the S3 and it definitely contains the configuration files in the Github repository at the location specified by AppSpecTemplatePath and TaskDefinitionTemplatePath.

Here is the content of appspec.yaml:

Answer:

After extensively trying out things, I stumbled upon a thread in a foreign language which I cannot find it. The thread said something about the artifact being passed to the action cannot be larger than 3 MB.

I solved my problem by reducing the size of the artifact (config). The configuration repository is shared among many projects and by moving those items to another project, I decreased the compressed artifact size from 14 MB to 3 kB. Miraculously, everything worked fine. AWS if you are reading this, please add more documentation about the artifact size limits to ECS CodeDeploy as I don’t see any mention about this and I have no way of debugging this problem with such a general error message.

Leave a Reply