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

NullPointer in getPreviousBuild

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrading to latest 1.501 (from 1.484) I see this error a lot in my Jenkins log surging from several actions: scm polling, columns sort, dashboard views, etc.

      Feb 16, 2013 6:00:55 PM hudson.triggers.SCMTrigger$Runner runPolling
      SEVERE: Failed to record SCM polling for hudson.model.FreeStyleProject@4dcc1f71[PM_OSS5_ACOMHFE_ADAPTATION_LV1]
      java.lang.NullPointerException
              at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:213)
              at hudson.tasks.Fingerprinter$FingerprintAction.onLoad(Fingerprinter.java:349)
              at hudson.model.Run.onLoad(Run.java:320)
              at hudson.model.RunMap.retrieve(RunMap.java:226)
              at hudson.model.RunMap.retrieve(RunMap.java:59)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:645)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:608)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:347)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:505)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:358)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoadRunMap.java:300)
              at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:1021)
              at hudson.model.AbstractProject.poll(AbstractProject.java:1387)
              at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439)
              at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468)
              at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
              at java.util.concurrent.FutureTask.run(FutureTask.java:166)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
              at java.lang.Thread.run(Thread.java:722)
      

      I've disabled Downstream+buildview+plugin because of this error some jobs wouldn't even load, while other plugins like DashboardView would get dogslow while still throwing this same stacktrace, but still the same stack trace keeps showing up even in the most basic things like SCM Polling.

      Please check.

        Attachments

          Issue Links

            Activity

            Hide
            alex_ouzounis Alex Ouzounis added a comment -

            Since 1.511 and clearing/deleting the bad builds problem is officially gone

            Show
            alex_ouzounis Alex Ouzounis added a comment - Since 1.511 and clearing/deleting the bad builds problem is officially gone
            Hide
            gitt Slawa Giterman added a comment -

            I get similar error with 1.509.1:

            • I had several jobs created in Jenkins 1.501. The problem was that "Test Result Trend" chart was often not shown and in log file there were NullPointer/getPreviousBuild() exceptions.
            • Then I upgraded to 1.509.1, deleted all old builds and "Test Result Trend" charts were shown again. But only for some time. After several new builds they disappeared and this is what i see in Jenkins log again:
            May 15, 2013 2:19:19 PM org.kohsuke.stapler.compression.CompressionFilter reportException
            WARNING: Untrapped servlet exception
            javax.servlet.ServletException: java.lang.NullPointerException
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:719)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
            	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:384)
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
            	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
            	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
            	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
            	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)
            	at org.kohsuke.stapler.Stapler.service(Stapler.java:214)
            ...
            Caused by: java.lang.NullPointerException
            	at hudson.model.Run.getFullDisplayName(Run.java:711)
            	at hudson.model.Run.toString(Run.java:706)
            	at java.lang.String.valueOf(Unknown Source)
            	at java.lang.StringBuilder.append(Unknown Source)
            	at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218)
            	at hudson.tasks.test.AbstractTestResultAction.getPreviousResult(AbstractTestResultAction.java:163)
            	at hudson.tasks.test.AbstractTestResultAction.buildDataSet(AbstractTestResultAction.java:246)
            	at hudson.tasks.test.AbstractTestResultAction.doGraphMap(AbstractTestResultAction.java:217)
            	at hudson.tasks.test.TestResultProjectAction.doTrendMap(TestResultProjectAction.java:108)
            	at sun.reflect.GeneratedMethodAccessor2212.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            	at java.lang.reflect.Method.invoke(Unknown Source)
            	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
            	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
            	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
            	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
            	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
            ...
            

            Or sometimes:

            May 16, 2013 10:06:30 AM hudson.ExpressionFactory2$JexlExpression evaluate
            WARNING: Caught exception evaluating: tr.previousResult!=null in /jenkins/view/Tests-Functional/job/FT_Web/. Reason: java.lang.reflect.InvocationTargetException
            java.lang.reflect.InvocationTargetException
            	at sun.reflect.GeneratedMethodAccessor815.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            	at java.lang.reflect.Method.invoke(Unknown Source)
            	at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
            	at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
            	at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
            	at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
            	at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
            	at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
            	at org.apache.commons.jexl.parser.ASTNENode.value(ASTNENode.java:55)
            	at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54)
            	at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56)
            	at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
            	at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
            ...
            Caused by: java.lang.NullPointerException
            	at hudson.model.Run.getFullDisplayName(Run.java:711)
            	at hudson.model.Run.toString(Run.java:706)
            	at java.lang.String.valueOf(Unknown Source)
            	at java.lang.StringBuilder.append(Unknown Source)
            	at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218)
            	at hudson.tasks.test.AbstractTestResultAction.getPreviousResult(AbstractTestResultAction.java:163)
            	at hudson.tasks.test.AbstractTestResultAction.getPreviousResult(AbstractTestResultAction.java:157)
            ...
            
            Show
            gitt Slawa Giterman added a comment - I get similar error with 1.509.1: I had several jobs created in Jenkins 1.501. The problem was that "Test Result Trend" chart was often not shown and in log file there were NullPointer/getPreviousBuild() exceptions. Then I upgraded to 1.509.1, deleted all old builds and "Test Result Trend" charts were shown again. But only for some time. After several new builds they disappeared and this is what i see in Jenkins log again: May 15, 2013 2:19:19 PM org.kohsuke.stapler.compression.CompressionFilter reportException WARNING: Untrapped servlet exception javax.servlet.ServletException: java.lang.NullPointerException at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:719) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:384) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583) at org.kohsuke.stapler.Stapler.service(Stapler.java:214) ... Caused by: java.lang.NullPointerException at hudson.model.Run.getFullDisplayName(Run.java:711) at hudson.model.Run.toString(Run.java:706) at java.lang. String .valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218) at hudson.tasks.test.AbstractTestResultAction.getPreviousResult(AbstractTestResultAction.java:163) at hudson.tasks.test.AbstractTestResultAction.buildDataSet(AbstractTestResultAction.java:246) at hudson.tasks.test.AbstractTestResultAction.doGraphMap(AbstractTestResultAction.java:217) at hudson.tasks.test.TestResultProjectAction.doTrendMap(TestResultProjectAction.java:108) at sun.reflect.GeneratedMethodAccessor2212.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) ... Or sometimes: May 16, 2013 10:06:30 AM hudson.ExpressionFactory2$JexlExpression evaluate WARNING: Caught exception evaluating: tr.previousResult!= null in /jenkins/view/Tests-Functional/job/FT_Web/. Reason: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor815.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185) at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTNENode.value(ASTNENode.java:55) at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54) at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74) ... Caused by: java.lang.NullPointerException at hudson.model.Run.getFullDisplayName(Run.java:711) at hudson.model.Run.toString(Run.java:706) at java.lang. String .valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218) at hudson.tasks.test.AbstractTestResultAction.getPreviousResult(AbstractTestResultAction.java:163) at hudson.tasks.test.AbstractTestResultAction.getPreviousResult(AbstractTestResultAction.java:157) ...
            Hide
            jglick Jesse Glick added a comment -

            @gitt I am not convinced your exception is related to this issue.

            Show
            jglick Jesse Glick added a comment - @gitt I am not convinced your exception is related to this issue.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/model/AbstractBuild.java
            http://jenkins-ci.org/commit/jenkins/cc26f23ec4f7ba58577c490b35e4c481d0527f49
            Log:
            JENKINS-16845 Properly report the IllegalStateException, rather than throwing an NPE producing the exception message.
            java.lang.NullPointerException
            at hudson.model.Run.getFullDisplayName(Run.java:711)
            at hudson.model.Run.toString(Run.java:706)
            at java.lang.String.valueOf(Unknown Source)
            at java.lang.StringBuilder.append(Unknown Source)
            at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/AbstractBuild.java http://jenkins-ci.org/commit/jenkins/cc26f23ec4f7ba58577c490b35e4c481d0527f49 Log: JENKINS-16845 Properly report the IllegalStateException, rather than throwing an NPE producing the exception message. java.lang.NullPointerException at hudson.model.Run.getFullDisplayName(Run.java:711) at hudson.model.Run.toString(Run.java:706) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218)
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2601
            JENKINS-16845 Properly report the IllegalStateException, rather than throwing an NPE producing the exception message. (Revision cc26f23ec4f7ba58577c490b35e4c481d0527f49)

            Result = SUCCESS
            Jesse Glick : cc26f23ec4f7ba58577c490b35e4c481d0527f49
            Files :

            • core/src/main/java/hudson/model/AbstractBuild.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2601 JENKINS-16845 Properly report the IllegalStateException, rather than throwing an NPE producing the exception message. (Revision cc26f23ec4f7ba58577c490b35e4c481d0527f49) Result = SUCCESS Jesse Glick : cc26f23ec4f7ba58577c490b35e4c481d0527f49 Files : core/src/main/java/hudson/model/AbstractBuild.java

              People

              • Assignee:
                Unassigned
                Reporter:
                josesa Jose Sa
              • Votes:
                11 Vote for this issue
                Watchers:
                23 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: