unable to start jenkins after editing matrix based security

13,689

It looks like you locked yourself out. Here are the lock picker instructions:

Securing Jenkins

...

Disabling Security

One may accidentally set up security realm / authorization in such a way that you may no longer able to reconfigure Jenkins.

When this happens, you can fix this by the following steps:

  1. Stop Jenkins (the easiest way to do this is to stopthe servlet container.)
  2. Go to $JENKINS_HOME in the file system and find config.xml file.
  3. Open this file in the editor.
  4. Look for the <useSecurity>true</useSecurity> element in this file.
  5. Replace true with false
  6. Remove the elements authorizationStrategy and securityRealm
  7. Start Jenkins
  8. When Jenkins comes back, it will be in an unsecured mode where everyone gets full access to the system.

If this is still not working, trying renaming or deleting config.xml.

Share:
13,689
Karthikeyan
Author by

Karthikeyan

GitHub : https://github.com/javapriyan LinkedIn : http://www.linkedin.com/pub/karthikeyan-annamalai/3a/300/aa

Updated on June 25, 2022

Comments

  • Karthikeyan
    Karthikeyan almost 2 years

    I deployed latest jenkins war in tomcatrunning on my W$7 machine.During my first log in i configured something in matrix based security as explained here.After adding a user in the matrix, ia m unable to load the jenkins. The following error stack is shown. For complete stack trace please visit here..

    Now, When i go to the login page, i could see the login form. Do we have any default login to proceed ?

    Note: as described in that article i don't see create an account tab in the login page. Hence i am unable to proceed.

    Stack trace :

    hudson.security.AccessDeniedException2: anonymous is missing the Overall/Read permission
    at hudson.security.ACL.checkPermission(ACL.java:54)
    at hudson.model.Node.checkPermission(Node.java:418)
    at jenkins.model.Jenkins.getTarget(Jenkins.java:3680)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:612)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:587)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:218)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
    

    Edit:

    I have also, redeployed the war.The issue was still there.

    So then, i have downloaded the fresh war file from the JenKins site and deployed in the tomcat of xampp. When ever, i navigate to the jenkins app , the Java SE crashes.

  • rogue lad
    rogue lad about 10 years
    I couldn't found config.xml in my jenkins [v1.550].
  • Dhanasekaran Anbalagan
    Dhanasekaran Anbalagan about 10 years
    I am in ubuntu 12.04 machine.root@bugcy013:~# su - jenkins jenkins@bugcy013:~$ pwd /var/lib/jenkins jenkins@bugcy013:~$ cat /etc/passwd|grep jenkins jenkins:x:123:65534:Jenkins,,,:/var/lib/jenkins:/bin/bash jenkins@bugcy013:~$
  • Dhanasekaran Anbalagan
    Dhanasekaran Anbalagan about 10 years
    Stop Jenkins (the easiest way to do this is to kill the servlet container.) Go to $JENKINS_HOME in the file system and find config.xml file. Open this file in the editor. Look for the <useSecurity>true</useSecurity> element in this file. Replace true with false Remove the elements authorizationStrategy and securityRealm Start Jenkins
  • Mustafa
    Mustafa over 8 years
    i am on ubuntu and jenkins is started successfuly but $JENKINS_HOME is empty . i tried echo $JENKiNS_HOME. empty
  • Ondrej Rafaj
    Ondrej Rafaj about 8 years
    sudo find / -name "config.xml"
  • Gerold Broser
    Gerold Broser almost 7 years
    Agreed, the accepted answer is link-only, but that's basically just C&P of the last section of the Jenkins page linked there about three years before.
  • Gerold Broser
    Gerold Broser almost 7 years
    This is only the last resort (see the accepted answer) since you will reset all other configurations, too, which can be quite a lot.
  • Gerold Broser
    Gerold Broser almost 7 years
    I guessed that it worked for you (otherwise you wouldn't put it as an answer here, hopefully ;) but that's not the point, which is that you gave an answer three years after and with the information of the accepted one rather than updating that answer which I did right now.
  • Gyuhyeon Lee
    Gyuhyeon Lee about 6 years
    I was getting java.lang.NullPointerException because I locked myself out(...?). I think leaving the security realm elements intact while setting security to false caused that problem. Deleting the elements made it work again, thanks.
  • Jesús Sánchez
    Jesús Sánchez almost 5 years
    Thanks, i used windows and when i changed the config.xml it's works.