Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins failed to start - Verify that you have sufficient privileges to start system services

When installing Jenkins (LTS) on windows 10 via the installer, after choosing the JDK folder - an error pops when the service is trying to start.

The error reads: "Jenkins failed to start - Verify that you have sufficient privileges to start system services"

enter image description here

Let me make it clear that I DO have sufficient privileges, yet something is not working.

I tried many different suggestions to fix this issue, and read many posts but none helped. Also, a lot of these posts are getting old and I'm not sure how relevant they are these days.

I found a way to fix this issue, and I'll post it as a suggested answer. This could also work for other installers, but it was only tested with the Jenkins installer.

However, if anyone knows a better way to fix this - please share it with us.

Hope this method will help many people!

like image 561
Oron Werner Avatar asked Oct 11 '20 20:10

Oron Werner


People also ask

How do I verify that I have sufficient privileges to install system services?

Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies >User Rights Assignment. In the details pane, double-click Log on as a service. Click Add User or Group… and add the account to the list of accounts that have the Log on as a service right.

Can't start Jenkins service?

One of the most common reasons why Jenkins server can't start in Windows computers is because the version of the Java language was updated after the last shutdown of Jenkins server.

How do I install Jenkins on Windows 10?

Download and Install JenkinsDownload Jenkins. Under LTS, click on windows. After the file is downloaded, unzip it. Click on the folder and install it.


1 Answers

Important: If you retried the installation too many times, skip down to "Option 2". The local user account that runs Jenkins may be locked. You will need to unlock that account before attempting either fix below.


This is how I fixed the problem.

Option 1: Re-enter credentials for jenkins user

Please read it all before executing and follow the steps in order:

  1. Delete any Jenkins installation leftovers you currently have
  2. Start the installation process, input your credentials when asked, and continue with the on-screen instructions (including choosing the JDK folder) up until the point where the error is raised.
  3. When the error is raised, >>> DO NOT DO ANYTHING! <<< leave it as it is shown in my question
  4. Now (and only now), open "Services"
  5. Search for the "Jenkins" service. It should be set to "Automatic", but it might be "Disabled" enter image description here
  6. Open the "Jenkins" properties, and go to the "Log On" tab enter image description here
  7. Make sure you choose the "This account" radio button, delete the account name and password fields, and enter them AGAIN
  8. Click "Apply"
  9. Go back to the installer and click "Retry"

If everything is according to plan - The installation will now continue without a problem.

This method was tested on a local and VM / AWS computer and worked!

If you still encounter a problem, try changing the startup in step 5 to "Automatic" and make sure you only open "Services" on step 4. "Services" will not update while it is open.

Option 2: Unlock jenkins user account and manually start service

If you encounter the "Service 'Jenkins' failed to start" error too many times, the account on your computer that should run Jenkins will become locked. You will need to unlock that local account first. Keep the Jenkins installation window open with the error message, and then perform the following steps:

  1. Open the "Local Users and Groups" application.
  2. Go into the "Users" folder.
  3. Right-click on the user who will run the Jenkins service, and click "Properties".
  4. Uncheck "Account is locked out". And while you are at it, make sure "Account is disabled" is unchecked as well.
  5. Click OK.
  6. Open the "Services" app on your computer.
  7. Make sure the Jenkins service is set to start automatically.
  8. Right-click the Jenkins service and click "Start". The service should start successfully.
  9. Switch back to the Jenkins installation window with the "insufficient privileges" message still showing.
  10. Click the "Retry" button in the "insufficient privileges" message box. The installer should recognize that the Jenkins service has started.

You should be able to finish the installation.

like image 185
Oron Werner Avatar answered Oct 24 '22 17:10

Oron Werner