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

Apache License 2.0
130 stars 40 forks source link

Error occurred during parameter parsing #15

Closed Adarsh505-cloud closed 1 year ago

Adarsh505-cloud commented 1 year ago

Hi,

I am getting the following error while trying to launch a product, I have followed all the steps mentioned in the documentation.

Error occurred during parameter parsing: RequestId: feaf0bad-fb24-4dee-8dbf-0d624b7eb800 Error: Runtime exited with error: exit status 1

While checking the lambda function "ServiceCatalogTerraformOSParameterParser" logs I saw the following error.

/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)

Could you please let me know how can I fix this issue.

Thank you.

smaly-amazon commented 1 year ago

Thanks for reporting this issue.

So far we have not been able to reproduce the issue. There is probably some difference between your machine and mine as far as libraries and other environment factors go.

I suggest you try the following.

  1. Please run go version to see what version you have. The latest version is 1.20. If you are not on this version, could you try upgrading and then repeating the deployment steps for the Terraform Reference Engine?

  1. If upgrading go doesn't resolve the issue, there may be a problem with how the go lambda is being built in your environment.

See this issue related to your error message: https://github.com/aws/aws-lambda-go/issues/340

You can try running these commands to get the required libraries built and deployed into the go lambda.

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 sam build

sam deploy --s3-bucket terraform-engine-bootstrap-<account>-<region> --stack-name SAM-TRE --capabilities CAPABILITY_NAMED_IAM

Please let us know if either of these suggestions resolves the issue, so we can update the deployment steps as needed.

Adarsh505-cloud commented 1 year ago

HI,

I have checked the go version and confirmed that we are using the latest version.

I have also tried the second commands and now I am getting a different error while trying to launch the product.

Error occurred during parameter parsing: fork/exec /var/task/terraform_open_source_parameter_parser: no such file or directory

Lambda "ServiceCatalogTerraformOSParameterParser" log

{
  "errorMessage": "fork/exec /var/task/terraform_open_source_parameter_parser: no such file or directory",
  "errorType": "PathError"
}
smaly-amazon commented 1 year ago

Hello,

I'm sorry those suggestions did not help.

Would you please provide the following, which will help us reproduce the problem?

  1. Your operating system and version
  2. The output of the go env command. Thanks.
Adarsh505-cloud commented 1 year ago

Hi,

Sorry for the delay in response.

I am using Ubuntu 22.04, please see the out put of the go env commad.

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2278423851=/tmp/go-build -gno-record-gcc-switches"

Please let me know if you any suggestions.

bruno-rossini commented 1 year ago

I had the same problem as @Adarsh505-cloud when trying to launch a product: "Error occurred during parameter parsing: RequestId: 0f8db7e0-b8ca-4a50-b46d-f29109392135 Error: Runtime exited with error: exit status 1"

Executed these commands to get my lambda updated as suggested:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 sam build

sam deploy --s3-bucket terraform-engine-bootstrap-<account>-<region> --stack-name SAM-TRE --capabilities CAPABILITY_NAMED_IAM

And now it´s working. Tks!

Adarsh505-cloud commented 1 year ago

bruno-rossini

Could you please let me know the operating system and version you are using.

Also please let me know whether the installation was done manually or automatic installation method?

smaly-amazon commented 1 year ago

Hi Adarsh505-cloud,

We have seen other occasions where the same error has occurred that you saw after setting CGO_ENABLED=0. The cause was an invalid zip file being uploaded for the ParameterParser lambda. The solution in those cases was to delete the SAM_TRE stack and recreate it.

Could you please try deleting the SAM_TRE stack?

Then try running these commands:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 sam build

sam deploy --s3-bucket terraform-engine-bootstrap-<account>-<region> --stack-name SAM-TRE --capabilities CAPABILITY_NAMED_IAM

We will work on updating the automated deploy script and the manual installation instructions so this issue doesn't happen in the future.

I did try installing the engine from Ubuntu 22.04 but was not able to reproduce the problem. I apologize for the inconvenience with this issue.

Adarsh505-cloud commented 1 year ago

Hello, smaly-amazon

I appreciate your support.

After deleting the SAM TRE stack and installing it again, I still had the issue, but after using the above command, the everything is now functioning as expected.

Also, I believe I discovered a jd: command not found error while the automated script running. If necessary, please give jd installation instructions. Issue has been fixed after installing jd using the steps below.

$ sudo yum makecache
$ sudo yum install jq

Thank you so much for your help.