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

NPE when using jobs with the same name in different folders

    XMLWordPrintable

Details

    Description

      When using the same basic item name for more than one job in different folders, and those items are used in a pipeline, the view is not displayed (Error communicating to server! Server Error)

      The stacktrace shows an NPE:

      Caused by: java.lang.NullPointerException
      	at org.jgrapht.graph.AbstractGraph.assertVertexExist(Unknown Source)
      	at org.jgrapht.graph.AbstractBaseGraph$DirectedSpecifics.getEdgeContainer(Unknown Source)
      	at org.jgrapht.graph.AbstractBaseGraph$DirectedSpecifics.outDegreeOf(Unknown Source)
      	at org.jgrapht.graph.AbstractBaseGraph.outDegreeOf(Unknown Source)
      	at se.diabol.jenkins.pipeline.domain.Stage.findAllRunnablePaths(Stage.java:267)
      	at se.diabol.jenkins.pipeline.domain.Stage.placeStages(Stage.java:225)
      	at se.diabol.jenkins.pipeline.domain.Stage.extractStages(Stage.java:164)
      	at se.diabol.jenkins.pipeline.domain.Pipeline.extractPipeline(Pipeline.java:123)
      	at se.diabol.jenkins.pipeline.DeliveryPipelineView.getComponent(DeliveryPipelineView.java:323)
      	at se.diabol.jenkins.pipeline.DeliveryPipelineView.getPipelines(DeliveryPipelineView.java:293)
      	... 90 more
      

      The reason is that ProjectUtil.getAllDownstreamProjects() stores the projects in a map using the simple name as a key. So of all equally named projects only one is retained, so the firstProject is usually not found as vertex in the graph leading to the NPE.

      I will create a Pull Request for that.

      Attachments

        Issue Links

          Activity

            paux Stephan Pauxberger created issue -
            paux Stephan Pauxberger made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-27270 [ JENKINS-27270 ]
            paux Stephan Pauxberger made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            patbos Patrik Boström made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 161748 ] JNJira + In-Review [ 208560 ]

            People

              patbos Patrik Boström
              paux Stephan Pauxberger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: