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

Discard Unreadable Data results in an NPE

    Details

    • Similar Issues:

      Description

      Jenkins version 1.524-SNAPSHOT (rc-07/16/2013 13:36 GMT-kohsuke)

      When trying to remove the old data from the Claim Plugin I get the following NPE

      Stack trace
      
      javax.servlet.ServletException: java.lang.NullPointerException
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:726)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:777)
      	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:239)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:684)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:777)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:586)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:217)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
      	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
      	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
      	at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:86)
      	at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:84)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:47)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:724)
      Caused by: java.lang.NullPointerException
      	at hudson.model.AbstractItem.getRootDir(AbstractItem.java:160)
      	at hudson.model.Items.getConfigFile(Items.java:236)
      	at hudson.model.AbstractItem.getConfigFile(AbstractItem.java:459)
      	at hudson.model.AbstractItem.save(AbstractItem.java:454)
      	at hudson.model.Job.save(Job.java:159)
      	at hudson.model.AbstractProject.save(AbstractProject.java:279)
      	at hudson.diagnosis.OldDataMonitor.doDiscard(OldDataMonitor.java:275)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:297)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:160)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:95)
      	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:684)
      	... 64 more
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            ClaimBuildAction must not serialize a reference to a Run (in the inherited owner field). Use 1.509.3+ and RunAction2 instead. (This means that AbstractClaimBuildAction would need to be refactored to not directly have an owner field, but instead have a protected abstract T owner() method since the two subclasses would have different ways of keeping this.)

            Show
            jglick Jesse Glick added a comment - ClaimBuildAction must not serialize a reference to a Run (in the inherited owner field). Use 1.509.3+ and RunAction2 instead. (This means that AbstractClaimBuildAction would need to be refactored to not directly have an owner field, but instead have a protected abstract T owner() method since the two subclasses would have different ways of keeping this.)
            Hide
            jglick Jesse Glick added a comment -

            https://github.com/jenkinsci/jenkins/commit/3246964 in 1.539 provides slightly better diagnosis, by the way, but the bug is really in plugins (tickled by lazy-loading changes).

            Show
            jglick Jesse Glick added a comment - https://github.com/jenkinsci/jenkins/commit/3246964 in 1.539 provides slightly better diagnosis, by the way, but the bug is really in plugins (tickled by lazy-loading changes).
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Arnaud
            Path:
            src/main/java/hudson/plugins/claim/AbstractClaimBuildAction.java
            src/main/java/hudson/plugins/claim/ClaimBuildAction.java
            src/main/java/hudson/plugins/claim/ClaimPublisher.java
            src/main/java/hudson/plugins/claim/ClaimTestAction.java
            http://jenkins-ci.org/commit/claim-plugin/2515d7756a04fe7dbd828665aa522e872a66bc1b
            Log:
            JENKINS-18809 fix NPE on old data deserialization

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Path: src/main/java/hudson/plugins/claim/AbstractClaimBuildAction.java src/main/java/hudson/plugins/claim/ClaimBuildAction.java src/main/java/hudson/plugins/claim/ClaimPublisher.java src/main/java/hudson/plugins/claim/ClaimTestAction.java http://jenkins-ci.org/commit/claim-plugin/2515d7756a04fe7dbd828665aa522e872a66bc1b Log: JENKINS-18809 fix NPE on old data deserialization
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Arnaud TAMAILLON
            Path:
            src/main/java/hudson/plugins/claim/AbstractClaimBuildAction.java
            src/main/java/hudson/plugins/claim/ClaimBuildAction.java
            src/main/java/hudson/plugins/claim/ClaimPublisher.java
            src/main/java/hudson/plugins/claim/ClaimTestAction.java
            src/main/java/hudson/plugins/claim/DescribableTestAction.java
            http://jenkins-ci.org/commit/claim-plugin/5f015f55007197f5d0d612102256da7aaeb5c8dc
            Log:
            Merge pull request #34 from Greybird/JENKINS-18809

            JENKINS-18809 fix NPE on old data deserialization

            Compare: https://github.com/jenkinsci/claim-plugin/compare/bce510cf9218...5f015f550071

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud TAMAILLON Path: src/main/java/hudson/plugins/claim/AbstractClaimBuildAction.java src/main/java/hudson/plugins/claim/ClaimBuildAction.java src/main/java/hudson/plugins/claim/ClaimPublisher.java src/main/java/hudson/plugins/claim/ClaimTestAction.java src/main/java/hudson/plugins/claim/DescribableTestAction.java http://jenkins-ci.org/commit/claim-plugin/5f015f55007197f5d0d612102256da7aaeb5c8dc Log: Merge pull request #34 from Greybird/ JENKINS-18809 JENKINS-18809 fix NPE on old data deserialization Compare: https://github.com/jenkinsci/claim-plugin/compare/bce510cf9218...5f015f550071
            Hide
            greybird Arnaud TAMAILLON added a comment -

            Fixed in 2.12

            Show
            greybird Arnaud TAMAILLON added a comment - Fixed in 2.12

              People

              • Assignee:
                greybird Arnaud TAMAILLON
                Reporter:
                rbaradari Ramin Baradari
              • Votes:
                5 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: