1

I am using Jenkins to add files to a VOB in ClearCase via

cleartool checkout dir
cd dir 
cleartool mkelem foo.txt 
cd ..
cleartool checkin dir

but ClearCase outputs

cleartool: Error: Can't create object with group (domain \ users) that is not in the VOB's group list. cleartool: Error: Unable to create element "foo.txt".

However, the service account that Jenkins uses is added to the ClearCase admin group, so it should be able to add files to source control. My personal account is added to the same group, and is able to add files to source control. Is this an issue with Jenkins having to use a service account?

2 Answers2

0

the service account that Jenkins uses is added to the ClearCase admin group,

That is not enough:

  • its CLEARCASE_PRIMARY_GROUP environment variable needs to be set to a group which is part of the primary of secondary groups of the Vob involved with those files.
    (Check the section "environment variables" of one of the Job execution result page)

  • The ClearCase view used (snapshot or dynamic) needs to be properly protected.

That is:

cd /path/to/my/view 
cleartool lsview -l -full -pro -cview

A fix_prot on the view might be necessary: see an example of such a fix_prot in "While creating a view I got this error; cleartool: Error: Failed to record hostname in storage directory"

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So would setting CLEARCASE_PRIMARY_GROUP to the group which can add and modify files in that VOB fix the issue? – Christian Bouwense Jun 28 '17 at 18:46
  • If the view is not "properly protected" *DO NOT* use "fix_prot" to fix it. Create a new one with the permissions and groups you want. fix_prot only coincidentally (and partially) works on views. You can wind up removing the additional groups list which could impact your ability to read files in the view. If you can create files, and get this error on checking in, the view has the permissions it needs anyway. – Brian Cowan Jun 29 '17 at 13:56
  • @BrianCowan Darned... I used fix_prot for years without issue (and without realizing the fool I was ;) ). So much so I had my aliases ready: https://stackoverflow.com/a/29844072/6309 (fp -rec and fp -root, in that order) – VonC Jun 29 '17 at 13:58
  • Is there any way to see the group list for a VOB? I want to check because there is some strange behavior going on once I set the environment variable. I do set CLEARCASE_PRIMARY_GROUP=SSDNJ_ClearCase_Admins but the value of CLEARCASE_PRIMARY_GROUP at runtime is EXL_SSDNJ_ClearCase_Admins – Christian Bouwense Jun 29 '17 at 17:25
  • @ChristianBouwense I mentioned in https://stackoverflow.com/a/44638084/6309 `cleartool describe -eacl vob:\vobtag \vobtag`, but first (https://www.ibm.com/support/knowledgecenter/en/SSSH27_8.0.1/com.ibm.rational.clearcase.cc_ref.doc/topics/ct_describe.htm), use `cleartool describe -l vob:\aVobTag` first – VonC Jun 29 '17 at 19:58
0

A note on adding files to source control.

To successfully add files to source control, the adding user's primary group must be in the VOB's group list. On Unix, this is a hard-and-fast requirement. On Windows, ClearCase may scan YOUR and the VOBs group list and find ANY group in your list that is in the VOB's group list. The problem is that this means you cannot explicitly say what group will be used at any given time.

Please also note that this group mismatch can also occur during DO promotion. If the primary group assigned to a sharable DO at the time of creation (which doesn't have to be in the VOB's group list because the object isn't in a VOB -- yet) is not in the VOB's group list when another build tries to reuse it (winkin), the DO promotion and winkin will fail with the same message.

Brian Cowan
  • 1,048
  • 6
  • 7