Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50126

Regression in handling malformed XML files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • core
    • None
    • Jenkins 2.105

      Steps to reproduce

      Create a freestyle job, then stop Jenkins.

      Add leading line breaks to the job's config.xml, like so:

      <?xml version='1.0' encoding='UTF-8'?>
      <project>
        <keepDependencies>false</keepDependencies>
        <properties/>
        <scm class="hudson.scm.NullSCM"/>
        <canRoam>false</canRoam>
        <disabled>false</disabled>
        <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
        <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
        <triggers/>
        <concurrentBuild>false</concurrentBuild>
        <builders/>
        <publishers/>
        <buildWrappers/>
      </project>
      

      Start Jenkins

      Result

      Mar 12, 2018 5:56:35 PM jenkins.InitReactorRunner$1 onTaskFailed
      SEVERE: Failed Loading item ITEMNAME
      java.io.IOException: Unable to read …/jobs/ITEMNAME/config.xml
          at hudson.XmlFile.read(XmlFile.java:149)
          at hudson.model.Items.load(Items.java:371)
          at jenkins.model.Jenkins$15.run(Jenkins.java:3075)
          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:1064)
          at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
          at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
          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)
      Caused by: com.thoughtworks.xstream.io.StreamException:  : PI must not start with xml (position:unknown
      @2:5 in java.io.InputStreamReader@5176d651)
          at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
          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.XppReader.<init>(XppReader.java:63)
          at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:54)
          at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)
          at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1053)
          at hudson.XmlFile.read(XmlFile.java:147)
          ... 10 more
      Caused by: org.xmlpull.v1.XmlPullParserException: PI must not start with xml (position:unknown
      @2:5 in java.io.InputStreamReader@5176d651)
          at org.kxml2.io.KXmlParser.exception(Unknown Source)
          at org.kxml2.io.KXmlParser.error(Unknown Source)
          at org.kxml2.io.KXmlParser.parseLegacy(Unknown Source)
          at org.kxml2.io.KXmlParser.nextImpl(Unknown Source)
          at org.kxml2.io.KXmlParser.next(Unknown Source)
          at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
          ... 19 more
      

      This seems to be a regression in Jenkins 2.105 with the XML 1.1 change.

            Unassigned Unassigned
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: