Need help on fixing error: java.nio.file.DirectoryNotEmptyException: /basedir/target/jib-cache/tmp/3227117988474356011

18 views
Skip to first unread message

Prathap Kumar Parvathareddy

unread,
Mar 7, 2020, 1:59:50 PM3/7/20
to Jib users
mvn compile jib:build \
-Dimage=${TARGET_GCR_IMAGE} \
-Dbase-container-image=${BASE_CONTAINER_IMAGE} \
-Dbase-container-image.version=${BASE_CONTAINER_IMAGE_VERSION} 

ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.5.1:build (default-cli) on project dataflow-streaming-benchmark: /basedir/target/jib-cache/tmp/6910034298542626851

On running maven in debug mode error is:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.5.1:build (default) on project /basedir/target/jib-cache/tmp/3227117988474356011
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: /basedir/target/jib-cache/tmp/3227117988474356011
    at com.google.cloud.tools.jib.maven.BuildImageMojo.execute (BuildImageMojo.java:158)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.nio.file.DirectoryNotEmptyException: /basedir/target/jib-cache/tmp/3227117988474356011
    at sun.nio.fs.UnixCopyFile.move (UnixCopyFile.java:498)
    at sun.nio.fs.UnixFileSystemProvider.move (UnixFileSystemProvider.java:262)
    at java.nio.file.Files.move (Files.java:1395)
    at com.google.cloud.tools.jib.cache.CacheStorageWriter.lambda$moveIfDoesNotExist$0 (CacheStorageWriter.java:91)
    at com.google.cloud.tools.jib.cache.Retry.run (Retry.java:120)
    at com.google.cloud.tools.jib.cache.CacheStorageWriter.moveIfDoesNotExist (CacheStorageWriter.java:97)
    at com.google.cloud.tools.jib.cache.CacheStorageWriter.writeUncompressed (CacheStorageWriter.java:232)
    at com.google.cloud.tools.jib.cache.Cache.writeUncompressedLayer (Cache.java:115)
    at com.google.cloud.tools.jib.builder.steps.BuildAndCacheApplicationLayerStep.call (BuildAndCacheApplicationLayerStep.java:109)
    at com.google.cloud.tools.jib.builder.steps.BuildAndCacheApplicationLayerStep.call (BuildAndCacheApplicationLayerStep.java:37)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:125)
    at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:69)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run (TrustedListenableFutureTask.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)


Chanseok Oh

unread,
Mar 9, 2020, 10:54:47 AM3/9/20
to Jib users
Thanks for the reporting. I've created an issue on GitHub. (If you have a GitHub account, I prefer discussing on the GitHub issue, but it's okay to keep communicating here.)

To explain what's going on, Jib attempted to move the directory `/basedir/target/jib-cache/tmp/3227117988474356011` to `/basedir/target/jib-cache/layer/<some sha256 hash>`. On the same filesystem, this usually becomes a simple atomic move that doesn't involve copying. But looks like atomic move was not possible for some reason on your system, so the move operation degraded into deleting after copying. However, for another reason, the system could not delete the original directory (`/basedir/target/jib-cache/tmp/3227117988474356011`) after copying.

Is there anything special about the filesystem for `/basedir/target/jib-cache`, such as as NFS or Samba? Running `df` usually gives you an insight about filesystems.

And for testing, you can change the location of the application cache (`/basedir/target/jib-cache`) by setting the system property `jib.applicationCache`. For example, passing `-Djib.applicationCache=/some/other/cache/directory` on the command line. Worth trying different filesystems, including tmpfs (`/tmp`).

Finally, what's your Jib version?
Reply all
Reply to author
Forward
0 new messages