Skip to end of metadata
Go to start of metadata

13 Comments

  1. Actually, in current versions, you should replace whatever you have in your config.xml with the following:

    <useSecurity>true</useSecurity>
    <authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/>
    <securityRealm class="hudson.security.SecurityRealm$None"/>
    
    1. Yes, that is important. I did the above and was being forwarded to http://localhost:8080/securityRealm/commenceLogin?from=%2F, with a screen that read 

      StatusCode:404
      Exception: 
      Stacktrace:
      (none)
      Status Code: 404

      Exception:
      Stacktrace:
      (none)

      This was fixed by using the options Steve Merrill suggested.

    2. What is the above supposed to do differently as opposed to setting useSecurity to false and removing the authorizationStrategy and securityRealm elements?

  2. I am new to Jenkins and need assistance in gaining access to my Jenkins installation.

    I successfully managed to lock myself out on the Jenkins ver. 1.539  and i am unable to gain access to it.

    i had set up my security realm to use the Jenkins database.

    The config.xml file seems to have been excluded from this release and as such am unable to edit it.

    How do i gain access?

  3. I also locked myself out while configuring security.

    Steven Merrill's suggestion worked for me.

    However, finding the config.xml file was difficult, because I installed Jenkins 1.580 using theDebian package. In my case, the variable $JENKINS_HOME was empty.

    After some search, I found the file /etc/default/jenkins showed that jenkins home is /var/lib/jenkins/.

    I found the config.xml there, changed it as per Steven Merrill suggestion, and restarted jenkins daemon by using the command "sudo service jenkins restart".

    This fixed the problem.

  4. If jenkins is installed under servlet container on Windows machine, config.xml can be found at c:\Windows\System32\config\systemprofile\.jenkins\

  5. Hello,

    I am getting the error below just after adding user permission to Global Security-> Enable Security->Authorization –>Project Bases Matrix Authorization Strategy. I tried changing the the config.xml file but still my Jenkins is dead. I am using Mac Book Pro as the server.

    Kindly guide me.

    hudson.security.AccessDeniedException2: anonymous is missing the Overall/Read permission
    at hudson.security.ACL.checkPermission(ACL.java:63)
    at hudson.model.Node.checkPermission(Node.java:441)
    at jenkins.model.Jenkins.getTarget(Jenkins.java:3843)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:674)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

  6. I did the procedure as outlined in the original instructions and after restarting Jenkins the web console screen is blank.  No error message, no html, just a blank page.

    Where in the config.xml should the lines in Steven Merril's comments be put?  Without some context, it is far to late to just dump this information into the config.xml file.<useSecurity>true</useSecurity>
    <authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/>
    <securityRealm class="hudson.security.SecurityRealm$None"/>

  7. I was unsuccessful in getting anything other than a completely blank screen from Jenkins with any of the suggestions presented here.  I believe the issue may have been that I had created my own account and was asked to login, before I had created any permissions to do anything on the Jenkins server (lesson learned: Set up Admin and Anonymous user account Authorizations before setting up the Active Directory Security Realm).

    I had to restore from backup to regain control of Jenkins (lesson reinforced: always backup critical systems before making changes).

    1. Mea Culpa!

      It turns out the issue I was experiencing with Jenkins UI vanishing was not related to the Active Directory plugin.  It was instead related to the SCM Sync plugin version 0.0.9 and was documented in JENKINS-32124.  The SCM Sync plugin was installed a few days before; but the system hadn't been restarted after the plugin was configured with our repository information.  The UI vanishing issue only appears after the repo info is configured, and the system is restarted.

    2. Mea Culpa!

      It turns out the issue I was experiencing with Jenkins UI vanishing was not related to the Active Directory plugin.  It was instead related to the SCM Sync plugin version 0.0.9 and was documented in JENKINS-32124.  The SCM Sync plugin was installed a few days before; but the system hadn't been restarted after the plugin was configured with our repository information.  The UI vanishing issue only appears after the repo info is configured, and the system is restarted.

  8. Hello,

    I did exactly like Steven Merrill mentioned above and It worked great.

    Note: My current Jenkins version is- 1.625.3.

  9. Hello,

    I have the following error:hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read D:\jenkins\config.xml
    at hudson.WebAppMain$3.run(WebAppMain.java:244)
    Caused by: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read D:\jenkins\config.xml
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:45)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:1009)
    at jenkins.model.Jenkins.<init>(Jenkins.java:877)
    at hudson.model.Hudson.<init>(Hudson.java:85)
    at hudson.model.Hudson.<init>(Hudson.java:81)
    at hudson.WebAppMain$3.run(WebAppMain.java:227)
    Caused by: java.io.IOException: Unable to read D:\jenkins\config.xml
    at hudson.XmlFile.unmarshal(XmlFile.java:165)
    at jenkins.model.Jenkins.loadConfig(Jenkins.java:2785)
    at jenkins.model.Jenkins.access$700(Jenkins.java:324)
    at jenkins.model.Jenkins$16.run(Jenkins.java:2803)
    at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:998)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: jenkins.util.xstream.CriticalXStreamException: hudson.plugins.active_directory.ActiveDirectorySecurityRealm : hudson.plugins.active_directory.ActiveDirectorySecurityRealm
    --- Debugging information ---
    message : hudson.plugins.active_directory.ActiveDirectorySecurityRealm
    cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
    cause-message : hudson.plugins.active_directory.ActiveDirectorySecurityRealm
    class : hudson.model.Hudson
    required-type : hudson.model.Hudson
    converter-type : hudson.util.RobustReflectionConverter
    path : /hudson/securityRealm
    line number : 171
    version : not available
    -------------------------------
    at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:356)
    at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
    at hudson.util.XStream2.unmarshal(XStream2.java:114)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
    at hudson.XmlFile.unmarshal(XmlFile.java:163)
    ... 11 more
    Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.plugins.active_directory.ActiveDirectorySecurityRealm
    at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:282)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:43)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:48)
    at hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:461)
    at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:327)
    ... 22 more

    I tried Steven Merrils solution but unfortunately it did not work. Does anyone have any sugestions?
    Thanks

Write a comment…