Job Config History breaks Items changes synchronization in High Availability (active/active) managed controller replicas.

1 minute readKnowledge base

Issue

  • Changes made to one replica failed to be reloaded in other replica(s). This happens intermittently.

  • The logs of the managed controller replica that try to reload the item shows an exception like the following:

    WARNING hudson.model.RunMap#retrieve: could not load <full job name> javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) at com.thoughtworks.xstream.io.xml.StaxReader.pullNextEvent(StaxReader.java:58) Caused: com.thoughtworks.xstream.io.StreamException: at com.thoughtworks.xstream.io.xml.StaxReader.pullNextEvent(StaxReader.java:74) at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148) at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141) at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118) at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103) at com.thoughtworks.xstream.io.xml.StaxReader.<init>(StaxReader.java:45) at com.thoughtworks.xstream.io.xml.StaxDriver.createStaxReader(StaxDriver.java:173) at com.thoughtworks.xstream.io.xml.StaxDriver.createReader(StaxDriver.java:100) at hudson.XmlFile.unmarshal(XmlFile.java:196) Caused: java.io.IOException: Unable to read <job directory>/config.xml at hudson.XmlFile.unmarshal(XmlFile.java:199) at hudson.XmlFile.unmarshal(XmlFile.java:179) at hudson.model.AbstractItem.load(AbstractItem.java:966) at com.cloudbees.jenkins.plugins.replication.sync.ItemsSync.load(ItemsSync.java:224) at com.cloudbees.jenkins.plugins.replication.sync.ItemsSync.reload(ItemsSync.java:207)

    Or sometimes:

    WARNING hudson.model.RunMap#retrieve: could not load <full job name> javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Premature end of file. [...] Caused: java.io.IOException: Unable to read <job directory>/config.xml at hudson.XmlFile.unmarshal(XmlFile.java:199) at hudson.XmlFile.unmarshal(XmlFile.java:179) at hudson.model.AbstractItem.load(AbstractItem.java:966) at com.cloudbees.jenkins.plugins.replication.sync.ItemsSync.load(ItemsSync.java:224) at com.cloudbees.jenkins.plugins.replication.sync.ItemsSync.reload(ItemsSync.java:207)

Explanation

This is caused by an issue in the Job Config History plugin that rewrites item’s config.xml on every save operation. This causes intermittent Items synchronization issues in High Availability (active/active) managed controller replicas. Intermittent as it happens in case where the Job Config History plugin of the owning replica is rewriting the config.xml while a non-owning replica tries to read the file.

Resolution

The solution is to upgrade Job Config History plugin to version 1241.v07634fa_18896 or later.