Skip to content
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

Kotlin Amazon Lambda native image vertx tmp dir failure #7605

Closed
oztimpower opened this issue Mar 5, 2020 · 3 comments
Closed

Kotlin Amazon Lambda native image vertx tmp dir failure #7605

oztimpower opened this issue Mar 5, 2020 · 3 comments
Labels
Milestone

Comments

@oztimpower
Copy link
Contributor

Describe the bug

As detailed in #4254, the vertx cache folder for Kotlin defaults to /var/tmp instead of /tmp for Amazon Lambda which results in a startup failure as this is read-only on AWS. This issue previously existed for Java, yet is now fixed.

START RequestId: 555e0118-5147-4830-86ec-d73469fd046e Version: $LATEST
2020-03-04 14:09:01,667 ERROR [io.qua.application] (main) Failed to start application: java.lang.IllegalStateException: Failed to create cache dir: /var/tmp//vertx-cache/file-cache-14c1dacd-5b2b-4f42-bd36-1e706fa769b2
at io.vertx.core.file.impl.FileResolver.setupCacheDir(FileResolver.java:332)
at io.vertx.core.file.impl.FileResolver.(FileResolver.java:87)
at io.vertx.core.impl.VertxImpl.(VertxImpl.java:167)
at io.vertx.core.impl.VertxImpl.vertx(VertxImpl.java:92)
at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:40)
at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:32)
at io.vertx.core.Vertx.vertx(Vertx.java:85)

The prior shell script bootstrap, added an environment variable to overcome this issue, which was subsequently removed due to concerns over startup latency, and the native image runner renamed to bootstrap as part of the deployment.

bootstrap:
#!/usr/bin/env bash

RUNNER=$( find . -maxdepth 1 -name '*-runner' )
if [[ ! -z "$RUNNER" ]]
then
    $RUNNER -Djava.io.tmpdir=/tmp
fi

Expected behavior
Native image runner should be able to execute when renamed to bootstrap, per the Maven (or Gradle) packaging of function.zip. Vertx cache folder set to /tmp/vertx.

Actual behavior
Temp folder is set to /var/tmp/vertx which is read-only, and should be /tmp/vertx

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/oztimpower/kotlin-lambda.git
  2. mvn package -Dnative -Dquarkus.native.container-build=true
  3. sh manage.sh native create
  4. sh manage.sh native invoke

To prove bootstrap shell script works to resolve this

  1. sh deploy.sh
  2. sh manage.sh native delete
  3. sh manage.sh native create
  4. sh manage.sh native invoke

Environment (please complete the following information):

  • Output of uname -a or ver: Darwin 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
  • Output of java -version: openjdk version "11.0.6" 2020-01-14
    OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07)
    OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode, sharing)
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: HEAD
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /usr/local/Cellar/maven/3.6.3/libexec

@patriot1burke
@sherl0cks

@oztimpower oztimpower added the kind/bug Something isn't working label Mar 5, 2020
@quarkusbot
Copy link

/cc @patriot1burke

@patriot1burke
Copy link
Contributor

@oztimpower Can you try this out?

https://github.com/patriot1burke/quarkus/tree/lambda-tmpdir

A few people have complained about this issue but I've been unable to reproduce it in my AWS account. I don't know if its because I'm in a different region or what.

@oztimpower
Copy link
Contributor Author

I confirm that #7619, resolves the issue with my Kotlin Amazon Lambda project. i.e., forcing the tmp dirs in AmazonLambdaProcessor.java works.

Many thanks! Closing this issue per resolution under #7619.

patriot1burke added a commit that referenced this issue Mar 7, 2020
@gsmet gsmet added this to the 1.3.0.CR2 milestone Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants