1

The situation is, the batch command file containing execution with omake.exe is located in an clearcase view. Calling this bat file from dos command window works quite fine, but if I call the same bat file from Jenkins job, I get following error message:

Started by user XXXXXXX
[EnvInject] - Loading node environment variables.
Building in workspace C:\app\tools\Jenkins\jobs\workspace
[workspace] $ cmd /c call C:\WINDOWS\TEMP\hudson7938450600036163921.bat

C:\app\tools\Jenkins\jobs\workspace>cleartool startview Z000000_Latest 

C:\app\tools\Jenkins\jobs\workspace>subst Y: X:\Z000000_Latest 

C:\app\tools\Jenkins\jobs\workspace>cd /d "Y:\prj_cfg" 

Y:\prj_cfg>omake Y:\source\sw\sw_main.cpp 
omake: Error: Unable to start build session for view "Z000000_Latest" - Permission denied
omake: command line: Unable to get bldcm session handle
. Stop.

Y:\prj_cfg>exit 1 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

Any one has an idea? Thanks

OISS
  • 97
  • 10

1 Answers1

0

The main reason for a difference between a failed Jenkins job and a successful batch session is the environment variable (not to mention the user might be different).

For instance, the CLEARCASE_PRIMARY_GROUP environment variable might be different (or not set at all) in the Jenkins job session, as opposed to the batch session.
Compare the result of the 'set' command in both cases to sport the differences and test which one might matter.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Its a very good advice. But I am quite new in jenkins, may i ask how can I compare them, or where can I find these enviroment variables? – OISS Feb 09 '15 at 16:12
  • @OISS simply add a build step in your Jenkins job with the word '`set`' in it. That step will display the environment variable and will allow you how Jenkins is running. – VonC Feb 09 '15 at 16:13