Skip to main content
Knowledge Base

CircleCI pipeline fails to build AMI image [ERROR: error: unbalanced parenthesis at position 230]

Answer

Hello all, i am trying to build AMI with CircleCI pipelines. I took the examples of CircleCI scripts from [here](https://github.com/gruntwork-io/terraform-aws-service-catalog/tree/master/examples/for-production/infrastructure-live/_ci/scripts). The AMI build script I took from [here](https://github.com/gruntwork-io/terraform-aws-service-catalog/tree/master/examples/for-production/infrastructure-live/shared/us-west-2/_regional/amis). The CircleCI gives the following error, looks like from [this line](https://github.com/gruntwork-io/terraform-aws-service-catalog/blob/master/examples/for-production/infrastructure-live/shared/us-west-2/_regional/amis/build_eks_cluster_instance.sh#L105): ``` #!/bin/bash -eo pipefail ./_ci/scripts/run-build-scripts.sh "$SOURCE_REF" "$CIRCLE_BRANCH" The following build scripts were updated: shared-services/eu-central-1/_global/amis/build_eks_cluster_instance.sh Calling build script shared-services/eu-central-1/_global/amis/build_eks_cluster_instance.sh 2023-02-09 13:07:30 [INFO] [aws-auth] Assuming role arn:aws:iam::502221110000:role/allow-auto-deploy-from-other-accounts. These creds will expire after 3600 seconds. 2023-02-09 13:07:32 [INFO] [aws-auth] Success! [infrastructure-deployer] INFO[2023-02-09T13:07:33Z] Invoking Lambda function ecs-deploy-runner-invoker to trigger deployment. ERROR: error: unbalanced parenthesis at position 230 ``` I assume that the bash line was somehow not correctly parsed by `ecs-deploy-runner-invoker` Lambda function. Have someone saw something like this? Is there any workaround? --- <ins datetime="2023-02-09T13:20:02Z"> <p><a href="https://support.gruntwork.io/hc/requests/109887">Tracked in ticket #109887</a></p> </ins>

Hello, grunties! I figured out the problem. I had a typo in `allowed_repos_regex` value, so the `--packer-template-path` option for the `infrastructure-deployer` command could not be compared correctly with allowed repos.