-
Bug
-
Resolution: Fixed
-
Blocker
Web interface just shows
java.lang.NullPointerException at com.thoughtworks.xstream.converters.ConversionException.add(ConversionException.java:65) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1066) at hudson.util.XStream2.unmarshal(XStream2.java:109) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045) at hudson.XmlFile.unmarshal(XmlFile.java:166) at hudson.Plugin.load(Plugin.java:239) at hudson.plugins.global_build_stats.GlobalBuildStatsPlugin.load(GlobalBuildStatsPlugin.java:98) at hudson.plugins.global_build_stats.business.GlobalBuildStatsPluginSaver.reloadPlugin(GlobalBuildStatsPluginSaver.java:98) at hudson.plugins.global_build_stats.business.GlobalBuildStatsBusiness.reloadPlugin(GlobalBuildStatsBusiness.java:382) at hudson.plugins.global_build_stats.GlobalBuildStatsPlugin$GlobalBuildStatsItemListener.onLoaded(GlobalBuildStatsPlugin.java:149) at jenkins.model.Jenkins.<init>(Jenkins.java:849) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.model.Hudson.<init>(Hudson.java:77) at hudson.WebAppMain$2.run(WebAppMain.java:214)
- is duplicated by
-
JENKINS-17869 java.lang.NullPointerException after upgrade from 1.504 to 1.510
-
- Resolved
-
[JENKINS-17248] java.lang.NullPointerException in global-build-stats plug-in at startup
Removing the global-build-stats plugin I was able to restart Jenkins.
Although the problem is caused by a plugin the application should not crash.
I would move the plugin back. This is not a "global-build-stats" problem but mainly a core problem.
The application should not completely crash because of a plugin error! It should start by disabling it.
At the moment the web interface is completely unavailable without even a hint on what the problem could be.
We experienced this too, and I can confirm that removing "global-build-stats" plugin helped to get Jenkins back up. Not a real solution, though.
We just updated to 1.506 from a pretty old version (1.47x something), and suddenly after one restart, this error came up.
Any other plugin affected? I am prepping to upgrade from 1.494 to 1.510 this weekend ... but seems like this and this (https://issues.jenkins-ci.org/browse/JENKINS-17514) is party-stopper ...
Removing the <path to jenkins>/global-build-stats and <path to jenkins>/global-build-stats.xml works around the problem...
but you lose the stats, that didn't bother me as much as jenkins not running...
Updated to 1.512 and the web interface gave the same error message as reported, unusable. Fortunately the workaround of removing the path to global-build-stats works.
It's a global-build-stats configuration forward compliance issue. Fix by removing (or rename for backup) .jenkins/global-build-stats.xml.
Thanks Julien, had this problem with 1.517 and just removing the global-build-stats.xml resolved it, without needing to remove the plugin.
I tried to migrate my local workspace from 1.424 to 1.508 and I encountered the problem, full stacktrace :
Jun 16, 2013 1:35:42 PM hudson.plugins.global_build_stats.business.GlobalBuildStatsPluginSaver reloadPlugin SEVERE: Unable to read /Users/fcamblor/Documents/projects/Jenkins-Plugins/global-build-stats/./work/global-build-stats.xml hudson.util.IOException2: Unable to read /Users/fcamblor/Documents/projects/Jenkins-Plugins/global-build-stats/./work/global-build-stats.xml at hudson.XmlFile.unmarshal(XmlFile.java:170) at hudson.Plugin.load(Plugin.java:239) at hudson.plugins.global_build_stats.GlobalBuildStatsPlugin.load(GlobalBuildStatsPlugin.java:98) at hudson.plugins.global_build_stats.business.GlobalBuildStatsPluginSaver.reloadPlugin(GlobalBuildStatsPluginSaver.java:98) at hudson.plugins.global_build_stats.business.GlobalBuildStatsBusiness.reloadPlugin(GlobalBuildStatsBusiness.java:382) at hudson.plugins.global_build_stats.GlobalBuildStatsPlugin$GlobalBuildStatsItemListener.onLoaded(GlobalBuildStatsPlugin.java:149) at jenkins.model.Jenkins.<init>(Jenkins.java:849) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.model.Hudson.<init>(Hudson.java:77) at hudson.WebAppMain$2.run(WebAppMain.java:214) Caused by: com.thoughtworks.xstream.converters.ConversionException: null : null ---- Debugging information ---- cause-exception : java.lang.NullPointerException cause-message : null class : hudson.plugins.global_build_stats.GlobalBuildStatsPlugin required-type : hudson.plugins.global_build_stats.GlobalBuildStatsPlugin converter-type : hudson.plugins.global_build_stats.xstream.GlobalBuildStatsXStreamConverter path : /hudson.plugins.global_build_stats.GlobalBuildStatsPlugin line number : 2 version : null ------------------------------- at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061) at hudson.util.XStream2.unmarshal(XStream2.java:109) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045) at hudson.XmlFile.unmarshal(XmlFile.java:166) ... 9 more Caused by: java.lang.NullPointerException at java.util.ArrayList.addAll(ArrayList.java:472) at hudson.plugins.global_build_stats.model.JobBuildResultSharder.load(JobBuildResultSharder.java:140) at hudson.plugins.global_build_stats.xstream.migration.AbstractMigrator.readGlobalBuildStatsPOJO(AbstractMigrator.java:35) at hudson.plugins.global_build_stats.xstream.GlobalBuildStatsXStreamConverter.unmarshal(GlobalBuildStatsXStreamConverter.java:159) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ... 18 more Jun 16, 2013 1:35:43 PM hudson.WebAppMain$2 run
Problem is I cannot reproduce it now (problem fired only once, and after a jenkins restart it didn't pop anymore).
If someone have any more input to reproduce the problem (backuped global-build-stats.xml for instance), it would be helpful for a fix.
Attached a backup of global-build-stats.xml but I didn't test if it reproduces the issue.
I am experiencing this issue too. I have Hudson 2.2.1 installed on CentOS 5.4 typically and it has been working fine for months, since the last version upgrade. I have not added or updated any plugins in the last several weeks, and have restarted the service and rebooted the machine since any configuration changes and all was working.
Today, I restarted the service and experienced this issue. I manually removed the global-build-stats plug-in and restart, and it worked. From the Hudson web interface, I re-installed the global-build-stats v1.3 and set the service to restart when no jobs were running, and the issue reappeared. I have to again manually remove the global-build-stats plug-in and run without until this issue is resolved.
Status? Can I provide any more info that would be useful?
After updating from 1.4xx to 1.5xx we too are now experiencing this issue. We also move the global-build-stats.xml to temp. fix this issue. Hoping a resolution is in the works.
I won't throw an eye on resolving this issue if I don't have any more information about reproducing it.
If I can't reproduce, I can't fix it.
Is there anything we can do to help you reproduce this issue? All we did to experience it was update and then after a server restart the issue arised.
You can try to reproduce it on a fresh install (personnally it works for me) and eventually try to reproduce some part of your corporate configuration inside this fresh install, to identify which part (plugin, config..) is causing problem
See upstream bug report. (Attempted) fix should be integrated in xstream 1.4.4-jenkins-4, though I have no idea how to reproduce. Workaround is presumably to delete $JENKINS_HOME/global-build-stats.xml.
By the way steps to reproduce would still be valuable here because there may be some bug in the plugin which is triggering the XStream bug and which could be solved in parallel.
Filed https://github.com/jenkinsci/global-build-stats-plugin/pull/4 for robustness.
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/jenkins/model/Jenkins.java
http://jenkins-ci.org/commit/jenkins/4def416224074c611f41185bd4e2dd0b68bcba5d
Log:
JENKINS-17248 Be robust against exceptions in ItemListener.onLoaded, since this could interrupt Jenkins startup.
Code changed in jenkins
User: Jesse Glick
Path:
changelog.html
http://jenkins-ci.org/commit/jenkins/d3fa3bc906c7cb88c267f36b8eba1150435f9aaf
Log:
JENKINS-18775 JENKINS-17248 Noting.
Thanks Jesse
+1 for reproductibility steps in order to see if the migration to 1.4.4-jenkins-4 is fixing the issue.
Wondering if we shouldn't keep this issue closed until we have these reproductibility steps.
Wondering if we shouldn't keep this issue closed
Do you mean “open”? I think not, since there are now two fixes in core that should prevent the NPE from halting startup (besides the third proposed in the plugin).
Integrated in jenkins_main_trunk #2834
JENKINS-17248 Be robust against exceptions in ItemListener.onLoaded, since this could interrupt Jenkins startup. (Revision 4def416224074c611f41185bd4e2dd0b68bcba5d)
JENKINS-18775 JENKINS-17248 Noting. (Revision d3fa3bc906c7cb88c267f36b8eba1150435f9aaf)
Result = UNSTABLE
Jesse Glick : 4def416224074c611f41185bd4e2dd0b68bcba5d
Files :
- core/src/main/java/jenkins/model/Jenkins.java
Jesse Glick : d3fa3bc906c7cb88c267f36b8eba1150435f9aaf
Files :
- changelog.html
Code changed in jenkins
User: Jesse Glick
Path:
src/main/java/hudson/plugins/global_build_stats/business/GlobalBuildStatsPluginSaver.java
http://jenkins-ci.org/commit/global-build-stats-plugin/30198e54a232605143ab6018cdcdb31a40100247
Log:
JENKINS-17248 Robustness against NPE, unless and until root issue is diagnosed, or people start running with patched XStream.
Code changed in jenkins
User: Frédéric Camblor
Path:
src/main/java/hudson/plugins/global_build_stats/GlobalBuildStatsPlugin.java
src/main/java/hudson/plugins/global_build_stats/business/GlobalBuildStatsPluginSaver.java
http://jenkins-ci.org/commit/global-build-stats-plugin/dff58df2ea84b93e82c613072809b0b402a5bc89
Log:
Merge pull request #4 from jglick/NPE-JENKINS-17248
JENKINS-17248 Robustness against NPE
Compare: https://github.com/jenkinsci/global-build-stats-plugin/compare/2b4f1b35e597...dff58df2ea84
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/jenkins/model/Jenkins.java
http://jenkins-ci.org/commit/jenkins/08c189234b0599d6ec9ee81d9fd7f8b3a2bd5ff3
Log:
JENKINS-17248 Be robust against exceptions in ItemListener.onLoaded, since this could interrupt Jenkins startup.
(cherry picked from commit 4def416224074c611f41185bd4e2dd0b68bcba5d)
In the log file the same exception appears by startup