3

I'm working on an automatic build using Jenkins and ClearCase and I have a problem. I wrote a batch script to create a view in ClearCase using the cleartool command mkview.

When I execute the script by clicking on it, everything works, the view is created in ClearCase. But when I launch the script via Jenkins, I have the following errors :

C:\Program Files\Jenkins\workspace\JenkinsLecon1>
"C:\Program Files\IBM\RationalSDLC\ClearCase\bin\cleartool.exe" 
  mkview -sna -tag AUTOBUILD_VIEW_TEST1_CFW_INFRA_V5.10_Dev -str CFW_INFRA_V5.10_Dev@\projects -host sasla15001 -hpath d:\ClearCase_Storage\views\DOM3\268875\ -gpath \\sasla15001\ccstg_d\views\DOM3\268875\ CFW_INFRA_V5.10_Dev  
Selected Server Storage Location "sasla15001_ccstg_d_views". 

cleartool: Error: unable to set access control list for \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws: Accès refusé. 
cleartool: Error: protection on \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws is out-of-synch with identity.sd and groups.sd  
cleartool: Error: Failed to set identity on view: Permission denied 
cleartool: Error: unable to set access control list for \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws: Accès refusé. 
cleartool: Error: \\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws:
 Permission denied 
cleartool: Error: Unable to create view "\\sasla15001\ccstg_d\views\AUTORITE+NT\SYSTEM\CFW_INFRA_V5.10_Dev.22.vws".

I pretty sure that the error come from an access right problem.
But I did not find an mkview option like -user or something like that to user my clearcase user account.

I hop that someone had the same problem and solve it or just someone who can help me!

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Bastien
  • 158
  • 1
  • 11
  • I'd check the user that Jenkins is running as, and ensure Jenkins has enough permissions to write to the directories you're requesting. Also it may require elevated permissions through UAC, which is hard to obtain because of Jenkins nature. – Steven V Apr 29 '13 at 18:17

2 Answers2

2

See for instance the Error: unable to set access control list for : Access is denied

The cause of this problem relates to restrictive permissions on either the view share or directory to which the view is being created.

Make sure who (i.e. which account) is executing those commands when run by Jenkins (is it the local system account?). As the OP Bastien mentions, running with elevated privileges is key.

Make also sure of the CLEARCASE_PRIMARY_GROUP environment variable value at the time of the Jenkins job.
It must be set to the group of the vob you want to access (or one of its secondary group).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I think the account who execute those commands is the local system account cause I created an account in jenkins with my local system one. I cannot echo the CLEARCASE_PRIMARY_GROUP neither USERNAME I don't know why! – Bastien Apr 29 '13 at 19:04
  • @Bastien that must be why https://wiki.jenkins-ci.org/display/JENKINS/ClearCase+UCM+Plugin recommends running "Jenkins service under a valid ClearCase account" – VonC Apr 29 '13 at 19:38
  • Thanks a lot I will try to connect jenkins in a good clearcase account – Bastien Apr 29 '13 at 20:10
2

For those who have the same problem, the solution is start Jenkins as administrator. To do this :

1) open a prompt command as administrator

start/accessories/

Then right click on prompt command and choose start as

2) go to Jenkins directory

cd /D C:\Program Files\Jenkins

3) start Jenkins Server

java -jar jenkins.war --httpPort=8081 not 8080

wait until the sever is running this line will appear INFO:Jenkins is fully up and running

now the Jenkins server is running as administrator

4)open your web browser and go to

http ://localhost:8081

5) create your job!!!

to know where is the workspace just create a new batch script add the command line

cd

save and build the job. Next go to the console and just read the path

Bastien
  • 158
  • 1
  • 11
  • Interesting to know, and that adds to my answer below. Good feedback. +1 – VonC May 01 '13 at 20:13
  • Thanks, it was very difficult to find the answer for me and I think that I am not the only one to spend lot of hours on it! I hope that other people will not spend to much time to do this thing – Bastien May 01 '13 at 20:19