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

EnvInject: NullPointerException in EnvInjectAction#writeReplace()

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • envinject-plugin
    • None
    • Windows Server 2008 R2 Datacenter

      I use Jenkins 2.27 with latest plugin of EnvInject.

      at hudson.model.Run.getRootDir(Run.java:1014)
      at org.jenkinsci.lib.envinject.EnvInjectAction.writeReplace(EnvInjectAction.java:98)
      at sun.reflect.GeneratedMethodAccessor369.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteReplace(SerializationMethodInvoker.java:89)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:141)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
      at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
      at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
      at hudson.XmlFile.write(XmlFile.java:169)
      at hudson.model.Run.save(Run.java:1903)
      at hudson.diagnosis.OldDataMonitor.saveAndRemoveEntries(OldDataMonitor.java:362)
      at hudson.diagnosis.OldDataMonitor.doDiscard(OldDataMonitor.java:334)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.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:324)
      at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:52)
      at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      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:117)
      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 jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      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:171)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

          [JENKINS-39258] EnvInject: NullPointerException in EnvInjectAction#writeReplace()

          Oleg Nenashev added a comment -

          It cannot be the latest version of EnvInject. EnvInjectAction:98 points to nowhere, in the latest version invocation of getRootDir is at line 114. https://github.com/jenkinsci/envinject-plugin/blob/master/src/main/java/org/jenkinsci/plugins/envinject/EnvInjectAction.java#L114

          Oleg Nenashev added a comment - It cannot be the latest version of EnvInject. EnvInjectAction:98 points to nowhere, in the latest version invocation of getRootDir is at line 114. https://github.com/jenkinsci/envinject-plugin/blob/master/src/main/java/org/jenkinsci/plugins/envinject/EnvInjectAction.java#L114

          Oleg Nenashev added a comment -

          Please also provide config.xml of the job and build.xml of the run, for which you see the issue. According to https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L1014 it should be something weird (null project)

          Oleg Nenashev added a comment - Please also provide config.xml of the job and build.xml of the run, for which you see the issue. According to https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L1014 it should be something weird (null project)

          I know its weird, but jenkins ui shows that version 1.93.1 is installed of EnvInject plugin.

          The thing is, that I have no issue detected, this nullReferenceException comes only to my view, as I must restart jenkins after update other plugins. Because we run jenkins from batch and not as a service.

          I am not sure which job it is, but today runs two similiar jobs, with different paths only.
          BTW it is a multi job.

          In Multijob is EnvInjectBuilderContributionAction serveral times:

          <actions>
          <hudson.model.CauseAction>
          <causeBag class="linked-hash-map">
          <entry>
          <hudson.triggers.SCMTrigger_-SCMTriggerCause/>
          <int>1</int>
          </entry>
          </causeBag>
          </hudson.model.CauseAction>
          <hudson.triggers.SCMTrigger_-BuildAction/>
          <org.jenkinsci.plugins.envinject.EnvInjectPluginAction plugin="envinject@1.93.1">
          <build class="com.tikal.jenkins.plugins.multijob.MultiJobBuild" reference="../../.."/>
          </org.jenkinsci.plugins.envinject.EnvInjectPluginAction>
          <hudson.plugins.tfs.model.WorkspaceConfiguration plugin="tfs@3.2.0">
          <workspaceName>xxx-MASTER</workspaceName>
          <workfolder>.</workfolder>
          <projectPath>$/xxx</projectPath>
          <serverUrl>http://xxx/</serverUrl>
          <workspaceExists>true</workspaceExists>
          </hudson.plugins.tfs.model.WorkspaceConfiguration>
          <hudson.plugins.tfs.TFSRevisionState plugin="tfs@3.2.0">
          <changesetVersion>526924</changesetVersion>
          <projectPath>$/xxx</projectPath>
          </hudson.plugins.tfs.TFSRevisionState>
          <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/>
          <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/>
          <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/>
          <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/>
          <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/>
          <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/>
          <com.tikal.jenkins.plugins.multijob.MultiJobResumeBuild>
          <run class="com.tikal.jenkins.plugins.multijob.MultiJobBuild" reference="../../.."/>
          </com.tikal.jenkins.plugins.multijob.MultiJobResumeBuild>
          </actions>

          Ronny Borchert added a comment - I know its weird, but jenkins ui shows that version 1.93.1 is installed of EnvInject plugin. The thing is, that I have no issue detected, this nullReferenceException comes only to my view, as I must restart jenkins after update other plugins. Because we run jenkins from batch and not as a service. I am not sure which job it is, but today runs two similiar jobs, with different paths only. BTW it is a multi job. In Multijob is EnvInjectBuilderContributionAction serveral times: <actions> <hudson.model.CauseAction> <causeBag class="linked-hash-map"> <entry> <hudson.triggers.SCMTrigger_-SCMTriggerCause/> <int>1</int> </entry> </causeBag> </hudson.model.CauseAction> <hudson.triggers.SCMTrigger_-BuildAction/> <org.jenkinsci.plugins.envinject.EnvInjectPluginAction plugin="envinject@1.93.1"> <build class="com.tikal.jenkins.plugins.multijob.MultiJobBuild" reference="../../.."/> </org.jenkinsci.plugins.envinject.EnvInjectPluginAction> <hudson.plugins.tfs.model.WorkspaceConfiguration plugin="tfs@3.2.0"> <workspaceName>xxx-MASTER</workspaceName> <workfolder>.</workfolder> <projectPath>$/xxx</projectPath> <serverUrl> http://xxx/ </serverUrl> <workspaceExists>true</workspaceExists> </hudson.plugins.tfs.model.WorkspaceConfiguration> <hudson.plugins.tfs.TFSRevisionState plugin="tfs@3.2.0"> <changesetVersion>526924</changesetVersion> <projectPath>$/xxx</projectPath> </hudson.plugins.tfs.TFSRevisionState> <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/> <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/> <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/> <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/> <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/> <org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction plugin="envinject@1.93.1"/> <com.tikal.jenkins.plugins.multijob.MultiJobResumeBuild> <run class="com.tikal.jenkins.plugins.multijob.MultiJobBuild" reference="../../.."/> </com.tikal.jenkins.plugins.multijob.MultiJobResumeBuild> </actions>

          Oleg Nenashev added a comment -

          I would suspect a custom build of the plugin or another glitch. I would recommend manually redeploying the plugin from PluginManager/advanced or updating to a newer version

          Oleg Nenashev added a comment - I would suspect a custom build of the plugin or another glitch. I would recommend manually redeploying the plugin from PluginManager/advanced or updating to a newer version

          I checked also the content of the envinject.jpi, and the manifest shows the version I told:
          Manifest-Version: 1.0
          Archiver-Version: Plexus Archiver
          Created-By: Apache Maven
          Built-By: nenashev
          Build-Jdk: 1.7.0_75
          Extension-Name: envinject
          Specification-Title: The Jenkins Plugins Parent POM Project
          Implementation-Title: envinject
          Implementation-Version: 1.93.1
          Plugin-Class: org.jenkinsci.plugins.envinject.EnvInjectPlugin
          Group-Id: org.jenkins-ci.plugins
          Short-Name: envinject
          Long-Name: Environment Injector Plugin
          Url: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
          Compatible-Since-Version: 1.93
          Plugin-Version: 1.93.1
          Hudson-Version: 1.609.3
          Jenkins-Version: 1.609.3
          Plugin-Dependencies: ivy:1.21;resolution:=optional,matrix-project:1.7
          Plugin-Developers: Gregory Boissinot:gbois:gregory.boissinot@gmail.com
          ,Oleg Nenashev:oleg_nenashev:o.v.nenashev@gmail.com,Manuel Recena:rec
          ena:recena@gmail.com

          Ronny Borchert added a comment - I checked also the content of the envinject.jpi, and the manifest shows the version I told: Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: nenashev Build-Jdk: 1.7.0_75 Extension-Name: envinject Specification-Title: The Jenkins Plugins Parent POM Project Implementation-Title: envinject Implementation-Version: 1.93.1 Plugin-Class: org.jenkinsci.plugins.envinject.EnvInjectPlugin Group-Id: org.jenkins-ci.plugins Short-Name: envinject Long-Name: Environment Injector Plugin Url: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin Compatible-Since-Version: 1.93 Plugin-Version: 1.93.1 Hudson-Version: 1.609.3 Jenkins-Version: 1.609.3 Plugin-Dependencies: ivy:1.21;resolution:=optional,matrix-project:1.7 Plugin-Developers: Gregory Boissinot:gbois:gregory.boissinot@gmail.com ,Oleg Nenashev:oleg_nenashev:o.v.nenashev@gmail.com,Manuel Recena:rec ena:recena@gmail.com

          Oleg Nenashev added a comment -

          Unfortunately I will not have time to work on EnvInject issues for a while. I decided to unassign all issues so that somebody can take them and finalize.

          Context: The plugin has been waiting for adoption for ~2 years. During all this time I was trying to keep this plugin afloat by reviewing the incoming pull requests, fixing defects and keeping the codebase up to date to simplify the handover. But I have not been using this plugin on my own so that such maintenance was a bit lame. I invite all active users to contribute to the plugin by taking ownership of this plugin and of EnvInject API. I am happy to provide any required knowledge transfers and do some assistance during the first months of maintenance

          Oleg Nenashev added a comment - Unfortunately I will not have time to work on EnvInject issues for a while. I decided to unassign all issues so that somebody can take them and finalize. Context: The plugin has been waiting for adoption for ~2 years. During all this time I was trying to keep this plugin afloat by reviewing the incoming pull requests, fixing defects and keeping the codebase up to date to simplify the handover. But I have not been using this plugin on my own so that such maintenance was a bit lame. I invite all active users to contribute to the plugin by taking ownership of this plugin and of EnvInject API. I am happy to provide any required knowledge transfers and do some assistance during the first months of maintenance

            Unassigned Unassigned
            arbeita Ronny Borchert
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: