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

NPE in OldDataMonitor when reading selenium.xml

    Details

    • Similar Issues:

      Description

      SEVERE: Failed Loading plugin Jenkins Selenium Plugin v3.7.2-SNAPSHOT (private-847941f7-nenashev) (selenium)
      java.io.IOException: Failed to initialize
      	at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:531)
      	at hudson.PluginManager$2$1$1.run(PluginManager.java:515)
      	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
      	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1063)
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.IOException: Unable to read /Users/nenashev/Documents/jenkins/plugins/selenium-plugin/work/selenium.xml
      	at hudson.XmlFile.unmarshal(XmlFile.java:182)
      	at hudson.XmlFile.unmarshal(XmlFile.java:162)
      	at hudson.Plugin.load(Plugin.java:264)
      	at hudson.plugins.selenium.PluginImpl.start(PluginImpl.java:143)
      	at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:539)
      	at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:528)
      	... 9 more
      Caused by: com.thoughtworks.xstream.converters.ConversionException: null : null
      ---- Debugging information ----
      cause-exception     : java.lang.NullPointerException
      cause-message       : null
      class               : hudson.plugins.selenium.PluginImpl
      required-type       : hudson.plugins.selenium.PluginImpl
      converter-type      : hudson.util.RobustReflectionConverter
      path                : /hudson.plugins.selenium.PluginImpl
      line number         : 31
      version             : not available
      -------------------------------
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
      	at hudson.util.XStream2.unmarshal(XStream2.java:147)
      	at hudson.util.XStream2.unmarshal(XStream2.java:118)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
      	at hudson.XmlFile.unmarshal(XmlFile.java:179)
      	... 14 more
      Caused by: java.lang.NullPointerException
      	at hudson.diagnosis.OldDataMonitor.report(OldDataMonitor.java:220)
      	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:371)
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	... 24 more
      
      Jan 17, 2018 1:44:03 PM jenkins.InitReactorRunner$1 onAttained
      INFO: Prepared all plugins
      Jan 17, 2018 1:44:03 PM jenkins.InitReactorRunner$1 onAttained
      INFO: Started all plugins
      Jan 17, 2018 1:44:03 PM jenkins.InitReactorRunner$1 onAttained
      
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Rouke Broersma Could you please provide /extra/jenkins/selenium.xml from your instance?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Rouke Broersma Could you please provide /extra/jenkins/selenium.xml from your instance?
            Hide
            mobrockers Rouke Broersma added a comment -

            I no longer run a Jenkins instance with this plugin so I cannot provide the file from my instance.

            Show
            mobrockers Rouke Broersma added a comment - I no longer run a Jenkins instance with this plugin so I cannot provide the file from my instance.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Rouke Broersma sorry, my intention was to ask Björn Pedersen who reported the issue

            Show
            oleg_nenashev Oleg Nenashev added a comment - Rouke Broersma sorry, my intention was to ask Björn Pedersen who reported the issue
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Rouke Broersma BTW, you are listed as a plugin lead in JIRA. Just in case we need a fix for this issue (needs to be confirmed first), would you be able to spin the release?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Rouke Broersma BTW, you are listed as a plugin lead in JIRA. Just in case we need a fix for this issue (needs to be confirmed first), would you be able to spin the release?
            Hide
            pedersen Björn Pedersen added a comment -

            Just added the selenium.xml file

            Show
            pedersen Björn Pedersen added a comment - Just added the selenium.xml file
            Hide
            mobrockers Rouke Broersma added a comment - - edited

            Oleg Nenashev I can spin a release yes. I am a bit rusty on plugin config stuff but I think any @Exported thing can cause this problem right? In the plugin sources I found the following exotic exports that were not simple string, int, bool values. A number of them I think will probably save as string anyway because of transitive Exports further down in the object (unless that does not happen by default, like I said, rusty) but maybe this list can help you narrow down if it's caused by JEP-200:

             

            @Exported
            public Map<String, String> getCapabilities() {
            return capabilities;
            }
            
            @Exported
            public List<SeleniumBrowser> getBrowsers() {
            return browsers;
            }
            
            @Exported
            public SeleniumConfigurationMatcher getMatcher() {
            return matcher;
            }
            
            @Exported
            public List<WebDriverBrowser> getBrowsers() {
            return browsers;
            }
            
            @Exported
            public HostnameResolver getHostnameResolver() {
            return hostnameResolver;
            }
            
            @Exported( inline = true )
            public Collection<SeleniumTestSlotGroup> getRemoteControls() throws IOException, InterruptedException {
            
            @Exported
            public List<SeleniumGlobalConfiguration> getGlobalConfigurations() {
            return configurations;
            }
            
            Show
            mobrockers Rouke Broersma added a comment - - edited Oleg Nenashev  I can spin a release yes. I am a bit rusty on plugin config stuff but I think any @Exported thing can cause this problem right? In the plugin sources I found the following exotic exports that were not simple string, int, bool values. A number of them I think will probably save as string anyway because of transitive Exports further down in the object (unless that does not happen by default, like I said, rusty) but maybe this list can help you narrow down if it's caused by JEP-200:   @Exported public Map< String , String > getCapabilities() { return capabilities; } @Exported public List<SeleniumBrowser> getBrowsers() { return browsers; } @Exported public SeleniumConfigurationMatcher getMatcher() { return matcher; } @Exported public List<WebDriverBrowser> getBrowsers() { return browsers; } @Exported public HostnameResolver getHostnameResolver() { return hostnameResolver; } @Exported( inline = true ) public Collection<SeleniumTestSlotGroup> getRemoteControls() throws IOException, InterruptedException { @Exported public List<SeleniumGlobalConfiguration> getGlobalConfigurations() { return configurations; }
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            OK, it seems that the plugin fails to convert a valid structure due to whatever reason

            Caused: com.thoughtworks.xstream.converters.ConversionException: null : null ---- Debugging information ---- cause-exception : java.lang.NullPointerException cause-message : null class : hudson.plugins.selenium.PluginImpl required-type : hudson.plugins.selenium.PluginImpl converter-type : hudson.util.RobustReflectionConverter path : /hudson.plugins.selenium.PluginImpl line number : 31 version : not available ------------------------------- at
            

            Whatever happens, it definitely looks like a bug in the Jenkins core.
            It fails because Old Data Monitor is null at the timeframe of data migration.

            I will try to reproduce it once I have progress on JENKINS-48983

            Show
            oleg_nenashev Oleg Nenashev added a comment - OK, it seems that the plugin fails to convert a valid structure due to whatever reason Caused: com.thoughtworks.xstream.converters.ConversionException: null : null ---- Debugging information ---- cause-exception : java.lang.NullPointerException cause-message : null class : hudson.plugins.selenium.PluginImpl required-type : hudson.plugins.selenium.PluginImpl converter-type : hudson.util.RobustReflectionConverter path : /hudson.plugins.selenium.PluginImpl line number : 31 version : not available ------------------------------- at Whatever happens, it definitely looks like a bug in the Jenkins core. It fails because Old Data Monitor is null at the timeframe of data migration. I will try to reproduce it once I have progress on JENKINS-48983
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Rouke Broersma thanks! It's unlikely (Exporting does not use whitelist) but I will keep it in mind

            Show
            oleg_nenashev Oleg Nenashev added a comment - Rouke Broersma thanks! It's unlikely (Exporting does not use whitelist) but I will keep it in mind
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Björn Pedersen Would you be able to run a "return hudson.diagnosis.OldDataMonitor.get(jenkins.model.Jenkins.instance)" command in the System console? Just to exclude the obvious thing.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Björn Pedersen Would you be able to run a "return hudson.diagnosis.OldDataMonitor.get(jenkins.model.Jenkins.instance)" command in the System console? Just to exclude the obvious thing.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Cannot reproduce that issue with Selenium locally, but I will keep trying

            Show
            oleg_nenashev Oleg Nenashev added a comment - Cannot reproduce that issue with Selenium locally, but I will keep trying
            Hide
            mobrockers Rouke Broersma added a comment -

            Oleg Nenashev Keep in mind that according to the selenium config provided by Björn Pedersen they are running version 2.3 of the plugin which is really old. The latest plugin version might not actually have the issue so perhaps that's why you can't reproduce.

            Show
            mobrockers Rouke Broersma added a comment - Oleg Nenashev Keep in mind that according to the selenium config provided by Björn Pedersen they are running version 2.3 of the plugin which is really old. The latest plugin version might not actually have the issue so perhaps that's why you can't reproduce.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I have verified the issue on the latest version of the plugin.

            • The provided config XML fails on 2.102
            • It fails on 2.101 as well...

            Whatever the root cause of this issue is, it is not a JEP-200 regression AFAICT. But I will triage it to make sure

            Show
            oleg_nenashev Oleg Nenashev added a comment - I have verified the issue on the latest version of the plugin. The provided config XML fails on 2.102 It fails on 2.101 as well... Whatever the root cause of this issue is, it is not a JEP-200 regression AFAICT. But I will triage it to make sure
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Likely it is something in the core

            Show
            oleg_nenashev Oleg Nenashev added a comment - Likely it is something in the core
            Hide
            mobrockers Rouke Broersma added a comment - - edited

            There were some issues with config not being correctly converted to new plugin config versions in the past. Perhaps their config version is just not compatible with the new versions of the plugin (and the conversion is not working properly). Perhaps it's not a Jenkins problem at all, but simply the plugin having a bug.

            Show
            mobrockers Rouke Broersma added a comment - - edited There were some issues with config not being correctly converted to new plugin config versions in the past. Perhaps their config version is just not compatible with the new versions of the plugin (and the conversion is not working properly). Perhaps it's not a Jenkins problem at all, but simply the plugin having a bug.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Meanwhile I ran Plugin Compatibility Tester. With all current tests the plugin works well on Jenkins 2.102

            Show
            oleg_nenashev Oleg Nenashev added a comment - Meanwhile I ran Plugin Compatibility Tester. With all current tests the plugin works well on Jenkins 2.102
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Rouke Broersma Maybe we will have to split it to two issues. Old Data Monitor failing with NPE does seem like a core bug, independently of what causes that.
            If you prefer, I can move it to a separate ticket.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Rouke Broersma Maybe we will have to split it to two issues. Old Data Monitor failing with NPE does seem like a core bug, independently of what causes that. If you prefer, I can move it to a separate ticket.
            Hide
            mobrockers Rouke Broersma added a comment -

            The selenium bug does not really have priority as no users of the plugin should be on such an old version anyway. You can keep the ticket for the core bug and I will create my own.

            Show
            mobrockers Rouke Broersma added a comment - The selenium bug does not really have priority as no users of the plugin should be on such an old version anyway. You can keep the ticket for the core bug and I will create my own.
            Hide
            pedersen Björn Pedersen added a comment -

            "return hudson.diagnosis.OldDataMonitor.get(jenkins.model.Jenkins.instance)"

             =>

             

            hudson.diagnosis.OldDataMonitor@b3fef1

             

            Show
            pedersen Björn Pedersen added a comment - "return hudson.diagnosis.OldDataMonitor.get(jenkins.model.Jenkins.instance)"  =>   hudson.diagnosis.OldDataMonitor@b3fef1  
            Hide
            pedersen Björn Pedersen added a comment -

            An update: After all other plugins that had JEP-200 problems are fixed, this error is gone again.

            Show
            pedersen Björn Pedersen added a comment - An update: After all other plugins that had JEP-200 problems are fixed, this error is gone again.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            OK, so let's consider that there is no new issues in the Selenium plugin itself.
            I will handle this ticket on the core's side

            Show
            oleg_nenashev Oleg Nenashev added a comment - OK, so let's consider that there is no new issues in the Selenium plugin itself. I will handle this ticket on the core's side
            Hide
            apetres Petres Andras added a comment -

            I ran into the same issue when working on a change on gerrit-trigger plugin. My guess is that OldDataMonitor gets initialized after the plugin is loaded.

            What I did was removing a field from a persisted class. After Jenkins gets restarted it tries to load the old config XML file (which contains the deleted field) and boom, it cannot report it because OldDataMonitor is null.

            Show
            apetres Petres Andras added a comment - I ran into the same issue when working on a change on gerrit-trigger plugin. My guess is that OldDataMonitor gets initialized after the plugin is loaded. What I did was removing a field from a persisted class. After Jenkins gets restarted it tries to load the old config XML file (which contains the deleted field) and boom, it cannot report it because OldDataMonitor is null.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Diagnostics was improved in 2.163.

            Petres Andras if you still experience the issue, it would be great to have updated stacktraces after the update

            Show
            oleg_nenashev Oleg Nenashev added a comment - Diagnostics was improved in 2.163. Petres Andras if you still experience the issue, it would be great to have updated stacktraces after the update

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                pedersen Björn Pedersen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: