Describe the bug
Following lambda guide works perfectly in native mode. But when adding dependency on io.quarkus:quarkus-resteasy it fails with
java.lang.IllegalStateException: Failed to create cache dir
at io.vertx.core.file.impl.FileResolver.setupCacheDir(FileResolver.java:332)
at io.vertx.core.file.impl.FileResolver.<init>(FileResolver.java:87)
at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:165)
Found this (already fixed) bug
that provided workaroud with forcing java.tmpdir to /tmp.
Hovever the official 1.0.0.Final guide (and maven archetype) does not use additional sh bootstrap file, but simply renames native executable to bootstrap.
On the side note, local invocation of lambda function with AWS SAM framework works without problem.
Expected behavior
Guide and archetype should provide valid infrormation.
To Reproduce
Steps to reproduce the behavior:
cc @evanchooly
Hi
I am facing the same problem, no idea how to set -Djava.io.tmpdir=/tmp and
-Dvertx.cacheDirBase=/tmp/vertx ystem property in aws lambda deployment.
Tried by setting --environment flag in aws lambda create-function by defining JAVA_OPTS property, but did not make any difference.
java.lang.IllegalStateException: Failed to create cache dir
Â
Regards

I have also tried quarkus.platform.version 1.0.1.Final
Describe the bug
Following lambda guide works perfectly in native mode. But when adding dependency on io.quarkus:quarkus-resteasy it fails with
java.lang.IllegalStateException: Failed to create cache dir at io.vertx.core.file.impl.FileResolver.setupCacheDir(FileResolver.java:332) at io.vertx.core.file.impl.FileResolver.<init>(FileResolver.java:87) at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:165)Found this (already fixed) bug that provided workaroud with forcing java.tmpdir to /tmp.
Hovever the official 1.0.0.Final guide (and maven archetype) does not use additional sh bootstrap file, but simply renames native executable to bootstrap.
On the side note, local invocation of lambda function with AWS SAM framework works without problem.Expected behavior
Guide and archetype should provide valid infrormation.To Reproduce
Steps to reproduce the behavior:
- Create aws lambda project found here: https://quarkus.io/guides/amazon-lambda
- Add extension quarkus-resteasy to the project and create a resteasy service within the code.
- Build natively and upload to aws lambda.
- execute lambda function
@mihapolak
Hi
Have you tried printing java.io.tmpdir system property in rest endpoint and invoke it with sam local ... the set value should be printed!! The problem is it is not clear how to set java.io.tmpdir system property at build/run time in native image.
I'm not convinced you're using the correct module, honestly. if you're wanting to use resteasy based services, you should be using amazon-lambda-http instead which explicitly supports resteasy based services and routing.
+1
On Wed, 4 Dec 2019 at 9:25 PM, Justin Lee notifications@github.com wrote:
I'm not convinced you're using the correct module, honestly. if you're
wanting to use resteasy based services, you should be using
amazon-lambda-http instead which explicitly supports resteasy based
services and routing.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/quarkusio/quarkus/issues/5859?email_source=notifications&email_token=ABI66UAJM4PT6UOLUTBYFL3QW7KXTA5CNFSM4JS34TBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF5S6WA#issuecomment-561721176,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABI66UAIWE6B7JDDQKAAZE3QW7KXTANCNFSM4JS34TBA
.
@evanchooly , I agree with you to use amazon lambda http. But I guess there are other components using vertx?
@mehdi-reza, local sam invoke shows /var/tmp/ (if not changed with custom bootstrap file), which obviously works within local tests but not in case of actual aws deployment.
I'm also facing this issue when using the quarkus-mailer with quarkus-amazon-lambda:
ERROR [io.qua.application] (main) Failed to start application: java.lang.IllegalStateException: Failed to create cache dir
Based on the information here, my solution was to:
zip.xml to rename bootstrap to runner:<file>
<source>${project.build.directory}${file.separator}${artifactId}-${version}-runner</source>
<outputDirectory>/</outputDirectory>
<destName>runner</destName>
<fileMode>755</fileMode>
</file>
bootstrap.sh file to invoke the native runner with the java.io.tmpdir setting:#!/bin/sh
./runner -Djava.io.tmpdir=/tmp
zip.xml file to include the new bootstrap file:<file>
<source>${project.basedir}/src/assembly/bootstrap.sh</source>
<outputDirectory>/</outputDirectory>
<destName>bootstrap</destName>
<fileMode>755</fileMode>
</file>
@mihapolak Sorry for very late reply.
@evanchooly Solution for the system property issues is to just set java.io.tmpdir=/tmp and
vertx.cacheDirBase=/tmp/vertx via a SystemPropertyBuildIItem. Personally though I could never reproduce this issue. I'll assign this to myself if you like.
@mihapolak Justin is right in that you can't just add quarkus-resteasy, you ahve to add amazon-lambda-http too and follow the quarkus docs for setting up the API gateway with a sam.yaml file.
Sounds great @patriot1burke.
AmazonLambdaCommonProcessor now forces the temp dirs post @patriot1burke updates, suggest this one can be closed?