-
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
Quarkus Awt extension doesnt work after upgrading to 3.2.3-Final when using native build #35256
Comments
cc @Karm |
Is it when starting your app from command line or in a Docker container? |
It is failing in the docker container and running in kubernetes |
Yeah, so that's unfortunately expected. GraalVM changed how .so dependencies are handled. See how it was handled here: quarkusio/quarkus-quickstarts@a6c7cfc#diff-89914cf05ea1b37167e374cb1625de38c8f5d48823d4ad228b15b0a3b34ca9e7R30-R32 . I don't see it in the migration guide, though. I'll have a look later. |
I still get the same error even if i do the same changes as mentioned in quarkusio/quarkus-quickstarts@a6c7cfc#diff-89914cf05ea1b37167e374cb1625de38c8f5d48823d4ad228b15b0a3b34ca9e7R30-R32 . |
The message just means that the chain of native .so dependencies that was supposed to be loaded in order for awt to work failed. Can you share exactly which builder image or GraalVM/Mandrel distribution you use? |
Hi, Please find the details below ( extracted from our pipeline) Java version: 17.0.8+7, vendor version: Mandrel-23.0.1.2-Final Builder Image : |
@sreekanth-pricer , so, how does your app differ from this:
? I invite you specifically to check the There is still a chance that your app does something that requires a lib I don't have covered in tests. In that case, would it be possible for you to fork and modify the quickstart app to include your Font parsing code as a quick reproducer? |
I have a doubt which docker file was supposed to be used, because the Dockerfile.native-micro contains the libfreetype dependency which we use. The other docker Dockerfile.native doesn't have any of these. Could you please explain how it works. |
If you are doing this yourself, using your own base and runtime images, note the BEWARE warning: e.g. it won't work if you are trying to copy libraries from newer glibc based Ubuntu Latest to an older glibc based RHEL 8 etc. It would really make things much faster if you could share more about your setup. e.g. "We have this Linux image X, it's roughly based on XYZ etc." |
NOTE: The freetype and fontconfig dependency is not new, so if it worked for you before the Quarkus upgrade, it should keep working fine. The only news is the suite of .so files that must go with your quarkus native executable now. |
We have used jib to build the native image. So I have created a base image for jib as below. The same has been used for both the quarkus versions 3.0 and 3.2 . Worked for 3.0 but not 3.2 FROM quay.io/quarkus/quarkus-micro-image:2.0 COPY --from=BUILD COPY --from=BUILD COPY --from=BUILD COPY --from=BUILD COPY --from=BUILD ENV LD_LIBRARY_PATH='/usr/lib64:/lib64' |
@sreekanth-pricer Hmmm, when you inspect the final runtime image, can you see your quarkus application executable and its necessary .so files along with it? I mean e.g. , in my case:
|
I can confirm that the quarkusio/quarkus-quickstarts@a6c7cfc#diff-89914cf05ea1b37167e374cb1625de38c8f5d48823d4ad228b15b0a3b34ca9e7R30-R32 changes don't seem to help in the docker container... I added the
Has anyone had any luck getting around this error yet?
(Upgrading from 2.x, but was working without issues in 2.x) |
Could you trace my steps in my previous comment to see what actual files you have there? Also, it's important what's the builder system and its libs, e.g. glibc and the target one. |
Hi Karm, I had all the necessary files for my font parsing as i have used a separate base image for the jib as mentioned here #35256 (comment) . Also, we have moved out this font parsing from our quarkus application as we had to fix asap. |
We have the exact same problem from Quarkus 3.2.x on. The only problem in our case is: The application is not running inside a Docker container. We are using the quarkus-amazon-lambda extension and natively compile into an AWS lambda. So I am not really sure where to copy these .so files due to the lack of a Dockerfile. What to do @Karm, any idea? |
@gefloh Could you whip up a small reproducer project I can use with my AWS account? AWS Lambda is a Linux running somewhere and we must copy the needed libs alongside the main Quarkus application executable to it. |
Ok, I will fiddle something. |
I have managed to solve the bug for our case that @billapepper was asking about. In our case we had this in our docker native build in a file called .dockerignore
When the native build runs it adds the native libraries to the builds /target directory. When the Dockerfile.native was building the copy command
It was ignoring the *.so files due to the * in .dockerignore. I have updated the .dockerignore file to
Now the native libraries are included in our docker image and the AWT processing for image resizing works. As a note a lot of the examples in https://github.com/quarkusio/quarkus-quickstarts/tree/main for example One thing to note the files in the AWT example https://github.com/quarkusio/quarkus-quickstarts/blob/main/awt-graphics-rest-quickstart/.dockerignore actually has the allow in the docker ifgnore for the *.so libraries |
@AlexCraddock That is an excellent catch. |
@gefloh Thx. I'll take a look with my AWS. |
Hello @gefloh, the problem is indeed just the missing libraries. ❌✔️When I manually added the .so files and re-uploaded the Lambda, it all went well: ...returning it me a bunch base64 encoded bytes. When I decoded it and jammed it into a .pdf file, it opened just fine for me, showing a caption "Test": I'll proceed and fix this in Quarkus presently. |
Hello @Karm , ah perfect, thanks for your support. |
Closing. Users need to copy libs and install libs as necessary as indicted above. |
@Karm I have a question on how you solved this for an AWS Lambda function. You said that you "manually added the .so files and re-uploaded the Lambda, it all went well". Is there a way to get this to happen as part of the quarkus build? I have a build that runs as a github action that uses the quarkus maven command to build the function zip file then uses terraform to apply this to AWS. I'm not sure I see how I would get those .so files included in the function.zip. |
@aylwyne Just use a Quarkus version >=3.4.0. The build adds the necessary files automatically to the function.zip. |
Thanks. I somehow missed the comment a few back linking to the specific fix in 3.4.0. |
Describe the bug
We use Font class from java-awt to parse the font. After upgrading the quarkus from 3.0.3 to 3.2.3-Final. The feature is broken and i get the error "no awt in java.library.path" with the exception ""java.lang.UnsatisfiedLinkError".
Expected behavior
The expected is to not to get the exceptions and should be able to use Font class from java.awt
Actual behavior
i get the error "no awt in java.library.path" with the exception ""java.lang.UnsatisfiedLinkError".
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: