• 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
          ownership-config-KO.png
          80 kB
        2. ownership-config-OK.png
          ownership-config-OK.png
          80 kB
        3. ownership-KO.xml
          2 kB
        4. ownership-OK.xml
          2 kB
        5. plugins.txt
          0.3 kB

          [JENKINS-53466] ownership-plugin loading failure on startup

          Some more info, not sure they're much useful:

          • this issue also happens with come older LTS (2.107.3) and latest weekly (2.141)
          • this issue also happens with -Djenkins.InitReactorRunner.concurrency=1
          • when booting Jenkins with -Djenkins.model.Jenkins.logStartupPerformance=true, I can see the matrix-auth plugin (which provides the "missing" descriptor) is correctly loaded before the ownership plugin
          • when booting Jenkins without the ownership plugin, but with the "broken" ownership.xml file (ownership-KO.xml) already in place, and then dynamically adding the ownership plugin (0.12.1) via the update center, it loads just fine (and its global configuration is as expected, as in ownership-config-KO.png):
            Sep 10, 2018 3:03:20 PM hudson.model.UpdateCenter$DownloadJob run
            INFO: Starting the installation of Job and Node ownership on behalf of admin
            Sep 10, 2018 3:03:22 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download
            INFO: Downloading Job and Node ownership
            Sep 10, 2018 3:03:23 PM hudson.PluginManager dynamicLoad
            INFO: Attempting to dynamic load /var/jenkins_home/plugins/ownership.jpi
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Started initialization
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Listed all plugins
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Prepared all plugins
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Started all plugins
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Augmented all extensions
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Loaded all jobs
            Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained
            INFO: Completed initialization
            Sep 10, 2018 3:03:23 PM hudson.PluginManager dynamicLoad
            INFO: Plugin ownership:0.12.1 dynamically installed
            Sep 10, 2018 3:03:23 PM hudson.model.UpdateCenter$DownloadJob run
            INFO: Installation successful: Job and Node ownership
            

           

          Thomas de Grenier de Latour added a comment - Some more info, not sure they're much useful: this issue also happens with come older LTS (2.107.3) and latest weekly (2.141) this issue also happens with -Djenkins.InitReactorRunner.concurrency=1 when booting Jenkins with -Djenkins.model.Jenkins.logStartupPerformance=true , I can see the matrix-auth plugin (which provides the "missing" descriptor) is correctly loaded before the ownership plugin when booting Jenkins without the ownership plugin, but with the "broken" ownership.xml file ( ownership-KO.xml ) already in place, and then dynamically adding the ownership plugin (0.12.1) via the update center, it loads just fine (and its global configuration is as expected, as in ownership-config-KO.png ): Sep 10, 2018 3:03:20 PM hudson.model.UpdateCenter$DownloadJob run INFO: Starting the installation of Job and Node ownership on behalf of admin Sep 10, 2018 3:03:22 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download INFO: Downloading Job and Node ownership Sep 10, 2018 3:03:23 PM hudson.PluginManager dynamicLoad INFO: Attempting to dynamic load /var/jenkins_home/plugins/ownership.jpi Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Started initialization Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Listed all plugins Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Prepared all plugins Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Started all plugins Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Augmented all extensions Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Loaded all jobs Sep 10, 2018 3:03:23 PM jenkins.InitReactorRunner$1 onAttained INFO: Completed initialization Sep 10, 2018 3:03:23 PM hudson.PluginManager dynamicLoad INFO: Plugin ownership:0.12.1 dynamically installed Sep 10, 2018 3:03:23 PM hudson.model.UpdateCenter$DownloadJob run INFO: Installation successful: Job and Node ownership  

          Oleg Nenashev added a comment -

          I believe the only good way is to actually remove the dependency on Matrix Auth at all. It is needed only for the item-specific security, and actually inheriting code of Matrix Auth was a bad idea in any case.

          I was unable to reproduce it on my side with 2.150.1, but it's definitely a defect somewhere

          Oleg Nenashev added a comment - I believe the only good way is to actually remove the dependency on Matrix Auth at all. It is needed only for the item-specific security, and actually inheriting code of Matrix Auth was a bad idea in any case. I was unable to reproduce it on my side with 2.150.1, but it's definitely a defect somewhere

            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: