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

Platformlabeler can generate NULL label objects on Linux

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • platformlabeler-plugin
    • None
    • Platform: All, OS: All

      While trying to save the slave config at
      http://davidkarlsen.com/hudson/computer/hudson-slave1/configSubmit

      I get:

      Status Code: 500
      Exception:
      Stacktrace:

      java.lang.NullPointerException
      at java.util.TreeMap.put(TreeMap.java:541)
      at java.util.TreeSet.add(TreeSet.java:238)
      at java.util.AbstractCollection.addAll(AbstractCollection.java:305)
      at java.util.TreeSet.addAll(TreeSet.java:295)
      at hudson.model.Node.getAssignedLabels(Node.java:187)
      at hudson.model.Slave.(Slave.java:152)
      at hudson.model.Slave.(Slave.java:130)
      at hudson.slaves.DumbSlave.(DumbSlave.java:53)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
      sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:391)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:344)
      at hudson.model.Descriptor.newInstance(Descriptor.java:351)
      at hudson.model.Computer.doConfigSubmit(Computer.java:927)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:185)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:74)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:318)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492)
      at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:144)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:408)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:117)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:64)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      at
      org.jvnet.hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:47)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:78)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      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
      org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      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
      org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      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:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.lang.Thread.run(Thread.java:619)

      Generated by Winstone Servlet Engine v0.9.10 at Mon Nov 23 02:27:34 CET 2009

          [JENKINS-4924] Platformlabeler can generate NULL label objects on Linux

          lifeless added a comment -

          David, could you please tell me the operating system and java version of that slave?

          lifeless added a comment - David, could you please tell me the operating system and java version of that slave?

          davidkarlsen added a comment -

          Linux dmz1.davidkarlsen.com 2.6.26-2-xen-686 #1 SMP Wed Nov 4 23:23:33 UTC 2009 i686 GNU/Linux

          dmz1:/opt# java -version
          java version "1.6.0_17"
          Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
          Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

          davidkarlsen added a comment - Linux dmz1.davidkarlsen.com 2.6.26-2-xen-686 #1 SMP Wed Nov 4 23:23:33 UTC 2009 i686 GNU/Linux dmz1:/opt# java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

          lifeless added a comment -

          Thanks. Two more questions:

          What distribution are you running?
          what does 'lsb_release -a' show for you?

          lifeless added a comment - Thanks. Two more questions: What distribution are you running? what does 'lsb_release -a' show for you?

          davidkarlsen added a comment -

          dmz1:~# cat /etc/debian_version
          5.0.3

          lsb-core wasn't installed, installed it now:
          dmz1:/opt# lsb_release -a
          LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch
          Distributor ID: Debian
          Description: Debian GNU/Linux 5.0.3 (lenny)
          Release: 5.0.3
          Codename: lenny

          davidkarlsen added a comment - dmz1:~# cat /etc/debian_version 5.0.3 lsb-core wasn't installed, installed it now: dmz1:/opt# lsb_release -a LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch Distributor ID: Debian Description: Debian GNU/Linux 5.0.3 (lenny) Release: 5.0.3 Codename: lenny

          lifeless added a comment -

          Ok, can you:

          • record the labels the node has
          • take the node offline and online again (to refresh the labels)
          • record the new labels values

          Theory: with lsb_release missing, we're getting null rather than falling back appropriately, may be a bug in my lsbrelease module.

          lifeless added a comment - Ok, can you: record the labels the node has take the node offline and online again (to refresh the labels) record the new labels values Theory: with lsb_release missing, we're getting null rather than falling back appropriately, may be a bug in my lsbrelease module.

          davidkarlsen added a comment -

          Seems to work fine now - thanks!

          davidkarlsen added a comment - Seems to work fine now - thanks!

          lifeless added a comment -

          Ok, cool. I would have liked to have seen the labels you were getting, but I should have enough to figure out whats going on now.

          lifeless added a comment - Ok, cool. I would have liked to have seen the labels you were getting, but I should have enough to figure out whats going on now.

          lifeless added a comment -

          Ok, confirmed, net.robertcollins.ldb.Release.Release() returns null if lsb-release isn't installed. This is fine at that layer. but the hudson plugin can't return null labels.

          lifeless added a comment - Ok, confirmed, net.robertcollins.ldb.Release.Release() returns null if lsb-release isn't installed. This is fine at that layer. but the hudson plugin can't return null labels.

          Code changed in hudson
          User: : lifeless
          Path:
          trunk/hudson/plugins/platformlabeler/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=24305
          Log:
          Fix JENKINS-4924, NPE when lsb_release not installed on unix machines.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : lifeless Path: trunk/hudson/plugins/platformlabeler/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java http://fisheye4.cenqua.com/changelog/hudson/?cs=24305 Log: Fix JENKINS-4924 , NPE when lsb_release not installed on unix machines.

          lifeless added a comment -

          1.1 of the plugin fixes this.

          lifeless added a comment - 1.1 of the plugin fixes this.

            lifeless lifeless
            davidkarlsen davidkarlsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: