Skip to content

GLIBC not found while building against Amazon Linux 2 - x86_64 #467

Description

@fancywriter

Hello!

I am trying to build example from README. It is said it's recommended to use Amazon Linux 2 runtime because it's "easier to build", that's what I am trying to do.

My Cargo.toml:

[package]
name = "rust-lambda-hello"
version = "0.1.0"
edition = "2018"

[dependencies]
lambda_runtime = "0.5.1"
serde_json = "1.0.79"
tokio = { version = "1.17.0", features = [ "macros" ] }

src/main.rs is the same as in README.

Building with command (from the Linux laptop with the same x86_64 architecture, uname -m gives me x86_64)

cargo lambda build --release --target x86_64-unknown-linux-gnu --output-format zip

Success. Than deploying with command

aws lambda create-function --function-name rust-lambda-hello --handler bootstrap --zip-file fileb://./target/lambda/rust-lambda-hello/bootstrap.zip --role <MY_LAMBDA_ROLE_ID> --runtime provided.al2  --environment Variables={RUST_BACKTRACE=1}   --tracing-config Mode=Active

Also success.

But later when I am trying to invoke this function

aws lambda invoke  --function-name rust-lambda-hello --payload '{"hello": "world"}'  --cli-binary-format raw-in-base64-out   output.txt

, it doesn't work, it gives

{
  "errorMessage": "RequestId: <???> Error: Runtime exited with error: exit status 1",
  "errorType": "Runtime.ExitError"
}

When trying to search some logs, I found three lines

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

I am using rust-1.59.0.

What did I do wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions