Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipeline failing: Unknown parameter in input: "registeredAt"

Anuj January 19, 2021

Urgent help required. Production Pipeline failing 

Using atlassian/aws-ecs-deploy:1.3.0

 

The pipelines to ECS are failing with the following error

✖ ECS task definition parameter validation error: Parameter validation failed:

Unknown parameter in input: "registeredAt", must be one of: family, taskRoleArn, executionRoleArn, networkMode, containerDefinitions, volumes, placementConstraints, requiresCompatibilities, cpu, memory, tags, pidMode, ipcMode, proxyConfiguration, inferenceAccelerators
Unknown parameter in input: "registeredBy", must be one of: family, taskRoleArn, executionRoleArn, networkMode, containerDefinitions, volumes, placementConstraints, requiresCompatibilities, cpu, memory, tags, pidMode, ipcMode, proxyConfiguration, inferenceAccelerators

Earlier it was working fine.

 

Following is the task definition

 

{
'containerDefinitions': [
],
'executionRoleArn': 'arn:aws:iam::<user>:role/ProdECSRole',

'family': 'backend-task-def',
 
'networkMode': 'bridge',
 
'placementConstraints': [],
 
'registeredAt': 1610533632.651,
 
'registeredBy': 'arn:aws:iam::<user>:user/bitbucket-prod',
'requiresCompatibilities': ['EC2'],
 
'taskRoleArn': 'arn:aws:iam::<user>:role/ProdECSRole',
'volumes': []
}

 

2 answers

1 accepted

0 votes
Answer accepted
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2021

Hi @Anuj ,

Thank you for your question.

It looks like it's AWS issue relates to the latest AWS API update.

We're investigating the issue and will notify you of any updates.

 

It would be nice if you provide us with more details: how long have you used aws-esd-deploy pipe with "registeredAt" and "registeredBy" params?

Anuj January 21, 2021

The last successful deployment was on January 13, 2021

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2021

@Anuj is it necessary for you to keep these arguments in  task definition? Looks like they are not provided anymore in documentation and I don't know if they've been ever provided. AWS respond with these parameters, but does not take into task definition (or they have updated documentation).

Have you tried to remove these fields, if you don't really need it?

 

It is because these are actually not allowed fields in task definition, these are post-processing fields, that aws cli creates after registering your task definition - it is like general createdAt fields.

Since we did not upgrade any version of aws libraries, neither botocore, no boto3 and not awscli , this looks like really aws documentation or aws server problem referring to the issue that @Oleksandr Kyrdan has mentioned.

 

 

Regards, Galyna

Anuj January 22, 2021

I don't think I'm adding these values. 

I use the following script to update the existing task definition, so the definition is retrieved from the AWS and replaced the required values only

 

TASK_DEFINITION=$(aws ecs describe-task-definition --task-definition "$AWS_ECS_TASK_FAMILY")
NEW_TASK_DEFINITION=$(echo "$TASK_DEFINITION" | jq --arg IMAGE "$ECR_IMAGE_TAG" '.taskDefinition | .containerDefinitions[0].image = $IMAGE | del(.taskDefinitionArn) | del(.revision) | del(.status) | del(.requiresAttributes) | del(.compatibilities)')

 

And using the NEW_TASK_DEFINITION in the pipeline

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2021

@Anuj ,

So I know what the problem is.

When you describe task definition, it responds to you with ALL fields that it make it visible. So registeredAt and registeredBy are those fields in the response, but not acceptable by AWS server side validator anymore (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTaskDefinition.html).

 

So you change just the image tag to deploy, but still want task definition to be new one to update the service.

 

Unfortunately, we're not able to fix this by upgrading AWS libraries, because it is on their server side.

But you can remove these not-acceptable fields by the same tool you're using - jq. Just like you remove other not needed fields

Is this solution fine for you? We are looking forward to your update and feedback, so we can investigate firther if there is still a problem resolving this.

 

Regards, Galyna

sunilamara January 26, 2021

Append the additional values | del(.registeredAt) | del(.registeredBy)') to your NEW_TASK_DEFINITION and run the pipeline.

--

Regards,

Sunil Amara

Like # people like this
Anuj January 27, 2021

@Halyna Berezovska Thanks. After deleting these params (as suggested by @sunilamara )  worked.

Like # people like this
0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2021

@Anuj

I have not found registeredAt, registeredBy parameters in Request syntax of  https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.register_task_definition.

These parameters are only in Response syntax, I believe they cannot exist in request syntax, because they are like update_at, created_at paramters, that can persist only AFTER the request processing.

Check out this doc and ensure that you have right parameters , but pay attention only to Request Syntax. At the first glance to fix this, you have to remove these two params.

Regards, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events