Skip to content
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

GLIBC_2.28 not found #874

Closed
rgreinho opened this issue May 13, 2024 · 9 comments
Closed

GLIBC_2.28 not found #874

rgreinho opened this issue May 13, 2024 · 9 comments

Comments

@rgreinho
Copy link
Contributor

rgreinho commented May 13, 2024

Since I upgraded to Rust 1.78, I am facing the following issue while deploying lambda functions:

/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/bootstrap) 

I checked older issues and found somehow similar ones, but it looks like I am building and deploying my functions correctly though:

My runtime is Amazon Linux 2:

image

The functions are built with cargo lambda build --release

My rust version is:

$ rustc --version
rustc 1.78.0 (9b00956e5 2024-04-29)

And I am using lambda_runtime = "0.11.1".

Could it be that Rust 1.78 cannot yet run on Amazon Linux 2 runtimes?

@RDarrylR
Copy link

I believe you will need to move to Amazon Linux 2023 as AL2 doesn’t support newer GLIBC versions. That was my experience when I was using AL2.

@calavera
Copy link
Contributor

I believe you will need to move to Amazon Linux 2023 as AL2 doesn’t support newer GLIBC versions. That was my experience when I was using AL2.

That's correct. Deploy your function with the runtime provided.al2023.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.

@rgreinho
Copy link
Contributor Author

Thanks y'all, it worked! 😃

@mbergkvist
Copy link
Contributor

We are deploying to aws-cn so Amazon Linux 2023 is unfortunately not yet an option for us. Our solution is to add

{
    bundling: {
        cargoLambdaFlags: ['--target', 'aarch64-unknown-linux-gnu.2.26'],
    },
    runtime: 'provided.al2'
}

to the RustFunctionProps (cargo-lambda-cdk).

@tbar4
Copy link

tbar4 commented Jul 11, 2024

We are deploying to aws-cn so Amazon Linux 2023 is unfortunately not yet an option for us. Our solution is to add

{
    bundling: {
        cargoLambdaFlags: ['--target', 'aarch64-unknown-linux-gnu.2.26'],
    },
    runtime: 'provided.al2'
}

to the RustFunctionProps (cargo-lambda-cdk).

Thanks for solving, AWS gov-cloud won't be getting AL2023 for lambda for the foreseeable future so this is a big help.

@jtuliani
Copy link

@tbar4 The Lambda AL2023 runtimes are now available in China regions: https://www.amazonaws.cn/en/new/2024/amazon-lambda-adds-support-for-amazon-linux-2023-runtimes-in-amazon-web-services-china-regions/

robertrv added a commit to robertrv/serverless-rust-demo that referenced this issue Nov 21, 2024
This helps to fix the failures I was getting about missing GLIBC_2.28 which is no longer available on al2

Reference: awslabs/aws-lambda-rust-runtime#874
@hxk1633
Copy link

hxk1633 commented Jan 8, 2025

@calavera Using the provided.al2023 fixes this issue, but fails to build the docker image when I use sam local start-api. The image it tries to build is public.ecr.aws/sam/emulation-provided.al2023 according to my logs. I have more details about this in an issue I created: aws/aws-sam-cli#7825. Curious if this is is an issue with the provided.2023 docker image or a bug with the SAM CLI. Your thoughts?

@rimutaka
Copy link
Contributor

rimutaka commented Jan 8, 2025

The lambda binary can include the GLIBC if there is a mismatch with what is in the image/container:

RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target $target --package $crate

How it works: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-feature

Current GLIBC versions

Check the links for the latest at the time of reading this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants