java.io.IOException: Cannot run program "chmod": java.io.IOException

967 views
Skip to first unread message

Ganesh MN

unread,
May 7, 2018, 7:03:57 AM5/7/18
to Jenkins Users

Hi,

I am running ant task to change permission of files form Jenkins tool. But, I am getting following exception.
Can someone please help me to resolve this issue.  Waiting to here form you guys.

ant task:

       <target name="test">
<echo message="--changing filepermission--"/>
<chmod perm="ugo+rx">
<fileset dir="/home/quoteapp/test2/">     
                             <include name="test.txt" />
                      </fileset>
</chmod>
</target>


console output:

Execute failed: java.io.IOException: Cannot run program "chmod": java.io.IOException: error=2, No such file or directory
16:26:24 	at org.apache.tools.ant.taskdefs.Chmod.execute(Chmod.java:183)
16:26:24 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
16:26:24 	at org.apache.tools.ant.Task.perform(Task.java:364)
16:26:24 	at org.apache.tools.ant.Target.execute(Target.java:341)
16:26:24 	at org.apache.tools.ant.Target.performTasks(Target.java:369)
16:26:24 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
16:26:24 	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
16:26:24 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
16:26:24 	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
16:26:24 	at org.apache.tools.ant.Main.runBuild(Main.java:668)
16:26:24 	at org.apache.tools.ant.Main.startAnt(Main.java:187)
16:26:24 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
16:26:24 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)



Thanks,
Ganesha

Mark Waite

unread,
May 7, 2018, 9:07:39 AM5/7/18
to jenkins...@googlegroups.com
Are you running on Windows?  There is no chmod on windows.  The Windows file system permission system is different than the Unix file system permission system.

If you're running on a Unix variant (Linux, macOS, FreeBSD, Solaris, AIX, OpenBSD, hp-ux, etc.), is the chmod command in the PATH of the ant process?

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/24a9930d-3751-4b20-a026-25d5fc1a9a98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages