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

ownership-plugin loading failure on startup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ownership-plugin
    • None
    • jenkins/jenkins:lts (2.121.3)
      ownership-plugin 0.12.1
      matrix-auth 2.3

      Oownership plugin (0.12.1) fails to load (on Jenkins startup) when a matrix is configured in "Setup default permissions for jobs item-specific security" / "Enable project-based security".

      Here is jenkins.log when it fails:

      Sep 07, 2018 10:41:14 AM jenkins.InitReactorRunner$1 onAttained
      INFO: Started initialization
      Sep 07, 2018 10:41:14 AM jenkins.InitReactorRunner$1 onAttained
      INFO: Listed all plugins
      Sep 07, 2018 10:41:15 AM jenkins.InitReactorRunner$1 onTaskFailed
      SEVERE: Failed Loading plugin Job and Node ownership plugin v0.12.1 (ownership)
      java.io.IOException: Failed to initialize
      	at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:542)
      	at hudson.PluginManager$2$1$1.run(PluginManager.java:517)
      	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068)
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.io.IOException: Unable to read /var/jenkins_home/ownership.xml
      	at hudson.XmlFile.unmarshal(XmlFile.java:181)
      	at hudson.XmlFile.unmarshal(XmlFile.java:161)
      	at hudson.Plugin.load(Plugin.java:267)
      	at com.synopsys.arc.jenkins.plugins.ownership.OwnershipPlugin.load(OwnershipPlugin.java:111)
      	at com.synopsys.arc.jenkins.plugins.ownership.OwnershipPlugin.start(OwnershipPlugin.java:104)
      	at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:550)
      	at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:539)
      	... 9 more
      Caused by: java.lang.AssertionError: class hudson.security.AuthorizationMatrixProperty is missing its descriptor
      	at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1516)
      	at hudson.model.JobProperty.getDescriptor(JobProperty.java:105)
      	at hudson.model.JobProperty.getDescriptor(JobProperty.java:79)
      	at org.jenkinsci.plugins.matrixauth.AuthorizationContainer.add(AuthorizationContainer.java:79)
      	at org.jenkinsci.plugins.matrixauth.AbstractAuthorizationContainerConverter.unmarshalContainer(AbstractAuthorizationContainerConverter.java:82)
      	at org.jenkinsci.plugins.matrixauth.AbstractAuthorizationPropertyConverter.unmarshalContainer(AbstractAuthorizationPropertyConverter.java:90)
      	at org.jenkinsci.plugins.matrixauth.AbstractAuthorizationPropertyConverter.unmarshalContainer(AbstractAuthorizationPropertyConverter.java:38)
      	at org.jenkinsci.plugins.matrixauth.AbstractAuthorizationContainerConverter.unmarshal(AbstractAuthorizationContainerConverter.java:94)
      	at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:468)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      	at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:393)
      	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:331)
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      	at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:393)
      	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:331)
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	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:161)
      	at hudson.util.XStream2.unmarshal(XStream2.java:132)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
      	at hudson.XmlFile.unmarshal(XmlFile.java:178)
      	... 15 more
      
      Sep 07, 2018 10:41:18 AM jenkins.InitReactorRunner$1 onAttained
      INFO: Prepared all plugins
      Sep 07, 2018 10:41:18 AM jenkins.InitReactorRunner$1 onAttained
      INFO: Started all plugins
      

      I've been able to reproduce the issue with a fresh Jenkins instance (jenkins/jenkins:lts - it was 2.121.3 today).

      You will find in attachment:

      • plugins.txt: the list of plugins isntalled on my test instance
      • screenshot of a working configuration (Jenkins can be restarted), and the corresponding ownership.xml
      • screenshot of a broken configuration (plugin won't load when restarting Jenkins), and the corresponding ownership.xml

      The difference between these two configurations is just one checkbox in the matrix.
      On the ownership.xml side, this difference is just one line:
      /com.synopsys.arc.jenkins.plugins.ownership.OwnershipPlugin/defaultJobsSecurity/permissionsMatrix/permission=hudson.model.Item.Build:anonymous

      As far as I can tell, the problematic configuration does not trigger any runtime error until Jenkins is restarted.

        1. ownership-config-KO.png
          80 kB
          Thomas de Grenier de Latour
        2. ownership-config-OK.png
          80 kB
          Thomas de Grenier de Latour
        3. ownership-KO.xml
          2 kB
          Thomas de Grenier de Latour
        4. ownership-OK.xml
          2 kB
          Thomas de Grenier de Latour
        5. plugins.txt
          0.3 kB
          Thomas de Grenier de Latour

            oleg_nenashev Oleg Nenashev
            tom_gl Thomas de Grenier de Latour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: