It's all about the answers!

Ask a question

Jazz Build Permissons error on LInux build machine


David Beange (111359101) | asked Dec 08 '14, 7:03 a.m.
edited Dec 08 '14, 7:27 a.m.
Using RTC 4.0.6

Executing a JAZZ Command line build using a Linux build machine.
The JBE is running. We logged onto the build machine as a normal user then did "su -" entered the root password and then started the build engine.
The User being used to execute the JBE has the Build System Licence allocated.

When the build executed it fails with a permissions error as below.

2014-12-08 11:45:10 [Jazz build engine] running on host: RTSLINUX.ibm.com
2014-12-08 11:45:10 [Jazz build engine] Should build occur?
2014-12-08 11:45:10 [Jazz build engine] Yes: Always build a user initiated request.
2014-12-08 11:45:10 [Jazz build engine] Invoking pre-build participant "com.ibm.team.build.jazzscm"
2014-12-08 11:45:11 [Jazz build engine] Accepting changes into workspace "CMD Stream Workspace" ...
2014-12-08 11:45:12 [Jazz build engine] Fetching files to fetch destination "/data/workspace/Build" ...
2014-12-08 11:46:47 [Jazz build engine] Invoking build participant "com.ibm.team.build.cmdline"
java.io.IOException: Cannot run program "/data/workspace/Build/Build_Files/wcbd-ant" (in directory "/data/workspace/Build/Build_Files"): java.io.IOException: error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.execute(CommandLineBuildParticipant.java:312)
    at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.build(CommandLineBuildParticipant.java:108)
    at com.ibm.team.build.internal.engine.BuildLoop.invokeBuildParticipants(BuildLoop.java:917)
    at com.ibm.team.build.internal.engine.BuildLoop$2.run(BuildLoop.java:699)
    at java.lang.Thread.run(Thread.java:736)
Caused by: java.io.IOException: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:252)
    at java.lang.ProcessImpl.start(ProcessImpl.java:101)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 5 more

The Load Directory defined in the Build Definition is /data/workspace/Build
The permissions on the Build Machine are -


 Any guidance is most appreciated.


Comments
sam detweiler commented Dec 08 '14, 8:03 a.m.

could you post the permissions for the file /data/workspace/Build/Build_Files/wcbd-ant
looks like you left those off of your prior post

also be nice to confirm the user at the time
is that command in a script? if so, can u add the whois command in front of this command?


David Beange commented Dec 08 '14, 8:27 a.m.

The user that was used to execute the JBE is also the same user who requested the Team Build. This user is also a member of the project area and has an allocated roll which has all the Build Permissions selected.

Permissions for wcbd-ant are "-rw-r--r--." and root root.

If this is not everything just shout,


sam detweiler commented Dec 08 '14, 8:36 a.m.

there is no execute flag, so you WILL get permission to execute denied.
being root cannot override that.

Cannot run program "/data/workspace/Build/Build_Files/wcbd-ant" (in directory "/data/workspace/Build/Build_Files"): java.io.IOException: error=13, Permission denied


David Beange commented Dec 08 '14, 8:39 a.m.

Ah. Ok what should the permissions be set as?

Thanks

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Dec 08 '14, 8:44 a.m.
edited Dec 08 '14, 8:45 a.m.
I don't know exactly how you would want to set the permissions, but one permission group must have eXecute set
you would use the chmod command to set the permissions. 744  would give root (the owner) permission to reade/write and execute , and all others just read

Basic File Permissions

Permission Groups

Each file and directory has three user based permission groups:

  • owner - The Owner permissions apply only the owner of the file or directory, they will not impact the actions of other users.
  • group - The Group permissions apply only to the group that has been assigned to the file or directory, they will not effect the actions of other users.
  • all users - The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the most.

Permission Types

Each file or directory has three basic permission types:

  • read - The Read permission refers to a user's capability to read the contents of the file.
  • write - The Write permissions refer to a user's capability to write or modify a file or directory.
  • execute - The Execute permission affects a user's capability to execute a file or view the contents of a directory.

Viewing the Permissions


David Beange selected this answer as the correct answer

Comments
sam detweiler commented Dec 08 '14, 9:29 a.m.

if that pgm (/wcbd-ant) is extracted from the source mgmt system, the permissions will be lost. (least they were for me).. so you would have to add that call to chmod as part of the build process.


David Beange commented Dec 08 '14, 10:27 a.m.

Hi Sam

The execute permissions resolved the issues. Thanks.
I was just wondering how to solve it from the outset. So having an initial step to set the permissions is the best you have found i presume? Is that as a pre-build step or how have you done it?


sam detweiler commented Dec 08 '14, 10:46 a.m. | edited Dec 08 '14, 10:46 a.m.

 I changed to use ant with a build.xml that executed the chmod, then my script. 


On another job, I used tar to hold my local executables with their permissions set. Then did an untar before executing

Most I switched to Jenkins build engine with the RTC pligin so I can easily create these extra steps

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.