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?
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:
src/main.rsis the same as in README.Building with command (from the Linux laptop with the same x86_64 architecture,
uname -mgives mex86_64)Success. Than deploying with command
Also success.
But later when I am trying to invoke this function
, it doesn't work, it gives
When trying to search some logs, I found three lines
I am using rust-1.59.0.
What did I do wrong?