[ https://issues.apache.org/jira/browse/MSHARED-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879246#comment-17879246 ]
James Nord edited comment on MSHARED-1153 at 9/4/24 2:13 PM: ------------------------------------------------------------- 2 years later and I am hitting this issue again (although possibly a different reproducer). {noformat} Caused by: java.nio.file.FileSystemException: /mnt/d/source/github/jenkinsci/acceptance-test-harness/target/classes/ath-container/Dockerfile: Operation not permitted at sun.nio.fs.UnixException.translateToIOException (UnixException.java:100) at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:106) at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111) at sun.nio.fs.UnixFileAttributeViews$Posix.setMode (UnixFileAttributeViews.java:277) at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions (UnixFileAttributeViews.java:299) at java.nio.file.Files.setPosixFilePermissions (Files.java:2169) at org.apache.maven.shared.filtering.FilteringUtils.copyFilePermissions (FilteringUtils.java:410) at org.apache.maven.shared.filtering.FilteringUtils.copyFile (FilteringUtils.java:394) {noformat} chmod reports {noformat} chmod: changing permissions of '/mnt/d/source/github/jenkinsci/acceptance-test-harness/target/classes/ath-container/Dockerfile': Operation not permitted {noformat} {{/mnt/d}} is a mount of windows `D` drive in WSL. The mount is then volume-mapped ({{{}-v /mnt/d/:/mnt/d{}}}) in WSL into a docker container. I can run {{chmod o-w /mnt/d/source/github/jenkinsci/acceptance-test-harness/target/classes/ath-container/Dockerfile}} *outside* of the docker container. this command returned an exit code of `0` but does not actually change the attributes (because its not a posix filesytem underneath). So there is something about the container, or how docker desktop is mounting the mapped volume that triggers the issue. Maven 3.9.9 Java 21.0.4, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 maven-resources-plugin 3.2.2 was (Author: jnord_cbs): 2 years later and I am hitting this issue again (although possibly a different reproducer). {noformat} Caused by: java.nio.file.FileSystemException: /mnt/d/source/github/jenkinsci/acceptance-test-harness/target/classes/ath-container/Dockerfile: Operation not permitted at sun.nio.fs.UnixException.translateToIOException (UnixException.java:100) at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:106) at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111) at sun.nio.fs.UnixFileAttributeViews$Posix.setMode (UnixFileAttributeViews.java:277) at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions (UnixFileAttributeViews.java:299) at java.nio.file.Files.setPosixFilePermissions (Files.java:2169) at org.apache.maven.shared.filtering.FilteringUtils.copyFilePermissions (FilteringUtils.java:410) at org.apache.maven.shared.filtering.FilteringUtils.copyFile (FilteringUtils.java:394) {noformat} chmod reports {noformat} chmod: changing permissions of '/mnt/d/source/github/jenkinsci/acceptance-test-harness/target/classes/ath-container/Dockerfile': Operation not permitted {noformat} {{/mnt/d}} is a mount of windows `D` drive in WSL. The mount is then volume-mapped ({{{}-v /mnt/d/:/mnt/d{}}}) in WSL into a docker container. I can run {{chmod o-w /mnt/d/source/github/jenkinsci/acceptance-test-harness/target/classes/ath-container/Dockerfile}} *outside* of the docker container. this command returned an exit code of `0` but does not actually change the attributes (because its not a posix filesytem underneath). So there is something about the container, or how docker is mounting it triggers the issue. Maven 3.9.9 Java 21.0.4, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 maven-resources-plugin 3.2.2 > FilteringUtils makes incorrect assumption about filesystem > ---------------------------------------------------------- > > Key: MSHARED-1153 > URL: https://issues.apache.org/jira/browse/MSHARED-1153 > Project: Maven Shared Components > Issue Type: Bug > Components: maven-filtering > Reporter: James Nord > Priority: Blocker > > when copying files using filtering during a project build the build can fail > with the following exception due to an incorrect assumption in > [FilteringUtils.java#L474-L489|https://github.com/apache/maven-filtering/blob/456b03a9510f1e64e457f393a4e04cbeeebd9538/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java#L474-L489] > The filesystem in use may present a posix view (ie it is a mounted > filesystem) but itself may not support setting posix attributes. > This is common when using docker on windows and mounting windows directory > into the container. > this then causes the following exception : > {noformat} > Caused by: org.apache.maven.shared.filtering.MavenFilteringException: copying > /home/ath-user/code/src/main/resources/ath-container/Dockerfile to > /home/ath-user/code/target/classes/ath-container/Dockerfile failed with > FileSystemException: > /home/ath-user/code/target/classes/ath-container/Dockerfile: Operation not > permitted > at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile > (DefaultMavenFileFilter.java:118) > at > org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources > (DefaultMavenResourcesFiltering.java:277) > at org.apache.maven.plugins.resources.ResourcesMojo.execute > (ResourcesMojo.java:356) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:137) > at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 > (MojoExecutor.java:370) > at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute > (MojoExecutor.java:351) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:215) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:171) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:163) > 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:294) > 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:960) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62) > at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke (Method.java:566) > 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.FileSystemException: > /home/ath-user/code/target/classes/ath-container/Dockerfile: Operation not > permitted > at sun.nio.fs.UnixException.translateToIOException > (UnixException.java:100) > at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111) > at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:116) > at sun.nio.fs.UnixFileAttributeViews$Posix.setMode > (UnixFileAttributeViews.java:254) > at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions > (UnixFileAttributeViews.java:276) > at java.nio.file.Files.setPosixFilePermissions (Files.java:2080) > at org.apache.maven.shared.filtering.FilteringUtils.copyFilePermissions > (FilteringUtils.java:477) > at org.apache.maven.shared.filtering.FilteringUtils.copyFile > (FilteringUtils.java:457) > at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile > (DefaultMavenFileFilter.java:110) > at > org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources > (DefaultMavenResourcesFiltering.java:277) > at org.apache.maven.plugins.resources.ResourcesMojo.execute > (ResourcesMojo.java:356) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:137) > at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 > (MojoExecutor.java:370) > at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute > (MojoExecutor.java:351) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:215) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:171) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:163) > 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:294) > 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:960) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) > at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62) > at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke (Method.java:566) > 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) > {noformat} > Given the code ignores setting attributes if it can not due to an > UnsupportedOperation (e.g. the filesystem is not even posix capable) it > should do the same (for the FileFileSystemException) > > java 11.0.16.1 / WIndows 11 / Docker Desktop 4.8.2 (79419). > Maven 3.8.6 / maven-resources-plugin 3.3.0 -- This message was sent by Atlassian Jira (v8.20.10#820010)