Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20166

Jenkins import fails due to xml version 1.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 6.7.1
    • Jenkins importer
    • None

    Description

      Problem

      Since Jenkins 2.107 the config files used by Jenkins are written using XML version 1.1
      Jenkins Upgrade Guide

      When trying to import from Jenkins 2.107 or later the import will fail.

      The following appears in the atlassian-bamboo.log

      2018-10-31 16:56:16,102 INFO [http-nio-8085-exec-2] [SelectJobsForImport] Reading Jenkins data from /JENKINS_LOCATION
      2018-10-31 16:56:16,171 ERROR [http-nio-8085-exec-2] [Jenkins] Exception loading Jenkins configuration
      java.io.IOException: Unable to read /JENKINS_LOCATION/config.xml
              at hudson.XmlFile.unmarshal(XmlFile.java:162)
              at jenkins.model.Jenkins.loadConfiguration(Jenkins.java:587)
              at jenkins.model.Jenkins.setRootDir(Jenkins.java:497)
              at com.atlassian.bamboo.jenkins.importer.core.JenkinsDataReader.initializeDataDirectories(JenkinsDataReader.java:197)
      ...
              at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)
              at hudson.XmlFile.unmarshal(XmlFile.java:160)
              ... 294 more
      Caused by: org.xmlpull.v1.XmlPullParserException: only 1.0 is supported as <?xml version not '1.1' (position: START_DOCUMENT seen <?xml version=\'1.1\'... @1:19)
              at org.xmlpull.mxp1.MXParser.parseXmlDeclWithVersion(MXParser.java:2608)
              at org.xmlpull.mxp1.MXParser.parseXmlDecl(MXParser.java:2592)
              at org.xmlpull.mxp1.MXParser.parsePI(MXParser.java:2466)
              at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1447)
              at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
              at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
              at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
              ... 302 more
      

      Cause

      The XML parser used by Bamboo, xmlpull, only supports XML version 1.0. Bamboo needs to use a different parser to be able to support XML 1.1 and import the latest Jenkins data.

      Workaround

      Edit all the .xml files within the Jenkins directory hierarchy and change the files to use XML version 1.0.

      <?xml version="1.0" encoding="UTF-8" ?>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cberry@atlassian.com Chris Berry
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: