Plexus Utils

working directory not quoted: unpack of tar files fail with ArchiverException: chmod exit code was: 1

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: 1.5.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven version: 2.0.7
    Java version: 1.5.0_10
    OS name: "linux" version: "2.6.9-42.7.elsmp" arch: "i386"
  • Number of attachments :
    0

Description

Using this configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- First, get tomcat from the repository and unpack it -->
<execution>
<id>unpack</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.catalina</groupId>
<artifactId>tomcat</artifactId>
<version>5.5.20</version>
<type>tar</type>
<outputDirectory>${mgmt.directory}</outputDirectory>
</artifactItem>

We get build failure with the exception:
Error:
[INFO] [dependency:unpack {execution: unpack}]
[INFO] Configured Artifact: org.apache.catalina:tomcat:5.5.20:tar
[INFO] Unpacking /tmp/maven-repo/org/apache/catalina/tomcat/5.5.20/tomcat-5.5.20.tarto
/vob/nm_acs/acs/install/target/stage/mgmt
with Includes null and excludes:null
[INFO] Expanding: /tmp/maven-repo/org/apache/catalina/tomcat/5.5.20/tomcat-5.5.20.tar into /vob/nm_acs/acs/install/target/stage/mgmt
[WARNING] -------------------------------
[WARNING] Standard error:
[WARNING] -------------------------------
[WARNING]
[WARNING] -------------------------------
[WARNING] Standard output:
[WARNING] -------------------------------
[WARNING] chmod: cannot access `/vob/nm_acs/acs/install/target/stage/mgmt/apache-tomcat-5.5.20/webapps/jsp-examples/WEB-INF/classes/org/apache/jsp/jsp2/jspattribute/shuffle_jsp.class': No such file or directory
[WARNING] -------------------------------
org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1
at org.codehaus.plexus.archiver.util.ArchiveEntryUtils.chmod(ArchiveEntryUtils.java:59)
at org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.extractFile(AbstractZipUnArchiver.java:236)
at org.codehaus.plexus.archiver.tar.TarUnArchiver.execute(TarUnArchiver.java:92)
at org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:108)
at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:266)
at org.apache.maven.plugin.dependency.fromConfiguration.UnpackMojo.unpackArtifact(UnpackMojo.java:122)
at org.apache.maven.plugin.dependency.fromConfiguration.UnpackMojo.execute(UnpackMojo.java:95)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error unpacking file: /tmp/maven-repo/org/apache/catalina/tomcat/5.5.20/tomcat-5.5.20.tar to: /vob/nm_acs/acs/install/target/stage/mgmt
org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error unpacking file: /tmp/maven-repo/org/apache/catalina/tomcat/5.5.20/tomcat-5.5.20.tar to: /vob/nm_acs/acs/install/target/stage/mgmt
org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error unpacking file: /tmp/maven-repo/org/apache/catalina/tomcat/5.5.20/tomcat-5.5.20.tar to: /vob/nm_acs/acs/install/target/stage/mgmt
org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1
at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:275)
at org.apache.maven.plugin.dependency.fromConfiguration.UnpackMojo.unpackArtifact(UnpackMojo.java:122)
at org.apache.maven.plugin.dependency.fromConfiguration.UnpackMojo.execute(UnpackMojo.java:95)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1
at org.codehaus.plexus.archiver.util.ArchiveEntryUtils.chmod(ArchiveEntryUtils.java:59)
at org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.extractFile(AbstractZipUnArchiver.java:236)
at org.codehaus.plexus.archiver.tar.TarUnArchiver.execute(TarUnArchiver.java:92)
at org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:108)
at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:266)
... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53 seconds
[INFO] Finished at: Mon Jan 28 16:40:41 IST 2008
[INFO] Final Memory: 12M/401M
[INFO] ------------------------------------------------------------------------

Issue Links

Activity

Hide
Emmanuel Lécharny added a comment -

We have the very same problem. The problem occurs only on MAC for us (Apache Directory Studio), while trying to unpack a file containing some spaves in the name :

[INFO] Expanding /Users/elecharny/.m2/repository/org/apache/directory/studio/launcher-macosx/1.1.0/launcher-macosx-1.1.0.tar.gz to /tmp/tmp10812.tar
[INFO] Expanding: /tmp/tmp10812.tar into /Users/elecharny/apacheDS/ldapstudio/studio/target/ApacheDirectoryStudio-macosx
[WARNING] -------------------------------
[WARNING] Standard error:
[WARNING] -------------------------------
[WARNING]
[WARNING] -------------------------------
[WARNING] Standard output:
[WARNING] -------------------------------
[WARNING] /bin/sh: line 1: cd: /Users/elecharny/apacheDS/ldapstudio/studio/target/ApacheDirectoryStudio-macosx/Apache: No such file or directory

[WARNING] -------------------------------
org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1
at org.codehaus.plexus.archiver.util.ArchiveEntryUtils.chmod(ArchiveEntryUtils.java:59)
at org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.extractFile(AbstractZipUnArchiver.java:236)
at org.codehaus.plexus.archiver.tar.TarUnArchiver.execute(TarUnArchiver.java:92)
at org.codehaus.plexus.archiver.tar.TarGZipUnArchiver.execute(TarGZipUnArchiver.java:76)
at org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:108)
at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:266)

The name is supposed to be :
"/Users/elecharny/apacheDS/ldapstudio/studio/target/ApacheDirectoryStudio-macosx/Apache Directory Studio.app"

I think that the spaces must be escaped before a chmod can be done.

Hope it helps ...

Show
Emmanuel Lécharny added a comment - We have the very same problem. The problem occurs only on MAC for us (Apache Directory Studio), while trying to unpack a file containing some spaves in the name : [INFO] Expanding /Users/elecharny/.m2/repository/org/apache/directory/studio/launcher-macosx/1.1.0/launcher-macosx-1.1.0.tar.gz to /tmp/tmp10812.tar [INFO] Expanding: /tmp/tmp10812.tar into /Users/elecharny/apacheDS/ldapstudio/studio/target/ApacheDirectoryStudio-macosx [WARNING] ------------------------------- [WARNING] Standard error: [WARNING] ------------------------------- [WARNING] [WARNING] ------------------------------- [WARNING] Standard output: [WARNING] ------------------------------- [WARNING] /bin/sh: line 1: cd: /Users/elecharny/apacheDS/ldapstudio/studio/target/ApacheDirectoryStudio-macosx/Apache: No such file or directory [WARNING] ------------------------------- org.codehaus.plexus.archiver.ArchiverException: chmod exit code was: 1 at org.codehaus.plexus.archiver.util.ArchiveEntryUtils.chmod(ArchiveEntryUtils.java:59) at org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.extractFile(AbstractZipUnArchiver.java:236) at org.codehaus.plexus.archiver.tar.TarUnArchiver.execute(TarUnArchiver.java:92) at org.codehaus.plexus.archiver.tar.TarGZipUnArchiver.execute(TarGZipUnArchiver.java:76) at org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:108) at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:266) The name is supposed to be : "/Users/elecharny/apacheDS/ldapstudio/studio/target/ApacheDirectoryStudio-macosx/Apache Directory Studio.app" I think that the spaces must be escaped before a chmod can be done. Hope it helps ...
Hide
Erez Nahir added a comment -

In our case, I think the issue is with internal java class:

ls /vob/nm_acs/acs/install/target/stage/mgmt/apache-tomcat-5.5.20/webapps/jsp-examples/WEB-INF/classes/org/apache/jsp/jsp2/jspattribute
jspattribute_jsp.class shuffle_jsp$shuffle_jspHelper.class

Show
Erez Nahir added a comment - In our case, I think the issue is with internal java class: ls /vob/nm_acs/acs/install/target/stage/mgmt/apache-tomcat-5.5.20/webapps/jsp-examples/WEB-INF/classes/org/apache/jsp/jsp2/jspattribute jspattribute_jsp.class shuffle_jsp$shuffle_jspHelper.class
Hide
Brian Fox added a comment -

Are the files actually unpacked? I wonder if catching this exception in the dependency plugin is a good workaround for now.

Show
Brian Fox added a comment - Are the files actually unpacked? I wonder if catching this exception in the dependency plugin is a good workaround for now.
Hide
Brian Fox added a comment -

This seems related to PLXCOMP-91 but i don't seem to have karma to link the issues.

Show
Brian Fox added a comment - This seems related to PLXCOMP-91 but i don't seem to have karma to link the issues.
Hide
Erez Nahir added a comment -

Files are unpacked, catching the exception should solve the issue on my side.

Show
Erez Nahir added a comment - Files are unpacked, catching the exception should solve the issue on my side.
Hide
Trevor Pounds added a comment -

We have the same issue with internal class file names. In our case we are just trying to unpack the sun jdk. The offending file is jdk1.50_12/demo/applets/Blink/Blink$1.class. The chmod translates this to Blink.class. I see that Blink$1.class has been unpacked but not a Blink.class. This makes me suspect the $1 is getting dropped or translated into a null string.

The error is as follows:

[WARNING] chmod: cannot access `unpack/java/jdk1.5.0_12/demo/applets/Blink/Blink.class': No such file or directory

Show
Trevor Pounds added a comment - We have the same issue with internal class file names. In our case we are just trying to unpack the sun jdk. The offending file is jdk1.50_12/demo/applets/Blink/Blink$1.class. The chmod translates this to Blink.class. I see that Blink$1.class has been unpacked but not a Blink.class. This makes me suspect the $1 is getting dropped or translated into a null string. The error is as follows: [WARNING] chmod: cannot access `unpack/java/jdk1.5.0_12/demo/applets/Blink/Blink.class': No such file or directory
Hide
John Casey added a comment -

I ran across this the other day, and fixed it.

Show
John Casey added a comment - I ran across this the other day, and fixed it.
Hide
John Casey added a comment -

nevermind. My issue centered on the use of $1 and such for anonymous inner classes, where /bin/sh was interpreting this as an argument to the present script...and choking.

quoting of working directory paths is actually an issue in plexus-utils, though.

Show
John Casey added a comment - nevermind. My issue centered on the use of $1 and such for anonymous inner classes, where /bin/sh was interpreting this as an argument to the present script...and choking. quoting of working directory paths is actually an issue in plexus-utils, though.
Hide
John Casey added a comment -

this is an issue with paths not being quoted correctly, particularly in the working directory of the Commandline and Shell logic.

Show
John Casey added a comment - this is an issue with paths not being quoted correctly, particularly in the working directory of the Commandline and Shell logic.
Hide
John Casey added a comment -

should be fixed.

Show
John Casey added a comment - should be fixed.
Hide
Manfred Moser added a comment -

What version of plexus-utils the fix in if it is released. Otherwise .. can you cut a release or at least have a latest snapshot that includes it somewhere?

Show
Manfred Moser added a comment - What version of plexus-utils the fix in if it is released. Otherwise .. can you cut a release or at least have a latest snapshot that includes it somewhere?
Hide
Herve Boutemy added a comment -

fixed in plexus-utils 1.5.1

Show
Herve Boutemy added a comment - fixed in plexus-utils 1.5.1

People

Vote (0)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: