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

Pipeline parameters not properly updated in multibranch job config

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.176.2
      Plugins: see attached plugins.txt

      I have a multi-branch pipeline where I've replaced a boolean parameter with a choice parameter but the "build with parameters" page shows the old boolean parameter; this is after I've done a dummy run to pick up the change. The log reports that it read the pipeline from the latest commit on that branch (master) which has the parameter change.

      In branches/master/config.xml, I see that the new parameter is listed in the parameters element, but the definition in parameterDefinitions is the old one! Here's an excerpt of that file - the old parameter is named REBOOT_FIRST and the new one is REBOOT_WHEN:

      branches/master/config.xml
      <flow-definition plugin="workflow-job@2.33">
        <actions>
      ...
      <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="pipeline-model-definition@1.3.9">
      ...
            <parameters>
              <string>REBOOT_WHEN</string>
      ...
            </parameters>
      ...    </org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
        </actions>
      ...
        <properties>
          <hudson.model.ParametersDefinitionProperty>
            <parameterDefinitions>
              <hudson.model.BooleanParameterDefinition>
                <name>REBOOT_FIRST</name>
                <description>...</description>
                <defaultValue>true</defaultValue>
              </hudson.model.BooleanParameterDefinition>
      ...
      

      (I've elided various irrelevant bits with '...')

      So it seems like the first list has been updated, but the actual definition hasn't. THis has left me with a broken pipeline that I can't recover without editing config.xml manually and restarting Jenkins; I haven't yet tried this but I expect it to work.

      If updating any plugins would help, please advise and I'll try that, subject to my sysadmin approving.

          [JENKINS-60459] Pipeline parameters not properly updated in multibranch job config

          Allan Lewis added a comment -

          I'm not sure which plugin is responsible for this logic - apologies if I picked the wrong one!

          Allan Lewis added a comment - I'm not sure which plugin is responsible for this logic - apologies if I picked the wrong one!

          Allan Lewis added a comment -

          I just noticed that there are many hudson.model.ParametersDefinitionProperty elements in config.xml! So perhaps they're being appended instead of replaced? The excerpt in the description is from the first one, which I guess gets read in favour of the later ones.

          Allan Lewis added a comment - I just noticed that there are many hudson.model.ParametersDefinitionProperty elements in config.xml ! So perhaps they're being appended instead of replaced? The excerpt in the description is from the first one, which I guess gets read in favour of the later ones.

          John Gaunt added a comment -

          I have seen this twice now, must recently on Jenkins 2.249.3. We use the Bitbucket Branch Source plugin (v2.9.7) and can provide other plugin versions if that would help.

          I see the duplicate issue is resolved fixed but unreleased, but I can't tell what change was made or what version to expect that change to come out in.

          John Gaunt added a comment - I have seen this twice now, must recently on Jenkins 2.249.3. We use the Bitbucket Branch Source plugin (v2.9.7) and can provide other plugin versions if that would help. I see the duplicate issue is resolved fixed but unreleased, but I can't tell what change was made or what version to expect that change to come out in.

          Donnie Kim added a comment -

          Do we have any updates on this? This is a major problem in our work...

          Donnie Kim added a comment - Do we have any updates on this? This is a major problem in our work...

          Piotr added a comment -

          Jenkins team, please provide any feedback on this. It's a serious bug impacting our infrastructure.

          Piotr added a comment - Jenkins team, please provide any feedback on this. It's a serious bug impacting our infrastructure.

            Unassigned Unassigned
            allanlewis_youview Allan Lewis
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: