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

Priority Sorter throws NullPointerException when update configuration

      When we tried to update Global Settings, we've got a crash and we found these stack in jenkins logs:

      mars 08, 2021 12:53:43 PM AVERTISSEMENT org.eclipse.jetty.server.handler.ContextHandler$Context logError while serving http://marketplace.jenkins.april.interne.fr/configSubmit
      java.lang.NullPointerException
      	at jenkins.advancedqueue.PrioritySorterConfiguration.updatePriorities(PrioritySorterConfiguration.java:179)
      	at jenkins.advancedqueue.PrioritySorterConfiguration.configure(PrioritySorterConfiguration.java:99)
      	at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:3847)
      	at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:3811)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      Caused: java.lang.reflect.InvocationTargetException
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)

      See full stacktrace in joined file...

          [JENKINS-65049] Priority Sorter throws NullPointerException when update configuration

          Oleg Nenashev added a comment -

          Looks like the configuration got submitted without the priority strategy definition. Not sure what caused that...

          Could you please confirm that the Jenkins version is 2.249.3 and not the recent weekly?

          Oleg Nenashev added a comment - Looks like the configuration got submitted without the priority strategy definition. Not sure what caused that... Could you please confirm that the Jenkins version is 2.249.3 and not the recent weekly?

          Joël Royer added a comment - - edited

          I confirm Jenkins version : 2.249.3.

          The error occurred right after installing the plugin. We were never able to change the settings.

           

          Joël Royer added a comment - - edited I confirm Jenkins version : 2.249.3. The error occurred right after installing the plugin. We were never able to change the settings.  

          Frank Ittermann added a comment - - edited

          Can you provide the `jenkins.advancedqueue.PriorityConfiguration.xml` and `jenkins.advancedqueue.PrioritySorterConfiguration.xml` file content.

          It should be in your jenkins master home (JENKINS_HOME) directory.

          Frank Ittermann added a comment - - edited Can you provide the `jenkins.advancedqueue.PriorityConfiguration.xml` and `jenkins.advancedqueue.PrioritySorterConfiguration.xml` file content. It should be in your jenkins master home (JENKINS_HOME) directory.

          Joël Royer added a comment -

          Files have been attached to this issue.

          Please note that we were forced to remove the plugin.

          Joël Royer added a comment - Files have been attached to this issue. Please note that we were forced to remove the plugin.

          There is an error in the provided `jenkins.advancedqueue.PriorityConfiguration.xml` file. 

          ...
          <priorityStrategies>        
            <jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder>          
              <id>0</id>        
          </jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder>      
          </priorityStrategies>
          ...

          It should more look like this.

          <priorityStrategies>        
            <jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder>          
              <id>0</id>          
              <priorityStrategy class="jenkins.advancedqueue.priority.strategy.UserIdCauseStrategy">            
                <priority>1</priority>          
              </priorityStrategy>
            </jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder>
          </priorityStrategies>

          The property `priorityStrategy` is missing and this cause a NullPointerException at Runtime.

          If you would add the missing property the plugin should work as expected.

          Frank Ittermann added a comment - There is an error in the provided `jenkins.advancedqueue.PriorityConfiguration.xml` file.  ... <priorityStrategies> <jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder> <id>0</id> </jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder> </priorityStrategies> ... It should more look like this. <priorityStrategies> <jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder> <id>0</id> <priorityStrategy class= "jenkins.advancedqueue.priority.strategy.UserIdCauseStrategy" > <priority>1</priority> </priorityStrategy> </jenkins.advancedqueue.JobGroup_-PriorityStrategyHolder> </priorityStrategies> The property `priorityStrategy` is missing and this cause a NullPointerException at Runtime. If you would add the missing property the plugin should work as expected.

          Joël Royer added a comment -

          Ok but those files were created as is by the plugin when we installed it.

          Joël Royer added a comment - Ok but those files were created as is by the plugin when we installed it.

            Unassigned Unassigned
            jroyer Joël Royer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: