aws-samples / service-catalog-engine-for-terraform-os

Apache License 2.0
130 stars 40 forks source link

Error occurred during parameter parsing #29

Closed dawidcx3 closed 1 year ago

dawidcx3 commented 1 year ago

Hello, I'm testing the Terraform based products and I found an issue.

I did all the configuration steps as it's mentioned in README and so far the 'Terraform open source products' seem to work as expected. But I've got a problem with parameters. When I try to launch the product and I select 'Launch options' I receive an error on top: "Error Error occurred during parameter parsing: RequestId: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Error: Runtime exited with error: exit status 1" and no parameter is available then.

I took a look into logs and in ServiceCatalogTerraformOSParameterParser Lambda function there are two errors after every run:

  1. "/var/task/terraform_open_source_parameter_parser: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /var/task/terraform_open_source_parameter_parser)"
  2. "/var/task/terraform_open_source_parameter_parser: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /var/task/terraform_open_source_parameter_parser)"

There is a sequence - errors above appear (each of them every time) and then there is an exit status 1.

I found that you've posted a commit with pull request already #28 and it has linked issue #15 and issue #23. Is this the fix that should I consider as valid?

OliverBailey commented 1 year ago

@dawidcx3 Was about to create a PR with the same fix. It is required to have the lambda work as appropriate.

It turns out recent version of go changes the default from CGO_ENABLED=0 to CGO_ENABLED=1 which means the libraries aren't pulled through properly.

I personally just did

export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64

Just before the sam build step located in /bin/bash/deploy-tre.sh

smaly-amazon commented 1 year ago

@dawidcx3 I apologize for the issue you are having.

The comment from @OliverBailey is correct. We just merged a change to make sure the CGO_ENABLED environment variable is set to 0 to properly build and deploy the parameter parser lambda.

You can try to pull the latest commit from main and rerun bin/bash/deploy-tre.sh. however, we have seen issues when trying to update the lambda in place with this particular fix. If the lambda still doesn't work properly after updating it, you will need to delete the SAM-TRE stack and then run the bin/bash/deploy-tre.sh script again to create it.

OliverBailey commented 1 year ago

We just put in the change and re-ran the script and had no issues with the updating of the Lambda with it (In case you do want to try that first) :)

dawidcx3 commented 1 year ago

I ran the script with the latest commit. It seems that problem is solved and now I'm able to run Terraform infrastructure with parameters when I launch it.

Lambda is also working for me.

Problem is solved. Thank you :)