-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
AWT graphics with AWS Lambda not working in native #23998
Comments
cc @Karm |
Hmm, weird, I looks as if MLib wasn't baked in, i.e. before https://bugs.openjdk.java.net/browse/JDK-8254024. |
@Karm couldn't it be that the native image is built with a Glibc that is incompatible with the one of the runtime image? |
@gsmet It is weird, because @felixosth 's system in not anything obscure, it's just a modern Ubuntu. It works for me with my
Starting Quarkus native just fine:
The error at the end is related to something else. Reading the guide:
My system: I will try with Ubuntu... |
Might be worth mentioning that we build our app in Github Actions using the command |
I can reproduce it on my Ubuntu VM:
System:
|
IMHO Ubuntu's glibc is too new for the Linux AWS Lambda executes on. I will try to confirm... |
It's not really about being too new or too old. It's more that you need consistent Glibc (or at least compatible Glibc) in the builder image and in the runtime image. |
Well, the version (backward vs forward) matters though. e.g. executable built on Centos 8 works just fine on Ubuntu 20, but not vice versa.
|
I also suspect that if I make it work (the base64 / no binary in API AWS Lambda limitation thing), it would hit possibly missing libraries such as fontconfig etc. I will try to toy with AWS Lambda to make a working example. |
Please let me know if I can do anything to help! |
I run in the same issue with lambda... You must provide a libm.so.6 file in zip.native under resources folder (See: https://quarkus.io/guides/amazon-lambda#modifying-function-zip) If your host system isn't linux you could get the libm.so.6 file from docker as described here: https://quarkus.io/guides/amazon-lambda#additional-requirements-for-client-ssl |
So you managed to fix it with libm.so.6 only? I remember troubleshooting by adding libz, libfreetype, libfontconfig and libpng16 but that didn't work. |
Ah sorry, I only read your stacktrace. Sure I also provide some additional libs like libz2, libexpat, libfreetype, libfontconfig, ... Did you use Amazon Linux 1 or 2? The error is because libm use a newer version of libz. I managed this, that I tell the lambda (through environment properties) to preload the provided libz. JAVA CDK-Script: Function lambdaFunctionRunTask =
Function.Builder.create(this, "NAME")
.runtime(Runtime.PROVIDED_AL2)
.handler("not.used.in.provided.runtime")
.memorySize(2048)
.architecture(Architecture.ARM_64)
.environment(
new HashMap<>() {
{
put("LD_PRELOAD", "/var/task/libz.so.1");
put("DISABLE_SIGNAL_HANDLERS", "true");
}
})
...
.build(); |
Closing. Not a Quarkus/Mandrel issue any more; one needs to pick compatible runtime for the deployment (libc, dependencies). |
Describe the bug
Combining the two guides https://quarkus.io/guides/amazon-lambda-http and https://github.com/quarkusio/quarkus-quickstarts/tree/main/awt-graphics-rest-quickstart doesn't work with native-image.
The error
/var/task/bootstrap: /lib64/libm.so.6: version 'GLIBC_2.29' not found (required by /var/task/bootstrap)
is thrown when testing using./mvnw package -Dnative
andsam local invoke --template target/sam.native.yaml
.awt-quarkus
is added to pom.xml.Sample project attached: source.zip
Expected behavior
No error thrown and the application starts successfully.
Actual behavior
The following error is visible in the terminal:
How to Reproduce?
Download the attached project above and run the following commands:
./mvnw package -Dnative
sam local invoke --template target/sam.native.yaml
Output of
uname -a
orver
Linux my-ubuntu 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.14" 2022-01-18 OpenJDK Runtime Environment GraalVM CE 21.3.1 (build 11.0.14+9-jvmci-21.3-b09) OpenJDK 64-Bit Server VM GraalVM CE 21.3.1 (build 11.0.14+9-jvmci-21.3-b09, mixed mode, sharing)
GraalVM version (if different from Java)
GraalVM CE 21.3.1 (build 11.0.14+9-jvmci-21.3-b09)
Quarkus version or git rev
2.7.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: