java.io.IOException: Unable to read /var/lib/jenkins/jobs/MyJobTest/config.xml

8,599 views
Skip to first unread message

Thad Guidry

unread,
Aug 16, 2017, 3:44:44 PM8/16/17
to Jenkins Users
We recently backed up our /jobs folder on Jenkins 2.73 and copied this to another Jenkins.2.73 server running on RHEL 7.1

We get the following stacktrace on many of them trying to read the config.xml and not all the jobs are being loaded onto the Job dashboard...

Aug 16, 2017 2:01:32 PM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading item MyJobTest
java.io.IOException: Unable to read /var/lib/jenkins/jobs/MyJobTest/config.xml
        at hudson.XmlFile.read(XmlFile.java:151)
        at hudson.model.Items.load(Items.java:371)
        at jenkins.model.Jenkins$17.run(Jenkins.java:3116)
        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:1090)
        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(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: flow-definition
        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:285)
        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 com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:133)
        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 com.thoughtworks.xstream.XStream.fromXML(XStream.java:1053)
        at hudson.XmlFile.read(XmlFile.java:149)
        ... 10 more

config.xml

Slide

unread,
Aug 16, 2017, 3:45:45 PM8/16/17
to Jenkins Users
Do you have all the same plugins (and plugin versions) installed on the second instance of Jenkins?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2145286e-dda4-4b09-a388-90231391e74b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thad Guidry

unread,
Aug 16, 2017, 5:09:08 PM8/16/17
to Jenkins Users
Yes we do.  Versions are the latest on new Jenkins and latest or near latest (1 version back) on the old Jenkins.

Unfortunately, the logs are not clear on if a particular plugin was causing an issue... it treats the whole flow-definition as an exception.
I would expect much better handling of those kinds of errors by Jenkins.

-Thad

Daniel Beck

unread,
Aug 17, 2017, 11:14:42 AM8/17/17
to jenkins...@googlegroups.com

> On 16. Aug 2017, at 23:09, Thad Guidry <thadg...@gmail.com> wrote:
>
> it treats the whole flow-definition as an exception

I expect the log will show errors about unloadable plugins before this error occurs. Those should be clear as to why loading failed.

On the Jenkins UI (if it manages to start), it will also show a message about unloadable plugins and the causes on the /manage URL. These might be different to decipher due to potentially wide dependency trees, but if it says "X cannot be loaded because Y is missing", and "Y cannot be loaded because Z is missing", then "Z" is the problem to take care of first.

Peter Darton

unread,
Aug 17, 2017, 11:24:36 AM8/17/17
to Jenkins Users
I'd agree that the error isn't the most helpful error message :-/

If it were me, I'd start by enduring that the "workflow-job" plugin is at version 2.14 in the new server, as that's the version that the old job file is looking for.
You could also try manually creating a job with that name and then seeing what the resulting config.xml looks like.  If it looks similar, you could then try overwriting the file and then telling Jenkins to reload its configuration from disk.
If that doesn't work, I'd try manually re-creating the job and then using a decent file-comparison tool to see what the differences are between the manually-created job's config.xml and the original config.xml file - it might be something silly like end-of-line codes, or character encoding, or it might well be a different/incompatible plugin version.

Thad Guidry

unread,
Aug 17, 2017, 3:37:21 PM8/17/17
to Jenkins Users
So the issue was in fact that not all the Pipeline Plugin suite was installed... curiously, I thought that the 2.73 RPM package would have included all of Pipeline plugins ?  Like workflow-job, etc..
But the RPM package does not.

My suggestion to the Dev team is to get the full Pipeline Plugin suite into the RPM's going forward.  That will alleviate a lot of headache I think for most folks doing standard CI/CD since many have already converted to Pipeline for that, such as us at Ericsson.

After I installed the Pipeline Plugin suite, than the error went away since it now understood <flow-definition> class since the workflow-job plugin was available again.

Thanks all,
-Thad

Slide

unread,
Aug 17, 2017, 3:56:30 PM8/17/17
to Jenkins Users
As far as I know, NONE of the pipeline plugins are bundled and the general movement has been to unbundle as much as possible from a basic install. There are still quite a number of people who are NOT using pipeline, so bundling them with Jenkins from the get go would bloat the install.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Thad Guidry

unread,
Aug 17, 2017, 4:53:06 PM8/17/17
to Jenkins Users
Fair enough.

Daniel Beck

unread,
Aug 25, 2017, 3:15:22 AM8/25/17
to jenkins...@googlegroups.com

> On 17. Aug 2017, at 21:37, Thad Guidry <thadg...@gmail.com> wrote:
>
> My suggestion to the Dev team is to get the full Pipeline Plugin suite into the RPM's going forward. That will alleviate a lot of headache I think for most folks doing standard CI/CD since many have already converted to Pipeline for that, such as us at Ericsson.
>

Just going through the setup wizard will install the Pipeline suite.

If you bypass that, and also don't use the plugin manager in Jenkins in Jenkins, but rather populate JENKINS_HOME/plugins manually, you're expected to know what you're doing -- mostly parsing the dependencies of plugins, and ensuring they're all satisfied.

Thad Guidry

unread,
Aug 25, 2017, 12:01:41 PM8/25/17
to jenkins...@googlegroups.com
On Fri, Aug 25, 2017 at 2:15 AM Daniel Beck <m...@beckweb.net> wrote:

> On 17. Aug 2017, at 21:37, Thad Guidry <thadg...@gmail.com> wrote:
>
> My suggestion to the Dev team is to get the full Pipeline Plugin suite into the RPM's going forward.  That will alleviate a lot of headache I think for most folks doing standard CI/CD since many have already converted to Pipeline for that, such as us at Ericsson.
>

Just going through the setup wizard will install the Pipeline suite.


I did.  It did not completely, which is why they problem surfaced.
 
If you bypass that, and also don't use the plugin manager in Jenkins in Jenkins, but rather populate JENKINS_HOME/plugins manually, you're expected to know what you're doing -- mostly parsing the dependencies of plugins, and ensuring they're all satisfied.


Dude, SERIOUSLY ?  Make sure to tell other users not to use the plugin manager that took Jenkins developers about 2 years to build up and that gets feature tested multiple times per day and prior to release.  Let's also make sure we make it harder for Jenkins admins and throw out software solutions to make their lives easier...besides they really enjoy parsing XML files themselves rather than sipping Mimosa's on the beach.

Daniel, please respect all the effort that Jenkins open source developers put into the software.  Your better than that, you work for the 1 institution that supports Jenkins and has good respect and contributes directly to features that Jenkins provides.  Cloudbees.

-Thad

Slide

unread,
Aug 25, 2017, 12:15:22 PM8/25/17
to jenkins...@googlegroups.com

I'm pretty sure Daniel didn't say to not use the plugin manager. He said that IF you don't use it, then you need to make sure all the dependencies are handled correctly on your own. The plugin manager does that for you, but just dropping hpi files into JENKINS_HOME is not expected to work if you don't provide all the dependencies yourself.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Thad Guidry

unread,
Aug 25, 2017, 11:18:20 PM8/25/17
to jenkins...@googlegroups.com
I might have misinterpreted.  Email sucks. :)

I only used the plugin manager and didn't manually drop in plugins.

The only issue then is to help users know which plugins are missing much more clearly.  Showing only the classnames versus also providing the actual label names from https://plugins.jenkins.io ... or even better, providing a one click download and install option for those reported missing in the warning box by the login. (forgot what its was called)


You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Z_LDi9enxHk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVe4rj3fh%2BSMG9Kh-76y0piffXPNbU%3Ds4d-22Us8X84X3w%40mail.gmail.com.

Slide

unread,
Aug 26, 2017, 12:09:15 AM8/26/17
to jenkins...@googlegroups.com
I've thought about writing an app that would give you a Jenkins Plugin Archive with all the plugins and their dependencies, but I haven't gotten around to it yet. I think it would be useful for people who are cut off from internet access on their Jenkins server machine, or for people who want to just drop in a single file to get all the plugins they want. It's been on my list of things to do for a while.

Thad Guidry

unread,
Aug 26, 2017, 12:45:02 AM8/26/17
to jenkins...@googlegroups.com

Daniel Beck

unread,
Aug 27, 2017, 10:06:30 AM8/27/17
to Jenkins Users

> On 25. Aug 2017, at 20:17, Thad Guidry <thadg...@gmail.com> wrote:
>
> I only used the plugin manager and didn't manually drop in plugins.

What you describe is a frequent symptom of people _not_ using the built-in ways to install plugins, so that was a reasonable guess (in fact, copying over plugins from one system to another -- if you've done that -- is exactly that). Installing and updating plugins via built-in plugin manager ensures dependencies are always satisfied (or it tells you loudly when not).

> The only issue then is to help users know which plugins are missing much more clearly. Showing only the classnames versus also providing the actual label names from https://plugins.jenkins.io

Labels (or plugins.jenkins.io URLs) may actually be unknown to Jenkins (dependency on a plugin not on an update site), but it should be possible in most cases.

> or even better, providing a one click download and install option for those reported missing in the warning box by the login. (forgot what its was called)

Right now, due to larger dependency trees, some plugins reported missing might not actually be (just unloadable due to dependency issues upstream), and installing unconditionally may change the installed version to the newest (or, in rare cases, one actually incompatible with the current version of Jenkins, and yes, that's as stupid as it seems). Not impossible, just more work to integrate.

Could you file an Improvement in Jira for these? Project is JENKINS, component is core.

Thad Guidry

unread,
Aug 27, 2017, 10:26:44 AM8/27/17
to jenkins...@googlegroups.com
--
-Thad
Reply all
Reply to author
Forward
0 new messages