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

NPE prevents jobs using plugin from loading

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mask-passwords-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008
      Jenkins 1.436
      Mask Passwords 2.7
    • Similar Issues:

      Description

      After upgrading to 2.7 from 2.6.1, I noticed that several of my jobs were not showing up in my Jenkins dashboard.
      Looking at jenkins.err.log shows this:

      SEVERE: Failed Loading job <JOBNAME>

      hudson.util.IOException2: Unable to read <PATH_TO_JOB>\config.xml
      at hudson.XmlFile.read(XmlFile.java:137)
      at hudson.model.Items.load(Items.java:114)
      at jenkins.model.Jenkins$14.run(Jenkins.java:2357)
      at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
      at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
      at jenkins.model.Jenkins$5.runTask(Jenkins.java:798)
      at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
      at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: com.thoughtworks.xstream.converters.ConversionException: null : null
      ---- Debugging information ----
      cause-exception : java.lang.NullPointerException
      cause-message : null
      class : hudson.model.FreeStyleProject
      required-type : com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper
      path : /project/buildWrappers/com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper
      line number : 175
      -------------------------------

      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
      at hudson.util.CopyOnWriteList$ConverterImpl.unmarshal(CopyOnWriteList.java:193)
      at hudson.util.DescribableList$ConverterImpl.unmarshal(DescribableList.java:245)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
      at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:290)
      at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:233)
      at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:180)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:926)
      at hudson.util.XStream2.unmarshal(XStream2.java:91)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:912)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:864)
      at hudson.XmlFile.read(XmlFile.java:133)
      ... 10 more
      Caused by: java.lang.NullPointerException
      at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsConfig.getGlobalVarPasswordPairs(MaskPasswordsConfig.java:140)
      at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper.<init>(MaskPasswordsBuildWrapper.java:77)
      at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper$ConverterImpl.unmarshal(MaskPasswordsBuildWrapper.java:336)
      at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:293)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
      ... 34 more
      27/10/2011 1:39:51 PM jenkins.model.Jenkins$6 onTaskFailed

      The jobs that failed to load were the ones that had specified passwords.

      I tried to add a new password to the global Jenkins configuration, but the change did not save after I hit submit.
      Reverting to 2.6.1 "fixes" the problem.

        Attachments

          Activity

          Hide
          rseguy Romain Seguy added a comment -

          Reproduced: This happens if the main configuration file is already present in JENKINS_HOME. The exception actually also happens when Jenkins loads:

          27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained
          INFO: Listed all plugins
          27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained
          INFO: Prepared all plugins
          27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained
          INFO: Started all plugins
          27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained
          INFO: Augmented all extensions
          27 oct. 2011 08:36:44 hudson.model.Hudson$5 onTaskFailed
          GRAVE: Failed Loading job xx
          hudson.util.IOException2: Unable to read D:\jenkins-src\jenkins-plugins\mask-passwords\.\work\jobs\xx\config.xml
          	at hudson.XmlFile.read(XmlFile.java:130)
          	at hudson.model.Items.load(Items.java:113)
          	at hudson.model.Hudson$13.run(Hudson.java:2354)
          	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
          	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
          	at hudson.model.Hudson$4.runTask(Hudson.java:735)
          	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
          	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          	at java.lang.Thread.run(Thread.java:662)
          Caused by: com.thoughtworks.xstream.converters.ConversionException: null : null
          ---- Debugging information ----
          cause-exception     : java.lang.NullPointerException
          cause-message       : null
          class               : hudson.model.FreeStyleProject
          required-type       : com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper
          path                : /project/buildWrappers/com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper
          line number         : 25
          -------------------------------
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
          	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
          	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
          	at hudson.util.CopyOnWriteList$ConverterImpl.unmarshal(CopyOnWriteList.java:189)
          	at hudson.util.DescribableList$ConverterImpl.unmarshal(DescribableList.java:245)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
          	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
          	at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:290)
          	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:233)
          	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:180)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
          	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
          	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
          	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:926)
          	at hudson.util.XStream2.unmarshal(XStream2.java:80)
          	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:912)
          	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:856)
          	at hudson.XmlFile.read(XmlFile.java:126)
          	... 10 more
          Caused by: java.lang.NullPointerException
          	at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsConfig.getGlobalVarPasswordPairs(MaskPasswordsConfig.java:140)
          	at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper.<init>(MaskPasswordsBuildWrapper.java:77)
          	at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper$ConverterImpl.unmarshal(MaskPasswordsBuildWrapper.java:336)
          	at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:224)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
          	... 34 more
          27 oct. 2011 08:36:44 hudson.model.Hudson$5 onAttained
          INFO: Loaded all jobs
          27 oct. 2011 08:36:46 hudson.model.Hudson$5 onAttained
          INFO: Completed initialization
          

          The exception doesn't happen when starting from a blank JENKINS_HOME (which corresponds to my test case).

          Show
          rseguy Romain Seguy added a comment - Reproduced: This happens if the main configuration file is already present in JENKINS_HOME. The exception actually also happens when Jenkins loads: 27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained INFO: Listed all plugins 27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained INFO: Prepared all plugins 27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained INFO: Started all plugins 27 oct. 2011 08:36:43 hudson.model.Hudson$5 onAttained INFO: Augmented all extensions 27 oct. 2011 08:36:44 hudson.model.Hudson$5 onTaskFailed GRAVE: Failed Loading job xx hudson.util.IOException2: Unable to read D:\jenkins-src\jenkins-plugins\mask-passwords\.\work\jobs\xx\config.xml at hudson.XmlFile.read(XmlFile.java:130) at hudson.model.Items.load(Items.java:113) at hudson.model.Hudson$13.run(Hudson.java:2354) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at hudson.model.Hudson$4.runTask(Hudson.java:735) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.thoughtworks.xstream.converters.ConversionException: null : null ---- Debugging information ---- cause-exception : java.lang.NullPointerException cause-message : null class : hudson.model.FreeStyleProject required-type : com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper path : /project/buildWrappers/com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper line number : 25 ------------------------------- at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71) at hudson.util.CopyOnWriteList$ConverterImpl.unmarshal(CopyOnWriteList.java:189) at hudson.util.DescribableList$ConverterImpl.unmarshal(DescribableList.java:245) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60) at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:290) at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:233) at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:180) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60) at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:926) at hudson.util.XStream2.unmarshal(XStream2.java:80) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:912) at com.thoughtworks.xstream.XStream.fromXML(XStream.java:856) at hudson.XmlFile.read(XmlFile.java:126) ... 10 more Caused by: java.lang.NullPointerException at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsConfig.getGlobalVarPasswordPairs(MaskPasswordsConfig.java:140) at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper.<init>(MaskPasswordsBuildWrapper.java:77) at com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper$ConverterImpl.unmarshal(MaskPasswordsBuildWrapper.java:336) at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:224) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82) ... 34 more 27 oct. 2011 08:36:44 hudson.model.Hudson$5 onAttained INFO: Loaded all jobs 27 oct. 2011 08:36:46 hudson.model.Hudson$5 onAttained INFO: Completed initialization The exception doesn't happen when starting from a blank JENKINS_HOME (which corresponds to my test case).
          Hide
          rseguy Romain Seguy added a comment -

          Fixed by using a getter for globalVarPasswordPairs in MaskPasswordsConfig which checks for nullity.

          Show
          rseguy Romain Seguy added a comment - Fixed by using a getter for globalVarPasswordPairs in MaskPasswordsConfig which checks for nullity.
          Hide
          rseguy Romain Seguy added a comment -

          Workaround: Add the following line into JENKINS_HOME/com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsConfig:

          <globalVarPasswordPairs/>
          
          Show
          rseguy Romain Seguy added a comment - Workaround: Add the following line into JENKINS_HOME/com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsConfig : <globalVarPasswordPairs/>
          Hide
          rseguy Romain Seguy added a comment -

          Fixed in 2.7.1

          Show
          rseguy Romain Seguy added a comment - Fixed in 2.7.1
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: rseguy
          Path:
          src/main/java/com/michelin/cio/hudson/plugins/maskpasswords/MaskPasswordsConfig.java
          src/main/resources/com/michelin/cio/hudson/plugins/maskpasswords/MaskPasswordsBuildWrapper/global.properties
          http://jenkins-ci.org/commit/mask-passwords-plugin/d2aa32d532bc2a9b0d6d94bd7676e66bb74458bc
          Log:
          [FIXED JENKINS-11514] NPE in Mask Passwords plugin prevents jobs using the plugin from loading

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rseguy Path: src/main/java/com/michelin/cio/hudson/plugins/maskpasswords/MaskPasswordsConfig.java src/main/resources/com/michelin/cio/hudson/plugins/maskpasswords/MaskPasswordsBuildWrapper/global.properties http://jenkins-ci.org/commit/mask-passwords-plugin/d2aa32d532bc2a9b0d6d94bd7676e66bb74458bc Log: [FIXED JENKINS-11514] NPE in Mask Passwords plugin prevents jobs using the plugin from loading

            People

            • Assignee:
              rseguy Romain Seguy
              Reporter:
              capnkeelhauler Capn Keelhauler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: