codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: not found

QuestionsCategory: Questionscodebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: not found
Jason Price Staff asked 6 months ago
Spread the love

I’m getting this very frustrating error when running codebuild

 

[Container] 2019/04/26 12:54:36 Running command $(aws ecs update-service –cluster arn:aws:ecs:eu-west-1:x21657xxxxxx:cluster/ fargate-cluster –service service –force-new-deployment)

/codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: {: not found

 

[Container] 2019/04/26 12:54:37 Command did not exit successfully $(aws ecs update-service –cluster arn:aws:ecs:eu-west-1:x21657xxxxxx:cluster/ fargate-cluster –service service –force-new-deployment) exit status 127

[Container] 2019/04/26 12:54:37 Phase complete: POST_BUILD State: FAILED

[Container] 2019/04/26 12:54:37 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: $(aws ecs update-service –cluster arn:aws:ecs:eu-west-1:x21657xxxxxx:cluster/ fargate-cluster –service service –force-new-deployment). Reason: exit status 127

1 Answers
Cando Mata Staff answered 6 months ago

Remove the dollar sign and brackets around the command. So use:

aws ecs update-service –cluster arn:aws:ecs:eu-west-1:x21657xxxxxx:cluster/fargate-cluster –service service –force-new-deployment

 

Instead of

$(aws ecs update-service –cluster arn:aws:ecs:eu-west-1:x21657xxxxxx:cluster/fargate-cluster –service service –force-new-deployment)