You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2013/01/10 04:02:24 UTC

[Bug 54397] New: Copy task fails when copying from CIFS mounted location

https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

            Bug ID: 54397
           Summary: Copy task fails when copying from CIFS mounted
                    location
           Product: Ant
           Version: 1.8.4
          Hardware: Other
                OS: AIX
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: ddesboro@us.ibm.com
    Classification: Unclassified

When using the copy task to copy files from a CFIS mount, we are seeing the
following behavior (directory contains a bunch of files with numbers as names:

fileset: Setup scanner in dir /opt/storage with patternSet{ includes: [**]
excludes: [] }
     [copy] 100 added as 100 doesn't exist.
     [copy] 16 added as 16 doesn't exist.
     [copy] 18 added as 18 doesn't exist.
     [copy] 28 added as 28 doesn't exist.
<snip>
     [copy] Copying 92 files to /opt/restore2
     [copy] Copying /opt/storage/100 to /opt/restore2/100
      [ant] Exiting /opt/backup-restore.xml.

BUILD FAILED
/opt/backup-restore-wrapper.xml:63: The following error occurred while
executing this line:
/opt/backup-restore.xml:506: Failed to copy /opt/storage/100 to
/opt/restore2/100 due to Invalid argument
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:914)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:567)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: Invalid argument
        at sun.nio.ch.FileChannelImpl.map0(Native Method)
        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:758)
        at
sun.nio.ch.FileChannelImpl.transferFromFileChannel(FileChannelImpl.java:542)
        at sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:605)
        at
org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:532)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:559)
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:899)
        ... 30 more


The task is simply:

        <copy todir="${BACKUP_STORAGE_DIR}" preservelastmodified="yes">
            <fileset dir="${STORAGE_LOCATION}"
               includes="**">
            </fileset>
        </copy>

This works fine when run against local files or NFS mounts. 

System details:

bash-4.2$ ant -version
Apache Ant(TM) version 1.8.4 compiled on May 22 2012

bash-4.2$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr12-20121025_01(SR12))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64
jvmap6460sr12-20121024_126067 (JIT enabled, AOT enabled)
J9VM - 20121024_126067
JIT  - r9_20120914_26057
GC   - 20120928_AA)
JCL  - 20121014_01

bash-4.2$ oslevel -g
6.1.0.0

bash-4.2$ instfix -i | grep AIX_ML
    All filesets for 6100-00_AIX_ML were found.
    All filesets for 6100-01_AIX_ML were found.
    All filesets for 6100-02_AIX_ML were found.
    All filesets for 6100-03_AIX_ML were found.
    All filesets for 6100-04_AIX_ML were found.

mount created with the  mkcifsmnt command

Server providing the share: 

Windows Server 2008 R2

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54397] Copy task fails when copying from CIFS mounted location

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
This is ugly.

Ant uses FileChannel#transferFrom as this is supposed to be more efficient than
the traditional shuffling of buffers between streams/channels.  It looks as if
the implementation inside the Java classlib doesn't work for certain kinds of
files.

Unfortunately I don't see how Ant could detect the situation as we cannot query
the FileChannel whether it would support transfers and the exception is an
unspecific IOException.

One option may be to add a flag that disables transferFrom altogether - which
will require changes in lots of places - I'm pondering a global system property
to avoid adding a new parameter and adding it to lots of tasks.

There may be a workaround for you as Ant will not use transferFrom if a
filterset or a filterchain exists.  You could add a filterChain that didn't
modify anything but this would very likely break binary files when copying them
(so is only an option if we are talking about text files).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54397] Copy task fails when copying from CIFS mounted location

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.9.0                       |1.9.1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54397] Copy task fails when copying from CIFS mounted location

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.8.4                       |1.9.0

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54397] Copy task fails when copying from CIFS mounted location

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

--- Comment #2 from jonny <jo...@gmail.com> ---
I am encountering similar issues when using the commons.io.FileUtils to do copy
operations via Groovy on an AIX box. plutarch is the name of my class. Perhaps
Ant relies on these?

java.io.IOException: A system call received a parameter that is not valid.
    at sun.nio.ch.FileChannelImpl.map0(Native Method)
    at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:768)
    at
sun.nio.ch.FileChannelImpl.transferFromFileChannel(FileChannelImpl.java:552)
    at sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:615)
    at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1147)
    at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1428)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1389)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1261)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1230)
    at org.apache.commons.io.FileUtils$copyDirectory.call(Unknown Source)
    at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
    at plutarch.archiveOldFilesOnSabrina(plutarch.groovy:111)
    at plutarch$archiveOldFilesOnSabrina.callCurrent(Unknown Source)
    at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
    at plutarch.run(plutarch.groovy:47)
    at
groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:257)
    at groovy.lang.GroovyShell.run(GroovyShell.java:220)
    at groovy.lang.GroovyShell.run(GroovyShell.java:150)
    at groovy.ui.GroovyMain.processOnce(GroovyMain.java:588)
    at groovy.ui.GroovyMain.run(GroovyMain.java:375)
    at groovy.ui.GroovyMain.process(GroovyMain.java:361)
    at groovy.ui.GroovyMain.processArgs(GroovyMain.java:120)
    at groovy.ui.GroovyMain.main(GroovyMain.java:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at
org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
    at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54397] Copy task fails when copying from CIFS mounted location

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |1.9.4

--- Comment #4 from Stefan Bodewig <bo...@apache.org> ---
with svn revision 1557433 Ant will log a warning and fall back to good old
Streams in a situation like this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54397] Copy task fails when copying from CIFS mounted location

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

--- Comment #1 from Davin <dd...@us.ibm.com> ---
Applied AIX patches and updated to Java7 and I could still reproduce the issue.

bash-4.2$ instfix -i | grep AIX_ML
    All filesets for 6100-00_AIX_ML were found.
    All filesets for 6100-01_AIX_ML were found.
    All filesets for 6100-02_AIX_ML were found.
    All filesets for 6100-03_AIX_ML were found.
    All filesets for 6100-04_AIX_ML were found.
    All filesets for 6100-05_AIX_ML were found.
    All filesets for 6100-06_AIX_ML were found.
    All filesets for 6100-07_AIX_ML were found.
    All filesets for 6.1.0.0_AIX_ML were found.

bash-4.2$ ./java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build pap6470sr3-20121025_01(SR3))
IBM J9 VM (build 2.6, JRE 1.7.0 AIX ppc64-64 20121024_126071 (JIT enabled, AOT
enabled)
J9VM - R26_Java726_SR3_20121024_1635_B126071
JIT  - r11.b02_20120924_26343a
GC   - R26_Java726_SR3_20121024_1635_B126071
J9CL - 20121024_126071)
JCL - 20121019_01 based on Oracle 7u6-b17

-- 
You are receiving this mail because:
You are the assignee for the bug.