12

Not able to restart Jenkins manually. Already tried all below ways:

  1. http://localhost:8080/safeRestart
    Error message: Jenkins cannot restart itself as currently configured.

  2. Manage Jenkins → Restart Safely Plugin.
    Error message: Jenkins cannot restart itself as currently configured.

  3. Not able to find any Jenkins Service in services.msc.

  4. Navigate to jenkins-cli directory in CMD mode

    java -jar jenkins-cli.jar -s http://[jenkins-server]/ restart
    

    See below screenshot for error message:

    x

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Rodger Nadal
  • 309
  • 2
  • 8
  • 21
  • 2
    The URI in your 4th attempt is malformed. Change `http://http://localhost:8080/jenkins/` to `http://localhost:8080/jenkins/`. – Ansgar Wiechers May 25 '17 at 07:28
  • @AnsgarWiechers thanks for pointing.. I tried with correct command and still not working for me. ERROR:Unexpected exception occurred while performing restart command. hudson.lifecycle.RestartNotSupportedException: Default Windows lifecycle does not support restart. – Rodger Nadal May 25 '17 at 07:55
  • Define "still not working". – Ansgar Wiechers May 25 '17 at 07:56
  • Interesting !!! Generally, with your option one, it restarts... – Nikhil Jul 20 '18 at 14:57

4 Answers4

14

Use command line to stop and start

net stop jenkins
net start jenkins
Hoang
  • 829
  • 11
  • 18
4

Simply just do one thing.To restart Jenkins manually, you can use either of the following commands on Windows platform.

  • Clean the "AppData\Local\Temp" folder.
  • In search of windows type %temp%. then clean the folder.

Then try restarting Jenkins.

  • use java -jar jenkins.war --httpPort=8080 in cmd fo windows.
  • otherwise change the Port number.
  • java -jar jenkins.war --httpPort=8090

It worked for me!

Saikat
  • 14,222
  • 20
  • 104
  • 125
Tushar Hanwate
  • 121
  • 1
  • 1
  • 6
2

1) Click "Start" button 2) Find and right-click Command Prompt. Then choose Run as administrator. 3) Execute the command "net stop jenkins" and "net start jenkins"

This will definitely works.

nk07
  • 161
  • 3
  • 12
0

On windows, goto Run-> type "cmd" and navigate to your jenkins installation path. Then perform the following list of commands:

To stop the jenkins:

jenkins.exe stop

To start the jenkins:

jenkins.exe start

To restart the jenkins:

jenkins.exe restart

Note:if you get an error then run the command as administrator..

Hope this will be helpful..

nk07
  • 161
  • 3
  • 12
  • nope, it gave an Access Denied error. Following is the stacktrace 2019-01-08 13:48:58,071 INFO - Restarting the service with id 'Jenkins' 2019-01-08 13:48:58,102 FATAL - WMI Operation failure: AccessDenied WMI.WmiException: AccessDenied at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result) at WMI.WmiRoot.InstanceHandler.Invoke(Object proxy, MethodInfo method – sunny arya Jan 08 '19 at 00:50