[JIRA] [analysis-core-plugin] (JENKINS-27548) Sporadic IOException: Failed to persist config

34 views
Skip to first unread message

mevans@parchment.com (JIRA)

unread,
Oct 9, 2015, 4:47:03 PM10/9/15
to jenkinsc...@googlegroups.com
Matt Evans commented on Bug JENKINS-27548
 
Re: Sporadic IOException: Failed to persist config

I have same issue and running command below from Script Console resolved issue for me.

System.clearProperty('org.xml.sax.driver')
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mail@daniel-spilker.com (JIRA)

unread,
Nov 4, 2015, 3:40:02 AM11/4/15
to jenkinsc...@googlegroups.com

matthieu.o.vachon@gmail.com (JIRA)

unread,
Nov 27, 2015, 5:38:01 PM11/27/15
to jenkinsc...@googlegroups.com
Matthieu Ouellette-Vachon commented on Bug JENKINS-27548
 
Re: Sporadic IOException: Failed to persist config

On my side, clearing the property org.xml.sax.driver did not work, in fact, it was not present at first so clearing it didn't work of course.

More information:

  • Issue is not present when I freshly restart jenkins. I guess a plugin is triggering the problem but did not find which one yet. I ran a standard Gradle job using junit, checkstyle and findbugs. After it ran, was still able to correctly update (via curl and via the Jenkins Job DSL plugin.
  • I recently updated for 1.591 to latest 1.638.
  • Switched from JDK 1.6 to JDK 1.8 at the same time.

I will try to monitor more closely after which build things get screwed.

As an untested workaround, for those using Job DSL plugin, I noticed you can specify additional classpath. I'm thinking adding the sax parser jar could serve as a workaround.

Otherwise, on my case, I need to restart jenkins instance.

Will update post with more findings if I happen to find some.

croesuskall@gmail.com (JIRA)

unread,
Jan 28, 2016, 6:48:03 AM1/28/16
to jenkinsc...@googlegroups.com

Pretty much the same problem here, except I only get the problem when creating a new issue via the Jenkins rest api.
Clearing the org.xml.sax.driver property does not work.

After restarting Jenkins, things work fine, but after a while it stops working. I have tried at length to reproduce this from a clean install but have not managed to

Jenkins version 1.644

chiodus@gmail.com (JIRA)

unread,
Feb 1, 2016, 9:51:02 AM2/1/16
to jenkinsc...@googlegroups.com

I have the same issue.
I use Jenkins 1.646 version.
I tried to add xerces.jar in "Additional classpath" but it doesn't work.

chiodus@gmail.com (JIRA)

unread,
Feb 4, 2016, 9:23:04 AM2/4/16
to jenkinsc...@googlegroups.com
Gianluca Chiodaroli updated an issue
 
Change By: Gianluca Chiodaroli
Attachment: support_OK.zip
Attachment: support_KO.zip

chiodus@gmail.com (JIRA)

unread,
Feb 4, 2016, 9:25:03 AM2/4/16
to jenkinsc...@googlegroups.com
 
Re: Sporadic IOException: Failed to persist config

I have resolved my issue.
During my test i noticed that the plugin fails only when run in Jenkins running in a Tomcat (running as a service) installed by windows installer.
When i run the job in a Jenkins running in a Tomcat started via .bat script the job work nicely.
I delete the previous Windows service and i secreate it via service.bat and now it works.

I supply support log. OK for working installation and KO for non working installation.

support_KO.zip
support_OK.zip

talios@java.net (JIRA)

unread,
Feb 22, 2016, 7:51:03 PM2/22/16
to jenkinsc...@googlegroups.com
talios commented on Bug JENKINS-27548

Have recently started seeing this on our Jenkins instance as well ( Centos 5 based ) running under Java 7 still. The `clearPassword` idea above doesn't seem to solve the issue either.

Does anyone have any further to report on this issue? Any progress?

eguess74@java.net (JIRA)

unread,
Feb 24, 2016, 4:36:01 PM2/24/16
to jenkinsc...@googlegroups.com
eguess74 commented on Bug JENKINS-27548

Same thing here - the REST API fails to create a new job. The property cleanup doesn't seem to be doing anything. Jenkins 1.649 with latest analysis plugins

eguess74@java.net (JIRA)

unread,
Feb 24, 2016, 5:55:02 PM2/24/16
to jenkinsc...@googlegroups.com
eguess74 edited a comment on Bug JENKINS-27548
Same thing here - the REST API fails to create a new job. The property cleanup doesn't seem to be doing anything. Jenkins 1.649 with latest analysis plugins


I have restarted the server and as a workaround i have put xercesImpl.jar into the classpath basing on this entry here: https://blogs.oracle.com/mei/entry/java_lang_classnotfoundexception_org_apache as that seems to be the fastest and the only available fix

I'll monitor if the workaround will stick.

eguess74@java.net (JIRA)

unread,
Feb 24, 2016, 6:18:01 PM2/24/16
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 26, 2016, 4:44:03 AM2/26/16
to jenkinsc...@googlegroups.com

Yes, this is the affecting code. It was introduced in order to get the parsing working if other plug-ins, scripts, or libraries change that setting.

eguess74@java.net (JIRA)

unread,
Feb 26, 2016, 3:45:02 PM2/26/16
to jenkinsc...@googlegroups.com
eguess74 commented on Bug JENKINS-27548

Small update: for now the workaround of adding xercesImpl.jar to the classpath seems to be holding up.

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:32:04 PM2/27/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ulli Hafner
Path:
.idea/checkstyle-idea.xml
analysis-core
checkstyle
dry
findbugs
pmd
http://jenkins-ci.org/commit/analysis-suite-plugin/9ac42a5935a49250f01984621c5e38174b82ed80
Log:
[FIXED JENKINS-27548] Do not alter SAX environment variable anymore.

Compare: https://github.com/jenkinsci/analysis-suite-plugin/compare/07368e8eef97...9ac42a5935a4

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:32:06 PM2/27/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon resolved as Fixed
 
Change By: SCM/JIRA link daemon
Status: Open Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:32:09 PM2/27/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ulli Hafner
Path:

checkstyle.iml
pom.xml
src/main/java/hudson/plugins/checkstyle/CheckStylePlugin.java
http://jenkins-ci.org/commit/checkstyle-plugin/8aec121d997dca4250df16924f41b85529200f58


Log:
[FIXED JENKINS-27548] Do not alter SAX environment variable anymore.

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:32:09 PM2/27/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ulli Hafner
Path:


Log:
[FIXED JENKINS-27548] Do not alter SAX environment variable anymore.

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:32:10 PM2/27/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ulli Hafner
Path:

src/main/java/hudson/plugins/dry/parser/DuplicationParserRegistry.java
http://jenkins-ci.org/commit/dry-plugin/2fb29b9d092f7221b2a2cdbe44398d6fe7b880fc


Log:
[FIXED JENKINS-27548] Do not alter SAX environment variable anymore.

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:33:03 PM2/27/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ulli Hafner
Path:

plugin/findbugs.iml
plugin/pom.xml
plugin/src/main/java/hudson/plugins/findbugs/FindBugsMessages.java
plugin/src/main/java/hudson/plugins/findbugs/parser/FindBugsParser.java
plugin/src/test/java/hudson/plugins/findbugs/parser/FindBugsParserTest.java
http://jenkins-ci.org/commit/findbugs-plugin/e5aa4fb5d18f7ae6060b31f1881d6722571c7851


Log:
[FIXED JENKINS-27548] Do not alter SAX environment variable anymore.

scm_issue_link@java.net (JIRA)

unread,
Feb 27, 2016, 5:33:05 PM2/27/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ulli Hafner
Path:


Log:
[FIXED JENKINS-27548] Do not alter SAX environment variable anymore.

sven@styla.com (JIRA)

unread,
Jun 22, 2016, 5:34:02 AM6/22/16
to jenkinsc...@googlegroups.com

I'm still getting this issue. While it's not a problem of job-dsl directly, it's currently very misleading that job-dsl does not detect the error. Why not logging a warning in its log instead of claiming success?

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
Jun 30, 2016, 12:05:02 AM6/30/16
to jenkinsc...@googlegroups.com

Which version of analysis-core is installed?

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 1, 2016, 9:07:02 AM7/1/16
to jenkinsc...@googlegroups.com

I just saw the same message on a docker instance running analysis-core 1.78 and Jenkins 1.651.3. I don't see it initially, but this particular docker instance been running for an hour or two and has processed hundreds of jobs while testing a possible new release of the git plugin. I'll upload a support-core plugin bundle in case that helps with the diagnosis.

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 1, 2016, 9:08:02 AM7/1/16
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Change By: Mark Waite
Attachment: support_2016-07-01_13.06.55.zip

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 1, 2016, 9:11:03 AM7/1/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-27548
I just saw the same message on a docker instance running analysis-core 1.78 and Jenkins 1.651.3.  I don't see it initially, but this particular docker instance been running for an hour or two and has processed hundreds of jobs while testing a possible new release of the git plugin.  I'll upload a support-core plugin bundle in case that helps with the diagnosis.


I received this output in a [multi-branch pipeline|https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/jobs/git-client-plugin-freestyle-multi-branch/config.xml] "Sync branches" job:

{noformat}
Started by user Mark Waite
Setting origin to https://github.com/MarkEWaite/git-plugin.git
Fetching origin...
Pruning stale remotes...
Getting remote branches...
Checking branch master-PR398-ioexception-from-submodule
Met criteria
Checking branch 3.0.0-beta
Checking branch 2.2.x
Checking branch master-PR393-limit-initial-refspec
Met criteria
Checking branch master-findbugs-fixes
Checking branch 2.5.0-beta2
Checking branch master-src-formatter
Checking branch master
Checking branch master-findbugs-combined
Checking branch master-PR411-parallel-tests
Met criteria
Checking branch ongoing/latest-jenkins-lts
Done.
Branch master-PR393-limit-initial-refspec encoded to master-PR393-limit-initial-refspec
Creating project for branch master-PR393-limit-initial-refspec
Syncing config from template to branch master-PR393-limit-initial-refspec
FATAL: Failed to persist config.xml
java.io.IOException: Failed to persist config.xml
at hudson.model.AbstractItem.updateByXml(AbstractItem.java:679)
at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.computeChildren(AbstractMultiBranchProject.java:610)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
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:674)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
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)
... 8 more
Branch master-PR398-ioexception-from-submodule encoded to master-PR398-ioexception-from-submodule
Creating project for branch master-PR398-ioexception-from-submodule
Syncing config from template to branch master-PR398-ioexception-from-submodule
FATAL: Failed to persist config.xml
java.io.IOException: Failed to persist config.xml
at hudson.model.AbstractItem.updateByXml(AbstractItem.java:679)
at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.computeChildren(AbstractMultiBranchProject.java:610)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
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:674)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
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)
... 8 more
Branch master-PR411-parallel-tests encoded to master-PR411-parallel-tests
Creating project for branch master-PR411-parallel-tests
Syncing config from template to branch master-PR411-parallel-tests
FATAL: Failed to persist config.xml
java.io.IOException: Failed to persist config.xml
at hudson.model.AbstractItem.updateByXml(AbstractItem.java:679)
at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.computeChildren(AbstractMultiBranchProject.java:610)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
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:674)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
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)
... 8 more
Scheduling build for branch master-PR398-ioexception-from-submodule
Scheduling build for branch master-PR411-parallel-tests
Scheduling build for branch master-PR393-limit-initial-refspec
Finished: SUCCESS
{noformat}

ullrich.hafner@gmail.com (JIRA)

unread,
Jul 1, 2016, 9:27:01 AM7/1/16
to jenkinsc...@googlegroups.com

Singe analysis-core 1.76 the SAX property is not altered anymore by one of the analysis plugins. Is there another plugin active that does alter that property?

croesuskall@gmail.com (JIRA)

unread,
Jul 6, 2016, 3:47:02 AM7/6/16
to jenkinsc...@googlegroups.com

How does one go about finding which plugin alters the property?

I tried this in the plugin folder for jenkins:

grep -ir 'org.xml.sax.driver' *

And got this:

Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
Binary file build-pipeline-plugin/WEB-INF/lib/xercesImpl-2.9.1.jar matches
Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches
Binary file selenium/WEB-INF/lib/selenium-server-standalone-2.41.0.jar matches

I am guessing the 'xercedImpl' dependencies are ok, but perhaps findbugs or selenium might be the culprits ?

caleb.lemoine.fev2@statefarm.com (JIRA)

unread,
Jul 28, 2016, 10:32:04 AM7/28/16
to jenkinsc...@googlegroups.com

I had this problem when updating the checkstyle plugin. In my case, I was on 3.38 but updated to 3.42. Then the problem occurred.

glechev@vmware.com (JIRA)

unread,
Aug 1, 2016, 12:52:02 PM8/1/16
to jenkinsc...@googlegroups.com

Here you go, the common plugin is findbugs here.
[code]jenkins@8ed06777b6e7:/var/jenkins_home/plugins$ grep -ir 'org.xml.sax.driver' *
Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches
Binary file fortify360/WEB-INF/lib/xercesImpl-2.6.2.jar matches
Binary file jacoco/WEB-INF/lib/xercesImpl-2.9.1.jar matches[code]

glechev@vmware.com (JIRA)

unread,
Aug 1, 2016, 12:54:02 PM8/1/16
to jenkinsc...@googlegroups.com
Grigor Lechev edited a comment on Bug JENKINS-27548

ullrich.hafner@gmail.com (JIRA)

unread,
Aug 3, 2016, 8:51:06 AM8/3/16
to jenkinsc...@googlegroups.com

Of course does xerces has a reference to org.xml.sax.driver. We need to look for *write* access of the corresponding environment variables.

ullrich.hafner@gmail.com (JIRA)

unread,
Aug 3, 2016, 8:51:08 AM8/3/16
to jenkinsc...@googlegroups.com
Ulli Hafner edited a comment on Bug JENKINS-27548
Of course does xerces has have a reference to org.xml.sax.driver. We need to look for **write** access of the corresponding environment variables.

ullrich.hafner@gmail.com (JIRA)

unread,
Aug 3, 2016, 8:51:10 AM8/3/16
to jenkinsc...@googlegroups.com
Ulli Hafner edited a comment on Bug JENKINS-27548
Of course does xerces have a reference to org.xml.sax.driver. We need to look for * * write* * access of the corresponding environment variables.

andbtk@telesoftas.com (JIRA)

unread,
Oct 12, 2016, 8:01:03 AM10/12/16
to jenkinsc...@googlegroups.com

I am still having this problem. Using jenkins version 2.25 with all plugins updated.

# grep -ir 'org.xml.sax.driver' *
Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches
Binary file jacoco/WEB-INF/lib/xercesImpl-2.9.1.jar matches
Binary file jdepend/WEB-INF/lib/xercesImpl-2.8.1.jar matches
Binary file jshint-checkstyle/WEB-INF/lib/xercesImpl-2.8.1.jar matches
Binary file jslint-checkstyle/WEB-INF/lib/xercesImpl-2.8.1.jar matches

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 5:08:01 AM9/5/18
to jenkinsc...@googlegroups.com

I'm also having this issue. 

$ grep -ir 'org.xml.sax.driver' *
Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
Binary file build-environment/WEB-INF/lib/xercesImpl-2.9.1.jar matches
Binary file build-pipeline-plugin/WEB-INF/lib/xercesImpl-2.9.1.jar matches
Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches
Binary file jdepend/WEB-INF/lib/xercesImpl-2.8.1.jar matches
Binary file violation-columns/WEB-INF/lib/xercesImpl-2.9.1.jar matches

I'm not sure how to fix this.. And don't find a "this is the solution"-post in the tread. Please update me if I overlooked something.

Thanks in advance. 

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 5:13:03 AM9/5/18
to jenkinsc...@googlegroups.com
I'm also having this issue. 

Jenkins: 2.121.3
{code:java}

$ grep -ir 'org.xml.sax.driver' *
Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
Binary file build-environment/WEB-INF/lib/xercesImpl-2.9.1.jar matches
Binary file build-pipeline-plugin/WEB-INF/lib/xercesImpl-2.9.1.jar matches
Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches
Binary file jdepend/WEB-INF/lib/xercesImpl-2.8.1.jar matches
Binary file violation-columns/WEB-INF/lib/xercesImpl-2.9.1.jar matches
{code}

I'm not sure how to fix this.. And don't find a "this is the solution"-post in the tread. Please update me if I overlooked something.

Thanks in advance. 

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:33:13 AM9/5/18
to jenkinsc...@googlegroups.com

Seems that we did not find the root cause for this problem yet. A grep for org.apache.xerces.parsers.SAXParser is only the first step. We need to find out which of the plug-ins changes the SAX parser property. Any idea on how to debug this?

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:33:15 AM9/5/18
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:33:16 AM9/5/18
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:34:05 AM9/5/18
to jenkinsc...@googlegroups.com
Ulli Hafner stopped work on Bug JENKINS-27548
 
Change By: Ulli Hafner
Resolution: Fixed
Status: In Progress Open

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:34:06 AM9/5/18
to jenkinsc...@googlegroups.com
Ulli Hafner assigned an issue to Unassigned
Change By: Ulli Hafner
Assignee: Ulli Hafner

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:35:04 AM9/5/18
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
Component/s: jdepend-plugin
Component/s: jshint-checkstyle-plugin
Component/s: jslint-checkstyle
Component/s: violations-plugin

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:35:05 AM9/5/18
to jenkinsc...@googlegroups.com
Tomas Norre Mikkelsen commented on Bug JENKINS-27548
 
Re: Sporadic IOException: Failed to persist config

Unfortunately I don't - Java is not within my areas of expertise. 

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:36:02 AM9/5/18
to jenkinsc...@googlegroups.com
Unfortunately I don't - Java is not within my areas of expertise. 


- We have updated all our plugins recently. None of them on my list are outdated.. :( 

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:43:09 AM9/5/18
to jenkinsc...@googlegroups.com

Btw. By me it's not working by doing the 
System.clearProperty('org.xml.sax.driver')
in the Jenkins Console.. Still getting the same error. 

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 5, 2018, 6:54:03 AM9/5/18
to jenkinsc...@googlegroups.com

From the JavaDoc:

  • If the system property org.xml.sax.driver has a value, that is used as an XMLReader class name.
  • The JAR "Services API" is used to look for a class name in the META-INF/services/org.xml.sax.driver file in jarfiles available to the runtime.

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 7:13:03 AM9/5/18
to jenkinsc...@googlegroups.com

Part of my Problem is that i cannot reproduce this on every instance. Which makes it more difficult to debug. 

Would prefer a local docker instance that failed too  

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 7:33:02 AM9/5/18
to jenkinsc...@googlegroups.com
Btw. By me it's not working by doing the 
{code:java}
System.clearProperty('org.xml.sax.driver') {code}

in the Jenkins Console.. Still getting the same error. 

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 7:43:05 AM9/5/18
to jenkinsc...@googlegroups.com

In my case, the error come back after 3-4 days. Running in Total between ~100-150 a day I think. 

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 7:49:02 AM9/5/18
to jenkinsc...@googlegroups.com

Running in jenkins console

import org.xml.sax.XMLReader;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();

I get following:

Not Working Instance:

Result: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser@7c31937

Working Instance:

Result: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser@2eed9e14

So the value of the setting is the same (besides the Object id) in my two instances where the one is not working.

tomasnorre@gmail.com (JIRA)

unread,
Sep 5, 2018, 12:36:04 PM9/5/18
to jenkinsc...@googlegroups.com
Tomas Norre Mikkelsen updated an issue
 
Change By: Tomas Norre Mikkelsen
Comment: Running in jenkins console
{code:java}

import org.xml.sax.XMLReader;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();{code}

I get following:

Not Working Instance:
{code:java}
Result: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser@7c31937{code}
Working Instance:
{code:java}
Result: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser@2eed9e14{code}

So the value of the setting is the same (besides the Object id) in my two instances where the one is not working.

tomasnorre@gmail.com (JIRA)

unread,
Sep 6, 2018, 1:49:05 AM9/6/18
to jenkinsc...@googlegroups.com
 
Re: Sporadic IOException: Failed to persist config

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

tomasnorre@gmail.com (JIRA)

unread,
Sep 6, 2018, 1:54:02 AM9/6/18
to jenkinsc...@googlegroups.com

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

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 6, 2018, 6:19:04 AM9/6/18
to jenkinsc...@googlegroups.com

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

tomasnorre@gmail.com (JIRA)

unread,
Sep 6, 2018, 6:33:01 AM9/6/18
to jenkinsc...@googlegroups.com

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. 

tomasnorre@gmail.com (JIRA)

unread,
Sep 6, 2018, 8:00:22 AM9/6/18
to jenkinsc...@googlegroups.com

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. 

jenkins.me@tiller.fr (JIRA)

unread,
Nov 20, 2018, 10:24:08 AM11/20/18
to jenkinsc...@googlegroups.com

Had the same issue today

java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:560)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
Caused: 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:69)
	at hudson.model.AbstractItem.updateByXml(AbstractItem.java:748)
Caused: java.io.IOException: Failed to persist config.xml
	at hudson.model.AbstractItem.updateByXml(AbstractItem.java:751)
	at hudson.model.AbstractItem.doConfigDotXml(AbstractItem.java:691)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)

Clearing the property did not help. "Fixed" it the hard way, by executing the following code into the script console:

URL url = new URL("http://central.maven.org/maven2/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar");

URLClassLoader classLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();
java.lang.reflect.Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
method.invoke(classLoader, url);

System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
 
                                                            

CLEARLY NOT a good fix, but a fix never the less if anyone is blocked by this issue. Of course if you reboot jenkins the fix is gone.

