Issue with sshexec and 1.10.7

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with sshexec and 1.10.7

Arnold, Thomas L. (LARC-D321)[LITES II]
I'm having an issue with 1.10.7.  This behavior doesn't exist in 1.10.6.

Sample build.xml :
<project name="MyProject" default="init" basedir=".">
  <description>
    simple example build file
  </description>
  <!-- set global properties for this build -->
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist" location="dist"/>

  <target name="init">
        <sshexec host="Server1" username="User" keyfile="${user.home}/.ssh/id_rsa"
                 command="ssh -o ConnectTimeout=180 -o ConnectionAttempts=20 -o BatchMode=yes  'ssh Server2 -o ConnectTimeout=180 -o ConnectionAttempts=20 -o BatchMode=yes &quot;echo OK&quot;' 2&gt;&amp;1 | tail -1"
                 output="/home/user/anthell/CheckHost-Server1.txt" failonerror="true" append="true" verbose="false" suppresssystemout="false"/>
  </target>

</project>

Running this should leave me with a file CheckHost-Server1.txt containing "OK", instead it fails creating the file:
BUILD FAILED
/home/user/anthell/build.xml:13: java.nio.file.NoSuchFileException: /home/user/anthell/CheckHost-Server1.txt
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)

If I touch /home/user/anthell/CheckHost-Server1.txt before running, it works fine and the file contains OK as expected.

I also just grabbed and tried 1.10.8alpha #1137 and get the same behavior but as mentioned 1.10.6 works as expected.  Before building I ran fetch.xml to get all the optional libraries to make certain they were up to date.

Any insight is appreciated.

Thanks.

  -Tom

--
Tom Arnold

System Administrator
SAIC | LITES II Contract | NASA Langley Research Center


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Issue with sshexec and 1.10.7

Stefan Bodewig
On 2019-10-17, Arnold, Thomas L. (LARC-D321)[LITES II] wrote:

> I'm having an issue with 1.10.7.  This behavior doesn't exist in 1.10.6.

>         <sshexec host="Server1" username="User" keyfile="${user.home}/.ssh/id_rsa"
>                  output="/home/user/anthell/CheckHost-Server1.txt" failonerror="true" append="true" verbose="false" suppresssystemout="false"/>

> Running this should leave me with a file CheckHost-Server1.txt containing "OK", instead it fails creating the file:
> BUILD FAILED
> /home/user/anthell/build.xml:13: java.nio.file.NoSuchFileException: /home/user/anthell/CheckHost-Server1.txt

> If I touch /home/user/anthell/CheckHost-Server1.txt before running, it works fine and the file contains OK as expected.

Sounds like a bug, and most likely it is my fault.

https://github.com/apache/ant/commit/e3eb039ab638735390b3eff361ae06654f95b03c#diff-bb49f6b85622e35296971c8d0f10284a

looks like the culprit and I should have thrown in
StandardOpenOption.CREATE in addition to APPEND.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Issue with sshexec and 1.10.7

Stefan Bodewig
On 2019-10-17, Stefan Bodewig wrote:

> On 2019-10-17, Arnold, Thomas L. (LARC-D321)[LITES II] wrote:

>> I'm having an issue with 1.10.7.  This behavior doesn't exist in 1.10.6.

>>         <sshexec host="Server1" username="User" keyfile="${user.home}/.ssh/id_rsa"
>>                  output="/home/user/anthell/CheckHost-Server1.txt" failonerror="true" append="true" verbose="false" suppresssystemout="false"/>

>> Running this should leave me with a file CheckHost-Server1.txt containing "OK", instead it fails creating the file:
>> BUILD FAILED
>> /home/user/anthell/build.xml:13: java.nio.file.NoSuchFileException: /home/user/anthell/CheckHost-Server1.txt

>> If I touch /home/user/anthell/CheckHost-Server1.txt before running, it works fine and the file contains OK as expected.

> Sounds like a bug, and most likely it is my fault.

> https://github.com/apache/ant/commit/e3eb039ab638735390b3eff361ae06654f95b03c#diff-bb49f6b85622e35296971c8d0f10284a

> looks like the culprit and I should have thrown in
> StandardOpenOption.CREATE in addition to APPEND.

Should be fixed with
https://github.com/apache/ant/commit/8511719cf38cfe9be3c000e89d448f7f13f49cba#diff-bb49f6b85622e35296971c8d0f10284a
- will be fixed in 1.10.8.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Issue with sshexec and 1.10.7

Arnold, Thomas L. (LARC-D321)[LITES II]
In reply to this post by Arnold, Thomas L. (LARC-D321)[LITES II]
On 2019-10-17, Stefan Bodewig wrote:

> Should be fixed with https://github.com/apache/ant/commit/8511719cf38cfe9be3c000e89d448f7f13f49cba#diff-bb49f6b85622e35296971c8d0f10284a - will be fixed in 1.10.8.

Confirmed.  I grabbed the updated SSHexec.java, stuck it into 1.10.7 and rebuilt and it behaves as expected now.

Thanks!

  -Tom

--
Tom Arnold

System Administrator
SAIC | LITES II Contract | NASA Langley Research Center

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Issue with sshexec and 1.10.7

Stefan Bodewig
On 2019-10-17, Arnold, Thomas L. (LARC-D321)[LITES II] wrote:

> On 2019-10-17, Stefan Bodewig wrote:

>> Should be fixed with https://github.com/apache/ant/commit/8511719cf38cfe9be3c000e89d448f7f13f49cba#diff-bb49f6b85622e35296971c8d0f10284a - will be fixed in 1.10.8.

> Confirmed.  I grabbed the updated SSHexec.java, stuck it into 1.10.7 and rebuilt and it behaves as expected now.

Great! Thank you for verifying the fix

       Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]