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

Pipeline job not saving script configuration when mixing-security-realm-plugin installed

      When I'm saving pipeline job configuration with pipeline script filled or pipeline script from SCM selected and next I'm trying to edit job configuration again it always load with empty pipeline script (as in attachment).

      Job's config.xml file has proper data. The job can be run and will successfully perform all the steps.

      If I reconfigure and save it with empty pipeline script, the script will be lost.

      After uninstallation of mixing-security-realm-plugin everything back to normal.

          [JENKINS-67055] Pipeline job not saving script configuration when mixing-security-realm-plugin installed

          Andrii Hava added a comment -

          Same problem.
          If plugin installed and enabled, the pipeline script code empty, even if it was there before. If doesn't save job then it will works like usual.
          Its seams that web interface cant load full pipeline config from file, but can save to it. And after save, it clear pipeline script part.

          How to reproduce.
          Install Jenkins
          Install Mixing Security Realm 1.3 plugin
          Create pipeline
          In new opened page:
          go to Pipeline -> Definition -> choose Pipeline script -> select Try sample pipeline Hello world -> save job
          Run this job -> Confirm success result
          Edit job -> confirm that Pipeline script  empty.
          Don't do any changes and don't press save, go back, run job once again to see that script still there.
          And after that  do some changes in job, save, run, see that job result has no code to execute.

          Jenkins 2.303.2
          Run on bare metal from rpm repo
          CentOS 7
          Java 8

          Andrii Hava added a comment - Same problem. If plugin installed and enabled, the pipeline script code empty, even if it was there before. If doesn't save job then it will works like usual. Its seams that web interface cant load full pipeline config from file, but can save to it. And after save, it clear pipeline script part. How to reproduce. Install Jenkins Install Mixing Security Realm 1.3 plugin Create pipeline In new opened page: go to Pipeline -> Definition -> choose Pipeline script -> select Try sample pipeline Hello world -> save job Run this job -> Confirm success result Edit job -> confirm that Pipeline script  empty. Don't do any changes and don't press save, go back, run job once again to see that script still there. And after that  do some changes in job, save, run, see that job result has no code to execute. Jenkins 2.303.2 Run on bare metal from rpm repo CentOS 7 Java 8

          Ali added a comment -

          same issue here

          Ali added a comment - same issue here

          Anyone get a solution to this I've had the same symptoms crop up.

          Michael Carter added a comment - Anyone get a solution to this I've had the same symptoms crop up.

          Assuming my issue is the same but I did some digging on my end.

          debug varStatus: org.apache.commons.jelly.tags.core.ForEachTag$LoopStatus@7f3e1b8d
          debug var.....: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition$DescriptorImpl@72d8eb26
          debug currDesc: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition$DescriptorImpl@6904e8d2
          debug var..... name: Pipeline script
          debug currDesc name: Pipeline script
          debug var.....   id: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition
          debug currDesc   id: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition
          debug var......xml.: 
          debug currDesc.xml.: 

          Seems the comparison is against "memory address" and the two objects don't come up as equal.    So I think somewhere the code did a new()

          Michael Carter added a comment - Assuming my issue is the same but I did some digging on my end. debug varStatus: org.apache.commons.jelly.tags.core.ForEachTag$LoopStatus@7f3e1b8d debug var.....: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition$DescriptorImpl@72d8eb26 debug currDesc: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition$DescriptorImpl@6904e8d2 debug var..... name: Pipeline script debug currDesc name: Pipeline script debug var..... id: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition debug currDesc id: org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition debug var......xml.: debug currDesc.xml.: Seems the comparison is against "memory address" and the two objects don't come up as equal.    So I think somewhere the code did a new()

          Tried changing the condition in the jelly to:

                <f:dropdownListBlock value="${loop.index}" title="${descriptor.displayName}"
                  selected="${current.descriptor.getClass().getName() == descriptor.getClass().getName() || (current==null and descriptor==attrs.default)}" staplerClass="${descriptor.clazz.name}"
                  lazy="descriptor,it,${capture}">
                  <l:ajax>
                    <!--<j:set var="instance" value="${current.descriptor==descriptor ? current : null}" /> -->
                    <j:set var="instance" value="${current.descriptor.getClass().getName() == descriptor.getClass().getName() ? current : null}" />
                    <st:include from="${descriptor}" page="${descriptor.configPage}" optional="true" />
                  </l:ajax>
                </f:dropdownListBlock>
           

          Basically adding the getClass().getName() as the comparison.   Works like a charm.

          Michael Carter added a comment - Tried changing the condition in the jelly to:       <f:dropdownListBlock value= "${loop.index}" title= "${descriptor.displayName}"         selected= "${current.descriptor.getClass().getName() == descriptor.getClass().getName() || (current== null and descriptor==attrs. default )}" staplerClass= "${descriptor.clazz.name}"         lazy= "descriptor,it,${capture}" >         <l:ajax>           <!--<j:set var = "instance" value= "${current.descriptor==descriptor ? current : null }" /> -->           <j:set var = "instance" value= "${current.descriptor.getClass().getName() == descriptor.getClass().getName() ? current : null }" />           <st:include from= "${descriptor}" page= "${descriptor.configPage}" optional= " true " />         </l:ajax>       </f:dropdownListBlock> Basically adding the getClass().getName() as the comparison.   Works like a charm.

          Managed to track down the problem.   So I was using the GlobalConfiguration's all().get(class) function.   JiraTestDataPublisher seems when it malfunctions access my plugin to do something... which was causing the duplicate when the page loaded.    Was playing cat and mouse with the trace once I found it.  I'd fix one package JiraTestDataPublisher would pick some other area of my code.   Now I'm using ExtensionList.lookup instead.

          Looking at the plugin above... it's also called the all() function.

           

          Any case found my solution so I'm good .

          Michael Carter added a comment - Managed to track down the problem.   So I was using the GlobalConfiguration's all().get(class) function.   JiraTestDataPublisher seems when it malfunctions access my plugin to do something... which was causing the duplicate when the page loaded.    Was playing cat and mouse with the trace once I found it.  I'd fix one package JiraTestDataPublisher would pick some other area of my code.   Now I'm using ExtensionList.lookup instead. Looking at the plugin above... it's also called the all() function.   Any case found my solution so I'm good .

          Same issue here but we don't have the mixing-realm-security-plugin installed, the only installed plugin, related to that one, that we have is the role strategy plugin, but I fail to see what that has to do with showing an empty pipeline script section :-?

          We are on latest LTS (2.346.2) with the pipeline:job 1207.ve6191ff089f8 version, 1226.v44f718dcfe1f is not available for that LTS. Any clues on how to at least pinpoint what plugin combination may be causing the issue?

          Juan Pablo Santos Rodríguez added a comment - Same issue here but we don't have the mixing-realm-security-plugin installed, the only installed plugin, related to that one, that we have is the role strategy plugin, but I fail to see what that has to do with showing an empty pipeline script section :-? We are on latest LTS (2.346.2) with the pipeline:job 1207.ve6191ff089f8 version, 1226.v44f718dcfe1f is not available for that LTS. Any clues on how to at least pinpoint what plugin combination may be causing the issue?

          Mark Waite added a comment -

          I suspect that the root of the problem is the use of the HTML table tag in the mixing security realm plugin. Jenkins 2.277.1 and later use div tags for for form layout rather than table tags.

          I don't have any guess for the separate issue reported by juanpablo, since it does not involve the mixing security realm plugin that is the basis of this report. juanpablo please use the steps in the table to div investigation instructions to create a new issue with the detailed information that will allow others to duplicate the issue that you are seeing. The issue that you are seeing may have the same symptoms as this issue but it is most unlikely that it has the same root cause as this issue.

          Mark Waite added a comment - I suspect that the root of the problem is the use of the HTML table tag in the mixing security realm plugin. Jenkins 2.277.1 and later use div tags for for form layout rather than table tags. I don't have any guess for the separate issue reported by juanpablo , since it does not involve the mixing security realm plugin that is the basis of this report. juanpablo please use the steps in the table to div investigation instructions to create a new issue with the detailed information that will allow others to duplicate the issue that you are seeing. The issue that you are seeing may have the same symptoms as this issue but it is most unlikely that it has the same root cause as this issue.

          markewaite thanks for the pointers! they're definitely helpful I'll dig down through our plugin list and open a new issue if deemed necessary

          Juan Pablo Santos Rodríguez added a comment - markewaite thanks for the pointers! they're definitely helpful I'll dig down through our plugin list and open a new issue if deemed necessary

          Mark Waite added a comment -

          Closing as a duplicate of JENKINS-70366

          Mark Waite added a comment - Closing as a duplicate of JENKINS-70366

            Unassigned Unassigned
            orzechszek orzech szek
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: