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

java.lang.NullPointerException in EnvInjectAction.writeReplace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Postponed
    • Component/s: multijob-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.73.2
      envinject plugin 2.1.5
    • Similar Issues:

      Description

      java.lang.NullPointerException
       at org.jenkinsci.lib.envinject.EnvInjectAction.writeReplace(EnvInjectAction.java:144)
       at sun.reflect.GeneratedMethodAccessor369.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       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:171)
       at hudson.model.Run.save(Run.java:1933)
       at hudson.model.Saveable$save.call(Unknown Source)
       at Script1.run(Script1.groovy:31)
       at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
       at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)
       at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)
       at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:170)
       at hudson.plugins.groovy.SystemGroovy.run(SystemGroovy.java:95)
       at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:59)
       at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
       at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
       at hudson.model.Build$BuildExecution.build(Build.java:206)
       at hudson.model.Build$BuildExecution.doRun(Build.java:163)
       at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
       at hudson.model.Run.execute(Run.java:1737)
       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:421)

        Attachments

          Activity

          Hide
          puneeth_n Puneeth Nanjundaswamy added a comment -

          Oleg Nenashev Thanks for the pointers.

           

          I also attach the config.xml if it helps you get more info.

           

          <?xml version='1.0' encoding='UTF-8'?>
          <project>
           <actions/>
           <description></description>
           <keepDependencies>false</keepDependencies>
           <properties>
           <jenkins.model.BuildDiscarderProperty>
           <strategy class="hudson.tasks.LogRotator">
           <daysToKeep>-1</daysToKeep>
           <numToKeep>30</numToKeep>
           <artifactDaysToKeep>-1</artifactDaysToKeep>
           <artifactNumToKeep>-1</artifactNumToKeep>
           </strategy>
           </jenkins.model.BuildDiscarderProperty>
           <hudson.plugins.disk__usage.DiskUsageProperty plugin="disk-usage@0.28"/>
           <com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty plugin="naginator@1.17.2">
           <optOut>false</optOut>
           </com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty>
           <com.synopsys.arc.jenkinsci.plugins.jobrestrictions.jobs.JobRestrictionProperty plugin="job-restrictions@0.6"/>
           <hudson.model.ParametersDefinitionProperty>
           <parameterDefinitions>
           <org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterDefinition plugin="nodelabelparameter@1.7.2">
           <name>run_on_node</name>
           <description></description>
           <allowedSlaves>
           <string>master</string>
           </allowedSlaves>
           <defaultSlaves>
           <string>master</string>
           </defaultSlaves>
           <triggerIfResult>multiSelectionDisallowed</triggerIfResult>
           <allowMultiNodeSelection>false</allowMultiNodeSelection>
           <triggerConcurrentBuilds>false</triggerConcurrentBuilds>
           <ignoreOfflineNodes>false</ignoreOfflineNodes>
           <nodeEligibility class="org.jvnet.jenkins.plugins.nodelabelparameter.node.AllNodeEligibility"/>
           </org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterDefinition>
           </parameterDefinitions>
           </hudson.model.ParametersDefinitionProperty>
           </properties>
           <scm class="hudson.scm.NullSCM"/>
           <canRoam>true</canRoam>
           <disabled>true</disabled>
           <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
           <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
           <triggers>
           <hudson.triggers.TimerTrigger>
           <spec>H/30 * * * *</spec>
           </hudson.triggers.TimerTrigger>
           </triggers>
           <concurrentBuild>false</concurrentBuild>
           <builders>
           <hudson.plugins.groovy.SystemGroovy plugin="groovy@2.0">
           <source class="hudson.plugins.groovy.StringSystemScriptSource">
           <script plugin="script-security@1.34">
           <script>import hudson.matrix.*
          import hudson.model.*
           
          hudsonInstance = hudson.model.Hudson.instance
          allItems = hudsonInstance.getAllItems(AbstractProject.class);
           
          // Iterate over all jobs and find the ones that have a hudson.plugins.git.util.BuildData
          // as an action.
          //
          // We then clean it by removing the useless array action.buildsByBranchName
          //
           
          for (job in allItems) {
           println(&quot;job: &quot; + job.name);
           def counter = 0;
           for (build in job.getBuilds()) {
           // It is possible for a build to have multiple BuildData actions
           // since we can use the Mulitple SCM plugin.
           def gitActions = build.getActions(hudson.plugins.git.util.BuildData.class)
           if (gitActions != null) {
           for (action in gitActions) {
           action.buildsByBranchName = new HashMap&lt;String, Build&gt;();
           hudson.plugins.git.Revision r = action.getLastBuiltRevision();
           if (r != null) {
           for (branch in r.getBranches()) {
           action.buildsByBranchName.put(branch.getName(), action.lastBuild)
           }
           }
           build.actions.remove(action)
           build.actions.add(action)
           build.save();
           counter++;
           }
           }
           if (job instanceof MatrixProject) {
           def runcounter = 0;
           for (run in build.getRuns()) {
           gitActions = run.getActions(hudson.plugins.git.util.BuildData.class)
           if (gitActions != null) {
           for (action in gitActions) {
           action.buildsByBranchName = new HashMap&lt;String, Build&gt;();
           hudson.plugins.git.Revision r = action.getLastBuiltRevision();
           if (r != null) {
           for (branch in r.getBranches()) {
           action.buildsByBranchName.put(branch.getName(), action.lastBuild)
           }
           }
           run.actions.remove(action)
           run.actions.add(action)
           run.save();
           runcounter++;
           }
           }
           }
           if (runcounter &gt; 0) {
           println(&quot; --&gt;&gt; cleaned: &quot; + runcounter + &quot; runs&quot;);
           }
           }
           }
           if (counter &gt; 0) {
           println(&quot;-- cleaned: &quot; + counter + &quot; builds&quot;);
           }
          }</script>
           <sandbox>false</sandbox>
           </script>
           </source>
           </hudson.plugins.groovy.SystemGroovy>
           </builders>
           <publishers/>
           <buildWrappers>
           <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.8.8"/>
           <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.5.2">
           <colorMapName>gnome-terminal</colorMapName>
           </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
           </buildWrappers>
          </project>
          Show
          puneeth_n Puneeth Nanjundaswamy added a comment - Oleg Nenashev Thanks for the pointers.   I also attach the config.xml if it helps you get more info.   <?xml version= '1.0' encoding= 'UTF-8' ?> <project> <actions/> <description></description> <keepDependencies> false </keepDependencies> <properties> <jenkins.model.BuildDiscarderProperty> <strategy class= "hudson.tasks.LogRotator" > <daysToKeep>-1</daysToKeep> <numToKeep>30</numToKeep> <artifactDaysToKeep>-1</artifactDaysToKeep> <artifactNumToKeep>-1</artifactNumToKeep> </strategy> </jenkins.model.BuildDiscarderProperty> <hudson.plugins.disk__usage.DiskUsageProperty plugin= "disk-usage@0.28" /> <com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty plugin= "naginator@1.17.2" > <optOut> false </optOut> </com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty> <com.synopsys.arc.jenkinsci.plugins.jobrestrictions.jobs.JobRestrictionProperty plugin= "job-restrictions@0.6" /> <hudson.model.ParametersDefinitionProperty> <parameterDefinitions> <org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterDefinition plugin= "nodelabelparameter@1.7.2" > <name>run_on_node</name> <description></description> <allowedSlaves> <string>master</string> </allowedSlaves> <defaultSlaves> <string>master</string> </defaultSlaves> <triggerIfResult>multiSelectionDisallowed</triggerIfResult> <allowMultiNodeSelection> false </allowMultiNodeSelection> <triggerConcurrentBuilds> false </triggerConcurrentBuilds> <ignoreOfflineNodes> false </ignoreOfflineNodes> <nodeEligibility class= "org.jvnet.jenkins.plugins.nodelabelparameter.node.AllNodeEligibility" /> </org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterDefinition> </parameterDefinitions> </hudson.model.ParametersDefinitionProperty> </properties> <scm class= "hudson.scm.NullSCM" /> <canRoam> true </canRoam> <disabled> true </disabled> <blockBuildWhenDownstreamBuilding> false </blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding> false </blockBuildWhenUpstreamBuilding> <triggers> <hudson.triggers.TimerTrigger> <spec>H/30 * * * *</spec> </hudson.triggers.TimerTrigger> </triggers> <concurrentBuild> false </concurrentBuild> <builders> <hudson.plugins.groovy.SystemGroovy plugin= "groovy@2.0" > <source class= "hudson.plugins.groovy.StringSystemScriptSource" > <script plugin= "script-security@1.34" > <script> import hudson.matrix.* import hudson.model.* hudsonInstance = hudson.model.Hudson.instance allItems = hudsonInstance.getAllItems(AbstractProject.class); // Iterate over all jobs and find the ones that have a hudson.plugins.git.util.BuildData // as an action. // // We then clean it by removing the useless array action.buildsByBranchName // for (job in allItems) { println(&quot;job: &quot; + job.name); def counter = 0; for (build in job.getBuilds()) { // It is possible for a build to have multiple BuildData actions // since we can use the Mulitple SCM plugin. def gitActions = build.getActions(hudson.plugins.git.util.BuildData.class) if (gitActions != null ) { for (action in gitActions) { action.buildsByBranchName = new HashMap&lt; String , Build&gt;(); hudson.plugins.git.Revision r = action.getLastBuiltRevision(); if (r != null ) { for (branch in r.getBranches()) { action.buildsByBranchName.put(branch.getName(), action.lastBuild) } } build.actions.remove(action) build.actions.add(action) build.save(); counter++; } } if (job instanceof MatrixProject) { def runcounter = 0; for (run in build.getRuns()) { gitActions = run.getActions(hudson.plugins.git.util.BuildData.class) if (gitActions != null ) { for (action in gitActions) { action.buildsByBranchName = new HashMap&lt; String , Build&gt;(); hudson.plugins.git.Revision r = action.getLastBuiltRevision(); if (r != null ) { for (branch in r.getBranches()) { action.buildsByBranchName.put(branch.getName(), action.lastBuild) } } run.actions.remove(action) run.actions.add(action) run.save(); runcounter++; } } } if (runcounter &gt; 0) { println(&quot; --&gt;&gt; cleaned: &quot; + runcounter + &quot; runs&quot;); } } } if (counter &gt; 0) { println(&quot;-- cleaned: &quot; + counter + &quot; builds&quot;); } }</script> <sandbox> false </sandbox> </script> </source> </hudson.plugins.groovy.SystemGroovy> </builders> <publishers/> <buildWrappers> <hudson.plugins.timestamper.TimestamperBuildWrapper plugin= "timestamper@1.8.8" /> <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin= "ansicolor@0.5.2" > <colorMapName>gnome-terminal</colorMapName> </hudson.plugins.ansicolor.AnsiColorBuildWrapper> </buildWrappers> </project>
          Hide
          puneeth_n Puneeth Nanjundaswamy added a comment -

          Oleg Nenashev I narrowed the troubling job that caused these errors. I have 3 MultiJobProject projects that throw these errors.

          Show
          puneeth_n Puneeth Nanjundaswamy added a comment - Oleg Nenashev I narrowed the troubling job that caused these errors. I have 3 MultiJobProject projects that throw these errors.
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Did the workaround above help you?

          Show
          oleg_nenashev Oleg Nenashev added a comment - Did the workaround above help you?
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Nothing left to do here about EnvInject IMO

          Show
          oleg_nenashev Oleg Nenashev added a comment - Nothing left to do here about EnvInject IMO
          Hide
          yorammi Yoram Michaeli added a comment -

          Closing issue as part of tikal-multijob-plugin issues cleanup.
          If still relevant, please open a matching issue in https://github.com/jenkinsci/tikal-multijob-plugin/issues (you can refer to this issue in its description)

          Show
          yorammi Yoram Michaeli added a comment - Closing issue as part of tikal-multijob-plugin issues cleanup. If still relevant, please open a matching issue in https://github.com/jenkinsci/tikal-multijob-plugin/issues (you can refer to this issue in its description)

            People

            • Assignee:
              Unassigned
              Reporter:
              puneeth_n Puneeth Nanjundaswamy
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: