awslabs / aws-lambda-rust-runtime

A Rust runtime for AWS Lambda
Apache License 2.0
3.29k stars 335 forks source link

GLIBC_2.28 not found #874

Closed rgreinho closed 3 months ago

rgreinho commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.

github-actions[bot] commented 3 months ago

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 commented 3 months ago

Thanks y'all, it worked! 😃

mbergkvist commented 2 months ago

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 commented 1 month ago

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.