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

Sporadic IOException: Failed to persist config

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When creating the projects, I am getting sporadic failures in the jenkins error log as seen below. Jobs then fail to be updated.

      INFO: createOrUpdateConfig for WebContent
      Mar 23, 2015 10:29:12 AM javaposse.jobdsl.plugin.JenkinsJobManagement updateExistingItem
      WARNING: Error writing updated item to file.
      java.io.IOException: Failed to persist config.xml
      	at hudson.model.AbstractItem.updateByXml(AbstractItem.java:646)
      	at javaposse.jobdsl.plugin.JenkinsJobManagement.updateExistingItem(JenkinsJobManagement.java:378)
      	at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateConfig(JenkinsJobManagement.java:123)
      	at javaposse.jobdsl.dsl.DslScriptLoader.extractGeneratedJobs(DslScriptLoader.java:120)
      	at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:97)
      	at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:203)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
      	at hudson.model.Build$BuildExecution.build(Build.java:203)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
      	at hudson.model.Run.execute(Run.java:1751)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:89)
      	at hudson.model.Executor.run(Executor.java:240)
      Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
      java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
      	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
      	at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
      	at jenkins.util.xml.XMLUtils.safeTransform(XMLUtils.java:48)
      	at hudson.model.AbstractItem.updateByXml(AbstractItem.java:641)
      	... 14 more
      Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)
      	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)
      	at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
      	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
      	... 17 more
      

        Attachments

        1. support_2016-07-01_13.06.55.zip
          1.06 MB
        2. support_KO.zip
          18 kB
        3. support_OK.zip
          18 kB
        4. support.zip
          29 kB

          Issue Links

            Activity

            Hide
            tomasnorre Tomas Norre Mikkelsen added a comment -

            Could it be an idea to update the Plugins still using an older version of the `xercesImpl-2.11.0.jar` or even older [1]

            The Plugins I currently have using this library is following versions: 

            • 2.11.0 (Released Feb. 2013)
            • 2.9.1 (Release Oct. 2008)
            • 2.8.1 (Release Oct. 2006)

            So they are all pretty old. 

            1) https://mvnrepository.com/artifact/xerces/xercesImpl

            Show
            tomasnorre Tomas Norre Mikkelsen added a comment - Could it be an idea to update the Plugins still using an older version of the `xercesImpl-2.11.0.jar` or even older [1] .  The Plugins I currently have using this library is following versions:  2.11.0 (Released Feb. 2013) 2.9.1 (Release Oct. 2008) 2.8.1 (Release Oct. 2006) So they are all pretty old.  1)  https://mvnrepository.com/artifact/xerces/xercesImpl
            Hide
            tomasnorre Tomas Norre Mikkelsen added a comment -

            I'll Start to create Pull Request for the changes on the dependencies. Shouldn't harm anything if I read the Changelog correctly
            https://xerces.apache.org/xerces2-j/releases.html

            Show
            tomasnorre Tomas Norre Mikkelsen added a comment - I'll Start to create Pull Request for the changes on the dependencies. Shouldn't harm anything if I read the Changelog correctly https://xerces.apache.org/xerces2-j/releases.html
            Hide
            drulli Ulli Hafner added a comment -

            I don't think that the dependencies are the problem. Some tool simply sets the parser to a non default one.

            Show
            drulli Ulli Hafner added a comment - I don't think that the dependencies are the problem. Some tool simply sets the parser to a non default one.
            Hide
            tomasnorre Tomas Norre Mikkelsen added a comment -

            ok.. I have tried following this morning. 

            public class SetProperties {
            
                public static void main(String[] args) {
                    System.out.println(System.getProperty("org.xml.sax.driver"));
                    System.setProperty(
                        "org.xml.sax.driver",
                        "org.apache.xerces.parsers.SAXParser"
                    );
                    System.out.println(System.getProperty("org.xml.sax.driver"));
                }
            
            }

            And then as a build step before the JobDSL kicks in

            #!/bin/sh
            java SetProperties

             But this didn't change anything either. 

            Show
            tomasnorre Tomas Norre Mikkelsen added a comment - ok.. I have tried following this morning.  public class SetProperties { public static void main( String [] args) { System .out.println( System .getProperty( "org.xml.sax.driver" )); System .setProperty( "org.xml.sax.driver" , "org.apache.xerces.parsers.SAXParser" ); System .out.println( System .getProperty( "org.xml.sax.driver" )); } } And then as a build step before the JobDSL kicks in #!/bin/sh java SetProperties  But this didn't change anything either. 
            Hide
            tomasnorre Tomas Norre Mikkelsen added a comment -

            Just thinking out loud, could this be related to the Gradle Version ? (using 4.6).

            If i recalling it correctly, the problem started appearing in my setup after my last gradle upgrade. 

            Show
            tomasnorre Tomas Norre Mikkelsen added a comment - Just thinking out loud, could this be related to the Gradle Version ? (using 4.6). If i recalling it correctly, the problem started appearing in my setup after my last gradle upgrade. 

              People

              • Assignee:
                Unassigned
                Reporter:
                andrewk Andrew Kujtan
              • Votes:
                7 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated: