Jenkins will not start after I accidently updated all plugins

Our team that set up our Jenkins server is long gone. I do not have much experience. The installed Jenkins version is 2.285.

I attempted to update the NodeJS plugin via the Jenkins UI as the NodeJS plugin seemed to be casing a build error in one of our packages. It looks like I made a mistake. It appears that I selected to update all plugins.

When jenkins restarted the main page had the following error;
(I will include the stack at the end after I explain what things I have done to try and fix this)
-I tried to update the jenkins version to a later version using apt-get install command. Did not fix the issue
-The error message indicates an issue with the github-oauth plugin so I tried moving any plugins with the name git* to a back up directory and then restart jenkins. This did not fix the problem
-I changed change the class attribute of the securityRealm tag from org.jenkinsci.plugins.GithubSecurityRealm to hudson.security.HudsonPrivateSecurityRealm in the config.xml file and restarted jenkins. Jenkins restarted and I could login but I had to make a new user as we use the git plugins for our user account logins. I could not fix the git plugins from this state.

How can I fix this issue without messing up our configuration?

com.thoughtworks.xstream.mapper.CannotResolveClassException: org.jenkinsci.plugins.GithubSecurityRealm
	at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:378)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at org.jenkinsci.jruby.JRubyMapper.realClass(JRubyMapper.java:34)
	at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:45)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
	at hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:507)
	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:337)
Caused: jenkins.util.xstream.CriticalXStreamException: 
---- Debugging information ----
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.jenkinsci.plugins.GithubSecurityRealm
class               : hudson.model.Hudson
required-type       : hudson.model.Hudson
converter-type      : hudson.util.RobustReflectionConverter
path                : /hudson/securityRealm
line number         : 105
version             : not available
-------------------------------
	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:366)
	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:280)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
	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:1429)
	at hudson.util.XStream2.unmarshal(XStream2.java:161)
	at hudson.util.XStream2.unmarshal(XStream2.java:132)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1409)
	at hudson.XmlFile.unmarshal(XmlFile.java:180)
Caused: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
	at hudson.XmlFile.unmarshal(XmlFile.java:183)
	at hudson.XmlFile.unmarshal(XmlFile.java:163)
	at jenkins.model.Jenkins.loadConfig(Jenkins.java:3160)
	at jenkins.model.Jenkins.access$1200(Jenkins.java:313)
	at jenkins.model.Jenkins$12.run(Jenkins.java:3261)
	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1129)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused: org.jvnet.hudson.reactor.ReactorException
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1162)
	at jenkins.model.Jenkins.<init>(Jenkins.java:960)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:295)
Caused: hudson.util.HudsonFailedToLoad
	at hudson.WebAppMain$3.run(WebAppMain.java:312)

That Jenkins version is a very old weekly version. It is old enough that the Jenkins update center no longer provides version compatibility information for it. When you updated plugins, you probably downloaded plugins that won’t work with that Jenkins version.

Your best course of action is to restore the entire plugins directory from a backup. Don’t try to update plugins on that Jenkins controller.

1 Like