Build time graph broken

Hello,

After an upgrade from Debian 8 to Debian 9 (currently using Jenkins 2.312), our ‘Build time graph’ is broken:

Any idea how to fix this?

Thanks!
Bart

Check for a stack trace in the Jenkins log that might tell you more about what is happening when that failure occurs. The log at http://your-jenkins.example.com/log/all may provide hints of the cause.

I ran the Jenkins Docker image for 2.312 and confirmed that it renders the trend graph correctly in my installation. Since the Docker image for 2.312 is running Debian 11 (bullseye) and Java 11.0.12, I’m reasonably confident that the issue is something local in your environment rather than a general purpose failure in Jenkins

OK, checking that log URL you mentioned, shows me there seems to be a problem with the “Project Build Times” plugin:

Oct 28, 2021 11:00:28 AM WARNING hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
Failed to instantiate Key[type=hudson.plugins.projectbuildtimes.BuildTimesChart$DescriptorImpl, annotation=[none]]; skipping this component
java.lang.ClassNotFoundException: org.joda.time.Chronology
	at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1419)
	at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1374)
	at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1129)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
Caused: java.lang.NoClassDefFoundError: org/joda/time/Chronology
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at hudson.model.Descriptor.<init>(Descriptor.java:304)
	at hudson.plugins.projectbuildtimes.BuildTimesChart$DescriptorImpl.<init>(BuildTimesChart.java:311)
	at hudson.plugins.projectbuildtimes.BuildTimesChart$DescriptorImpl$$FastClassByGuice$$2ee9c38b.newInstance(<generated>)
	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
	at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
	at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:564)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
Caused: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.NoClassDefFoundError: org/joda/time/Chronology
  at hudson.plugins.projectbuildtimes.BuildTimesChart$DescriptorImpl.<init>(BuildTimesChart.java:311)

1 error
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
	at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:442)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
	at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:402)
	at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:393)
	at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:353)
	at hudson.ExtensionList.load(ExtensionList.java:383)
	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:319)
	at hudson.ExtensionList.getComponents(ExtensionList.java:183)
	at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:214)
	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:319)
	at hudson.ExtensionList.iterator(ExtensionList.java:171)
	at org.jenkinsci.plugins.xunit.AliasInitializer.init(AliasInitializer.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:181)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1153)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

However, version 1.2.1 of this plugin is installed:

What would be your advice? Uninstalling and reinstalling that plugin?

Apparently, the libjoda-time-java package was not installed on my Debian 9 system. I now installed it, but even after a restart of my Jenkins Master node, the graph does not appear. No new builds did run yet… maybe I should wait until a build was run and hope that the graph gets regenerated? Or am I on the wrong track here?

Oh wow, https://plugins.jenkins.io/global-build-stats/ is 4 years old now. It needs a bit of love. Seems to me its using a class it doesn’t explictly declare in its pom file, and so whatever was providing it, now doesn’t (probably removed from jenkins core).

It probably wouldn’t be that hard to modernize it and bring it up to date if your interested.

Java doesn’t really work like that :frowning: Dependancies are not pulled from the system at runtime. I think the plugin will need to be recompiled.

@halkeye , you mention the “Global Build Stats” plugin, but for as far as I can conclude from a Google search, hudson.plugins.projectbuildtimes.BuildTimesChart is related to the “Project Build Times” plugin. See

Aren’t we confusing two plugins here? I have the “Project Build Times” plugin installed (version 1.2.1) but even after a restart of my Jenkins Master node, the graph isn’t fixed…

After installing the libjoda-time-java package, I now get other errors. One of them is the following:

Error while serving http://<foobar>/job/<somejob>/buildTimeGraph/png
java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
	at org.jfree.chart.ChartFactory.createStackedAreaChart(ChartFactory.java:1315)
	at hudson.model.Job$4.createGraph(Job.java:1483)
	at hudson.util.Graph.render(Graph.java:113)
	at hudson.util.Graph.doPng(Graph.java:155)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:393)

So probably more Java-related packages need to be installed on my system?

I now also installed the libjfreechart-java package and am currently waiting for our Jenkins to restart. I’ll report back later if that solved the problem.

You don’t need to install java packages in your system, they come automatically with a plugin. If not, then the plugin is broken and not compatible anymore with the Jenkins version that you are using.

The project build times plugin was last released 7 years ago. However, the page that you showed with the broken image is not being generated by the project build times plugin. The project build times plugin provides a graph that can be inserted into a dashboard view. The page you’re showing with the broken graph is not a dashboard view as far as I can tell.

There is probably another stack trace somewhere that provides hints for the failure in the job trend chart.

If the dashboard view is also broken (as seems likely based on the stack trace), then your choices for the project build times plugin in a dashboard view are:

  • Remove the plugin and accept that those graphs are not available in the dashboard view
  • Update the plugin to work with recent versions of Jenkins

If you’re interested in updating the plugin to work with recent versions of Jenkins, there is a workshop document that guides through a series of small steps to modernize a plugin. We used many of the steps in the workshop document to create a five part video series on adopting Jenkins plugins.

If you decide to update the plugin, you’re welcome to ask questions here if you encounter surprises or have questions.

1 Like