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

Active Choices Reactive Parameter is showing sometimes empty list

    Details

    • Similar Issues:

      Description

      There are some Jenkins jobs with the Active Choices Reactive Parameter list. This list if dynamic list and the values are from the Database table and its is working fine most of the times.

      Sometimes, this list is showing empty. If Configure button is clicked followed by apply -> save without changes , its working fine.

      The operations apply -> save changes the contents of the config.xml file. The main differences are , the before changes config.xml have  <classpath/> and no <projectName>  element.

      Attached is for your reference.

        Attachments

          Activity

          Hide
          madhavi_katreddy Madhavi Katreddy added a comment -

          Any update on this issue Bruno P. Kinoshita?

           
          Show
          madhavi_katreddy Madhavi Katreddy added a comment - Any update on this issue Bruno P. Kinoshita ?  
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Madhavi Katreddy, thanks for bumping this issue. I hadn't seen it before (or just cannot remember seeing it, sorry anyway).

          The projectName variable is volatile, and may disappear after the project is renamed, or even if there is some other plugin fiddling with the XML. The plug-in, however, tries to workaround this by providing the jenkinsProject variable, which contains the jenkinsProject.name attribute.

          That jenkinsProject variable tries to use the projectName, but has a fallback mechanism to load the project info programmatically. Not perfect, but if you could try, this could be a workdaround for the time being.

          Cheers
          Bruno

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Madhavi Katreddy , thanks for bumping this issue. I hadn't seen it before (or just cannot remember seeing it, sorry anyway). The projectName variable is volatile, and may disappear after the project is renamed, or even if there is some other plugin fiddling with the XML. The plug-in, however, tries to workaround this by providing the jenkinsProject variable, which contains the jenkinsProject.name attribute. That jenkinsProject variable tries to use the projectName, but has a fallback mechanism to load the project info programmatically. Not perfect, but if you could try, this could be a workdaround for the time being. Cheers Bruno
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Oh, and you won't see that variable persisted in any XML. The plug-in creates that variable in the Groovy runtime context. So it should work as long as you use it for a Groovy script in an Active Choices parameter.

          Show
          kinow Bruno P. Kinoshita added a comment - Oh, and you won't see that variable persisted in any XML. The plug-in creates that variable in the Groovy runtime context. So it should work as long as you use it for a Groovy script in an Active Choices parameter.
          Hide
          madhavi_katreddy Madhavi Katreddy added a comment -

          That screen shot doesn't seem to be relevant to this issue. The working version of config.xml doesn't have the projectName element. 

          The jenkins jobs parameters are provided in the groovy file. So the fetching of values from DB for the active choices are in the groovy file. So, whenever there are changes to this parameter groovy file, this issue is happening( which is active choices list is empty). If I click on apply -> save without changes , its working fine.

          Show
          madhavi_katreddy Madhavi Katreddy added a comment - That screen shot doesn't seem to be relevant to this issue. The working version of config.xml doesn't have the projectName element.  The jenkins jobs parameters are provided in the groovy file. So the fetching of values from DB for the active choices are in the groovy file. So, whenever there are changes to this parameter groovy file, this issue is happening( which is active choices list is empty). If I click on apply -> save without changes , its working fine.
          Hide
          kinow Bruno P. Kinoshita added a comment - - edited

          Oh, sorry Madhavi Katreddy. So I think we can ignore the screenshot.

          Could you provide some more info like Jenkins and active-choice-plugins versions (as well as any plugin relevant if used in this job). We would also need some way to replicate the issue.

          You mentioned a database, but it would probably take me a little while to work on this issue if I needed to set up a DB server/container/etc to replicate it. Does the issue happen if you execute a normal list that is retrieved via a Groovy script, but that is not going to the database? If the answer is no, then we will probably need to consider the possibility of a bug in the Groovy script that is calling the DB...

          Hope that makes sense. Ioannis Moutsatsos and I triaged some issues a couple of weeks ago, and I am currently working through the current backlog. If it is easy to replicate and understand what's going on, I can try to include this issue in the next release.

          Otherwise we will have a look and try to include in the next one

          Cheers
          Bruno

          Show
          kinow Bruno P. Kinoshita added a comment - - edited Oh, sorry Madhavi Katreddy . So I think we can ignore the screenshot. Could you provide some more info like Jenkins and active-choice-plugins versions (as well as any plugin relevant if used in this job). We would also need some way to replicate the issue. You mentioned a database, but it would probably take me a little while to work on this issue if I needed to set up a DB server/container/etc to replicate it. Does the issue happen if you execute a normal list that is retrieved via a Groovy script, but that is not going to the database? If the answer is no, then we will probably need to consider the possibility of a bug in the Groovy script that is calling the DB... Hope that makes sense. Ioannis Moutsatsos and I triaged some issues a couple of weeks ago, and I am currently working through the current backlog. If it is easy to replicate and understand what's going on, I can try to include this issue in the next release. Otherwise we will have a look and try to include in the next one Cheers Bruno
          Hide
          ioannis Ioannis Moutsatsos added a comment -

          Hi Madhavi.

          I must say that most issues with AC reactive parameters  boil down to the values of referenced parameters. Depending on the state of your build form referenced parameter values could change (or even be null) and of course that would affect the success or failure of the AC reactive script.

          Do you have a fallback script? This is always a good way to troubleshoot. You can have a fallback script that reports the values of referenced parameters so at least you know what the script input is. Finally, you can debug your AC reactive script by running it  from the script console and hard-coding some of the input values to observe it behavior

          Hope this is helpful

          Best regards

          Ioannis

           

          Show
          ioannis Ioannis Moutsatsos added a comment - Hi Madhavi. I must say that most issues with AC reactive parameters  boil down to the values of referenced parameters. Depending on the state of your build form referenced parameter values could change (or even be null) and of course that would affect the success or failure of the AC reactive script. Do you have a fallback script? This is always a good way to troubleshoot. You can have a fallback script that reports the values of referenced parameters so at least you know what the script input is. Finally, you can debug your AC reactive script by running it  from the script console and hard-coding some of the input values to observe it behavior Hope this is helpful Best regards Ioannis  
          Hide
          madhavi_katreddy Madhavi Katreddy added a comment -

          Here are the versions:

          Jenkins (2.150.3)

          Active Choices Plug-in (2.1)

          The same issue is happening for the ACs which are querying the artifactory to get the list of artifacts. 

          I do have same script for the fallback.  The script is working fine if I click on apply -> save without changes.

          The issue is happening only if there are any changes to the groovy script which may not be related to the ACs.

          Thanks

           

          Show
          madhavi_katreddy Madhavi Katreddy added a comment - Here are the versions: Jenkins (2.150.3) Active Choices Plug-in (2.1) The same issue is happening for the ACs which are querying the artifactory to get the list of artifacts.  I do have same script for the fallback.  The script is working fine if I click on apply -> save without changes. The issue is happening only if there are any changes to the groovy script which may not be related to the ACs. Thanks  

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              madhavi_katreddy Madhavi Katreddy
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: