1

After searching found that to run the selenium test from Jenkins we have to run the jenkins by command Java -jar jenkins.war instead of as a Service

Problem is that when running the Jenkins as a service it works fine but when running it with the command job is giving error:

FATAL: Base ClearCase failed. exit code=1
FATAL: java.io.IOException: cleartool did not return the expected exit code. 
Command line="endview -server sprint8_view_DCLLegacy", actual exit code=1
[workspace] $ "C:\Program Files (x86)\IBM\RationalSDLC\ClearCase\bin\cleartool" endview -server sprint8_view_DCLLegacy
cleartool: Error: Cannot stop view server for view "sprint8_view_DCLLegacy": Permission denied.

FATAL: Base ClearCase failed. exit code=1
java.io.IOException: cleartool did not return the expected exit code. 
Command line="endview -server sprint8_view_DCLLegacy", actual exit code=1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Akshay jain
  • 555
  • 1
  • 7
  • 22

1 Answers1

1

You need to check with which account you are running Jenkins as a service:

  • the system account
  • or a user account.

If a cleartool enview -server works in command line, but not from Jenkins running as a service, you need to make sure the service is running with the right account.

this error wont come from Jenkins running as a service but comes in command line

If it is the opposite, you could create a simple Jenkins job that would close the view you want (using a parameter).
Calling that job would end the view.

Or, in command line, use PsExec, which should launch a session using the LocalSystem acount:

C:\>psexec -i -s Powershell.exe

PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com

This will launch a new window.

PS C:\Windows\system32> whoami
nt authority\system
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • service is using local system account checked on the log on tab. – Akshay jain Jul 10 '15 at 08:53
  • @akshayjain exactly, try using a user account instead of the local system account. – VonC Jul 10 '15 at 08:54
  • this error wont come from Jenkins running as a service but comes in command line – Akshay jain Jul 10 '15 at 09:00
  • @akshayjain Ok, I have amended my answer accordingly. – VonC Jul 10 '15 at 09:02
  • when we run the Jenkins from java -jar jenkins.war that time it started from with which account?? – Akshay jain Jul 10 '15 at 09:22
  • if in both the case as a service and by the command java -jar jenkins.war start with the local system account then why it is giving error in the command option?? – Akshay jain Jul 10 '15 at 09:36
  • @akshayjain no in command line, it uses your account, not a system account – VonC Jul 10 '15 at 09:39
  • @akshayjain I have edited my answer to include a way to run a shell as LocalSystem. – VonC Jul 10 '15 at 10:34
  • I used that and jenkins started but my all jobs are gone .I already have the path of jenkins home in enviorment varaibles .Where all my jobs gone..?? – Akshay jain Jul 10 '15 at 10:50
  • @akshayjain sure: go on with Jenkins. I was just adding a way to execute the `cleartool endview -server` from command line with the LocalSystem account; – VonC Jul 10 '15 at 10:51
  • @akshayjain your question is about `cleartool endview -server` from command-line: let's solve that first. – VonC Jul 10 '15 at 10:55