Funny thing is that the ClassLoader where the script console is executing did already have the SAXParser class (Class.forName("..") worked) but the default classLoaded did not (Class.forName("..", false, ClassLoader.getSystemClassLoader()) => null)

 

jenkins.me@tiller.fr (JIRA)

unread,
Nov 20, 2018, 10:25:02 AM11/20/18
to jenkinsc...@googlegroups.com
Michael Longo edited a comment on Bug JENKINS-27548
Had the same issue today
with jenkins 2.107.1 while trying to POST a config.xml
{code:java}

java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:560)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
Caused: 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:69)
at hudson.model.AbstractItem.updateByXml(AbstractItem.java:748)
Caused: java.io.IOException: Failed to persist config.xml
at hudson.model.AbstractItem.updateByXml(AbstractItem.java:751)
at hudson.model.AbstractItem.doConfigDotXml(AbstractItem.java:691)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)

{code}

Clearing the property did not help. "Fixed" it the hard way, by executing the following code into the script console:
{code:java}

URL url = new URL("http://central.maven.org/maven2/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar");

URLClassLoader classLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();
java.lang.reflect.Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
method.invoke(classLoader, url);

System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");{code}

CLEARLY NOT a good fix, but a fix never the less if anyone is blocked by this issue. Of course if you reboot jenkins the fix is gone.

Funny thing is that the ClassLoader where the script console is executing did already have the SAXParser class (Class.forName("..") worked) but the default classLoaded did not (Class.forName("..", false, ClassLoader.getSystemClassLoader()) => null)

 

ullrich.hafner@gmail.com (JIRA)

unread,
Nov 20, 2018, 3:49:03 PM11/20/18
to jenkinsc...@googlegroups.com

The warnings-ng plugin uses a different library now (it replaces analysis-core). It would be great if you can check the beta if it resolves your problem.

lostinberlin2010@gmail.com (JIRA)

unread,
Nov 26, 2018, 7:35:03 AM11/26/18
to jenkinsc...@googlegroups.com

Michael Longo: thanks for the "hard" fix. We were blocked for a while there.

Ulli Hafner: FYI: aside from the analysis-core, we only have the find-bug...@4.72 installed.

$ grep -ir 'org.apache.xerces.parsers.SAXParser' *
Binary file analysis-core/WEB-INF/lib/xercesImpl-2.11.0.jar matches
Binary file findbugs/WEB-INF/lib/library-2.0.4.jar matches

ullrich.hafner@gmail.com (JIRA)

unread,
Nov 26, 2018, 10:18:03 AM11/26/18
to jenkinsc...@googlegroups.com

Analysis-core and warnings plugin are deprecated and will be replaced by warnings-ng.

jenkins.me@tiller.fr (JIRA)

unread,
Nov 26, 2018, 10:52:02 AM11/26/18
to jenkinsc...@googlegroups.com

Ulli Hafner : stupid question, are analysis-core and warnings plugins visible in the plugin list in Jenkins UI? Because I don't have any of these plugins in my jenkins and I still had the issue. So is it related?

ullrich.hafner@gmail.com (JIRA)

unread,
Nov 26, 2018, 4:12:02 PM11/26/18
to jenkinsc...@googlegroups.com

Yes these plugins are visible (static analysis utilities plugin and warning plugin). It is still not clear which plugins are actually causing the bug, so yes you can be affected even if you do not have these plugins installed.

ullrich.hafner@gmail.com (JIRA)

unread,
Nov 26, 2018, 4:21:02 PM11/26/18
to jenkinsc...@googlegroups.com

And an additional note: the problem is not that the sax parser is a dependency of a plugin, somehow some plugin sets the property and should not do it.

ullrich.hafner@gmail.com (JIRA)

unread,
Dec 6, 2018, 7:11:06 PM12/6/18
to jenkinsc...@googlegroups.com

In the new beta of the warnings-ng plugin a warning is now logged if your system has a non empty sax parser property. Can you please check the log output on your system if there is such a warning?

hardcore_army@web.de (JIRA)

unread,
Jan 19, 2019, 2:06:03 PM1/19/19
to jenkinsc...@googlegroups.com

Where do I have do search for this warning? I don't see anyone in the build console log output. Does this means the property is correct?

Struggeling on the problem since our jenkins was updated by the admins to 2.138

 

Do I understand the other commenty correctly that removing all of the analysis plugins and only use warning-ng should fix that?

Reply all
Reply to author
Forward
0 new messages