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

Apache License 2.0
130 stars 40 forks source link

Getting Error: GoModulesBuilder:Build - Builder Failed with deploy-tre.sh when building Lambda functions #27

Closed mungoknotwise closed 1 year ago

mungoknotwise commented 1 year ago

I am getting a directory not found error in deploy-try.sh when building Lambda functions.

Environment: MacOS Ventura 13.3.1 (22E261) SAM: SAM CLI, version 1.79.0 AWS CLI: aws-cli/2.11.11 Python/3.11.2 Darwin/22.4.0 exe/x86_64 prompt/off Python: 3.9.13 Python is managed by pyenv

Steps to reproduce:

  1. Clone the repo.
  2. Set up my AWS profile.
  3. Change directory to the repo root.
  4. Invoke bin/bash/deploy-tre.sh -r us-east-1

The error I get (with a few preceeding lines):

Building codeuri: /Users/stevencaswell/Projects/aws/service-catalog/terraform-reference-engine/service-catalog-engine-for-terraform-os/lambda-functions/provisioning-operations-handler runtime: python3.9 metadata: {} architecture: x86_64 functions: TerraformEngineProvisioningHandlerLambda, TerraformEngineTerminateHandlerLambda
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource
Building codeuri: /Users/stevencaswell/Projects/aws/service-catalog/terraform-reference-engine/service-catalog-engine-for-terraform-os/lambda-functions/terraform_open_source_parameter_parser runtime: go1.x metadata: {} architecture: x86_64 functions: ParameterParser
Running GoModulesBuilder:Build

Build Failed
Error: GoModulesBuilder:Build - Builder Failed: stat /Users/stevencaswell/Projects/aws/service-catalog/terraform-reference-engine/service-catalog-engine-for-terraform-os/lambda-functions/terraform_open_source_parameter_parser/terraform_open_source_parameter_parser: directory not found

It looks as if the name of the Python directory has been added twice to the function path:

/Users/stevencaswell/Projects/aws/service-catalog/terraform-reference-engine/service-catalog-engine-for-terraform-os/lambda-functions/terraform_open_source_parameter_parser/terraform_open_source_parameter_parser
mungoknotwise commented 1 year ago

I solved my own problem, will leave this here in case others have this problem.

In looking further through other issues, I ran across a recommendation to upgrade go to the latest version, 1.20. I upgraded my go to this version and the problem was resolved.

kaul-abhi commented 9 months ago

@mungoknotwise Steven i upgraded my go version to v1.20.7 but still this error is coming i am facing same issue