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

NPE after updating EnvInject Plugin from 1.90 to 1.91.1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: envinject-plugin
    • Labels:
      None
    • Environment:
      Jenkins LTS 1.596.2
    • Similar Issues:

      Description

      java.lang.NullPointerException
      at org.jenkinsci.lib.envinject.EnvInjectAction$1.transformEntry(EnvInjectAction.java:94)
      at org.jenkinsci.lib.envinject.EnvInjectAction$1.transformEntry(EnvInjectAction.java:92)
      at com.google.common.collect.Maps$TransformedEntriesMap$1$1.apply(Maps.java:1218)
      at com.google.common.collect.Maps$TransformedEntriesMap$1$1.apply(Maps.java:1216)
      at com.google.common.collect.Iterators$8.next(Iterators.java:812)
      at java.util.AbstractMap.putAll(AbstractMap.java:272)
      at java.util.TreeMap.putAll(TreeMap.java:321)
      at org.jenkinsci.lib.envinject.service.EnvInjectSavable.saveEnvironment(EnvInjectSavable.java:54)
      at org.jenkinsci.lib.envinject.EnvInjectAction.writeReplace(EnvInjectAction.java:91)
      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:616)
      at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteReplace(SerializationMethodInvoker.java:89)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:99)
      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:223)
      at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:210)
      at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:182)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:167)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
      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:178)
      at hudson.model.Run.save(Run.java:1929)
      at hudson.plugins.changelog_history.ChangeLogHistoryRunListener.copyChangeLogs(ChangeLogHistoryRunListener.java:82)
      at hudson.plugins.changelog_history.ChangeLogHistoryRunListener.onDeleted(ChangeLogHistoryRunListener.java:50)
      at hudson.plugins.changelog_history.ChangeLogHistoryRunListener.onDeleted(ChangeLogHistoryRunListener.java:40)
      at hudson.model.listeners.RunListener.fireDeleted(RunListener.java:244)
      at hudson.model.Run.delete(Run.java:1502)
      at hudson.tasks.LogRotator.perform(LogRotator.java:129)
      at hudson.model.Job.logRotate(Job.java:449)
      at hudson.model.Run.execute(Run.java:1823)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)

        Attachments

          Issue Links

            Activity

            Hide
            aheritier Arnaud Héritier added a comment -

            After few investigations this NPE comes from this commit : https://github.com/jenkinsci/envinject-lib/commit/e181ac473a9ea3d8b531ff0f061e7ca7071f7d87
            I'll send the PR tomorrow. The fix is "easy" the bug comes from the fact that when jenkins is reloaded 'sensibleVariables' (transient) is null.
            cc Nicolas De Loof

            Show
            aheritier Arnaud Héritier added a comment - After few investigations this NPE comes from this commit : https://github.com/jenkinsci/envinject-lib/commit/e181ac473a9ea3d8b531ff0f061e7ca7071f7d87 I'll send the PR tomorrow. The fix is "easy" the bug comes from the fact that when jenkins is reloaded 'sensibleVariables' (transient) is null. cc Nicolas De Loof
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Arnaud Héritier
            Path:
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
            http://jenkins-ci.org/commit/envinject-lib/b2ffaa07446a586997545fb777500efaf89c9437
            Log:
            JENKINS-27665: Avoid NPE when sensibleVariables isn't set
            usecase: EnvInjectAction.writeReplace() is called after a promotion (promoted build plugin) launched from a build recorded before jenkins was restarted. EnvInjectAction.overrideAll() isn't called thus sensibleVariables is null.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Héritier Path: src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java http://jenkins-ci.org/commit/envinject-lib/b2ffaa07446a586997545fb777500efaf89c9437 Log: JENKINS-27665 : Avoid NPE when sensibleVariables isn't set usecase: EnvInjectAction.writeReplace() is called after a promotion (promoted build plugin) launched from a build recorded before jenkins was restarted. EnvInjectAction.overrideAll() isn't called thus sensibleVariables is null.
            Hide
            aheritier Arnaud Héritier added a comment -

            a PR by Oleg Nenashev already exists to solve this problem: https://github.com/jenkinsci/envinject-lib/pull/4

            Show
            aheritier Arnaud Héritier added a comment - a PR by Oleg Nenashev already exists to solve this problem: https://github.com/jenkinsci/envinject-lib/pull/4
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
            http://jenkins-ci.org/commit/envinject-lib/8e3c2bbf549b59318a7432c368870684000fbf4e
            Log:
            Merge pull request #4 from oleg-nenashev/JENKINS-27363

            [JENKINS-27363,JENKINS-27665] - Annotate sensibleVariables (may be null)

            Compare: https://github.com/jenkinsci/envinject-lib/compare/0033cdf67151...8e3c2bbf549b

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java http://jenkins-ci.org/commit/envinject-lib/8e3c2bbf549b59318a7432c368870684000fbf4e Log: Merge pull request #4 from oleg-nenashev/ JENKINS-27363 [JENKINS-27363,JENKINS-27665] - Annotate sensibleVariables (may be null) Compare: https://github.com/jenkinsci/envinject-lib/compare/0033cdf67151...8e3c2bbf549b
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The issue should be fixed in 1.91.4. Sorry for the long delay, we did not get a response from plugin owners and had to wait for several weeks.

            Show
            oleg_nenashev Oleg Nenashev added a comment - The issue should be fixed in 1.91.4. Sorry for the long delay, we did not get a response from plugin owners and had to wait for several weeks.

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                slawomir_czarko Slawomir Czarko
              • Votes:
                7 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: