-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go lambda function fails with `GLIBC_2.32' not found #12577
Comments
Hey @Bryson14, 👋 thank you for reaching out. Wanted to confirm some information. To understand the push using Amplify CLI was successfully but the call from the API gateway endpoint provided a response with a error message? additionally, I was unable to reproduce the error message this when creating an API with a lambda function and adding the provided code. The lambda function received a validation error but did not experience the error provided. |
@ykethan Can you confirm what local version of GLIBC you are using? I think the problem here is that when you push locally, Amazon Linux does not come with the latest GLIBC version. As such we need to compile with |
Hey @benjamindoe, thank you for the information. For the reproduction I created the Lambda function in my project on MacOS and pushed it to git. Then connected to Amplify hosting which should contain the default linux 2 instance to reproduce. in the hosting build settings, i then installed go with the following settings the backend build did not experience an issue with GLIBC. additionally, tested using a Amazon linux 2 instance
created a go lambda function and did a push but did not experience a issue. |
Hi @ykethan So the issue is NOT to do with CI CD. The reason your local See this issue for lambda go: |
Hey @benjamindoe, thank you for the information. noticed Amplify does set this as env variable on windows: https://github.com/aws-amplify/amplify-cli/blob/947b23f1be982d4823df413cbe5595131f101ce7/packages/amplify-go-function-runtime-provider/src/runtime.ts#LL97C1-L97C1 Marking this as bug for further investigation. |
Hey @ykethan, Thanks for the link to the source, really useful. I can see there's no way of actually setting Although it does detected Windows as you stated, this doesn't work for WSL (which is what @Bryson14 is said to be running) as this is a Ubuntu box under the hood and |
Hey @benjamindoe, as you have pointed using a subsystem for linux such as WSL would report the system as linux. The Amplify CLI team has been made aware into the behaviour and will be discussed as part of our triage meetings. |
Hi @ykethan, I can confirm # amplify/hooks/pre-build-function.sh
export CGO_ENABLED=0 |
that does appear to work. As stated above, I'm running ubuntu on WSL 2. Running |
I was having this issue intermittently for some reason during the build process (not on
|
that works for me! :) |
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v18.14.0
Amplify CLI Version
11.1.1
What operating system are you using?
Windows WSL 2
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
I created a go function, then ran
amplify push
to compile and create the lambda function. Everything went smoothly until the function was executed by API Gateway and failed with the error:Expected behavior
The API gateway should return a 200 but instead returns 502 since the lambda function fails.
Reproduction steps
create a api and lambda function with
amplify add api
.Create an api with
/search
path.create a new go function then replace the contents with 👍
amplify push
This will cause the error.
However, I also have CICD setup with a github repo with the following build settings:
when I run
git push
, and the CICD build starts, the error caused byamplify push
from my local machine is fixedProject Identifier
b2a8e45f990b09821ed3bcbcf1838fbc
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: