Skip to content

Instantly share code, notes, and snippets.

@ajitatif
Created October 14, 2020 12:53
Show Gist options
  • Save ajitatif/63fc958e19d0586f48056409dc4e1a0a to your computer and use it in GitHub Desktop.
Save ajitatif/63fc958e19d0586f48056409dc4e1a0a to your computer and use it in GitHub Desktop.
Strangest errors encountered while using Quarkus and (hopefully) solutions to them

Native Images

Image Build Fails

No space left on device

Caused by: java.nio.file.FileSystemException: /tmp/SVM-7967422287467763050: No space left on device
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
        at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
        at java.base/java.nio.file.Files.createDirectory(Files.java:689)
        at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:135)
        at java.base/java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:172)
        at java.base/java.nio.file.Files.createTempDirectory(Files.java:1006)
        at com.oracle.svm.hosted.NativeImageGenerator.tempDirectory(NativeImageGenerator.java:1676)
        ... 10 more

This one's easy - first make sure you have enough phyiscal disk space already. If that's not the case, you need to prune your docker image cache:

docker system prune --all --volumes --force

Keep in mind this will delete all the data in the containers not running currently

SIGBUS

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007fe677f4f1e5, pid=26, tid=59
... bla bla bla
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:387)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
  Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 134
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:489)
        at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:365)
        ... 12 more

This one was a real troublemaker. Showed up randomly after I added a new javax.ws.Resource to the already existing service. It seems I'm the only one ever encountered this in GraalVM and Quarkus world. Some research on docker SIGBUS suggested that SIBGUS is received when the container runs out of shared memory (SHM in Linux terms). (which is 64M by default, btw.)

To set the SHM size of a docker container while running is done through --shm-size setting which can be appended to the Quarkus runtime parameters as below:

./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-runtime-options="--shm-size=128M"

I don't know why shared memory usage increased after adding the resource, and I'm not going to dig in that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment