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

git parameter plugin does not apply remote setting changes

      After migrating our Bitbucket instance to a new server with a new IP address, we're not able to change the IP address to point jenkins at the new server. the Bitbucket server is behind a proxy `bitbucket.our.domain` and the url has not changed. in the pipeline, we define the scm in the first step of the first stage:

      scm: [ $class: 'GitSCM', branches: [[name: "${BRANCH}"]], userRemoteConfigs: [[credentialsId: '*******************************',url: 'ssh://git@bitbucket.our.domain:7999/project/repository.git']] ]
      

      with pipelines, the Source Code Management section does not exist, so this is the only place that the remote url is defined. Yet, when trying to Build with Parameters we get the attatched error, which is clearly not the url that has been defined.

          [JENKINS-60236] git parameter plugin does not apply remote setting changes

          Tim Bretz created issue -

          Mark Waite added a comment - - edited

          I assume that you are using static agents and thus are reusing workspaces. The git plugin is not sophisticated enough to apply the change of remote URL (or any other remote settings) to the existing workspace. If that is the case, then you can temporarily modify the pipeline script to precede the checkout scm step with a deleteDir step. That will erase the working repository in the workspace, it will then be cloned from the new URL and will write the new URL into the workspace.

          Same problem exists when a job definition changes from using a shallow clone to not using a shallow clone, or from not using a reference repository to using a reference repository. The git client plugin and the git plugin record state data about the repository in the workspace but do not force the repository in the workspace to match the current values of the plugin state data.

          Mark Waite added a comment - - edited I assume that you are using static agents and thus are reusing workspaces. The git plugin is not sophisticated enough to apply the change of remote URL (or any other remote settings) to the existing workspace. If that is the case, then you can temporarily modify the pipeline script to precede the checkout scm step with a deleteDir step. That will erase the working repository in the workspace, it will then be cloned from the new URL and will write the new URL into the workspace. Same problem exists when a job definition changes from using a shallow clone to not using a shallow clone, or from not using a reference repository to using a reference repository. The git client plugin and the git plugin record state data about the repository in the workspace but do not force the repository in the workspace to match the current values of the plugin state data.
          Mark Waite made changes -
          Component/s Original: git-parameter-plugin [ 16113 ]
          Mark Waite made changes -
          Assignee Original: Boguslaw Klimas [ klimas7 ]
          Mark Waite made changes -
          Summary Original: git plugin remote url not configurable New: git plugin does not apply remote setting changes to existing workspaces

          Tim Bretz added a comment -

          markewaite I can't reach the `deleteDir` step even though it is the first step, because I can't get passed the required parameters. I tried copying the pipeline into a new job and it was unable to read any configuration at all. 

          No Git repository configured in SCM configuration or plugin is configured wrong

           

          Tim Bretz added a comment - markewaite I can't reach the `deleteDir` step even though it is the first step, because I can't get passed the required parameters. I tried copying the pipeline into a new job and it was unable to read any configuration at all.  No Git repository configured in SCM configuration or plugin is configured wrong  

          Mark Waite added a comment -

          tbretz94 that may indicate an issue in the git parameter plugin. Are you providing the repository URL as a parameter to the job? If so, then you might try redefining the job temporarily to not parameterize the repository URL, run it with the corrected URL, then add the repository URL parameter to the job again. There may be some internal storage of the repository URL in the git parameter plugin which is not being adjusted when you change the repository URL elsewhere.

          Mark Waite added a comment - tbretz94 that may indicate an issue in the git parameter plugin. Are you providing the repository URL as a parameter to the job? If so, then you might try redefining the job temporarily to not parameterize the repository URL, run it with the corrected URL, then add the repository URL parameter to the job again. There may be some internal storage of the repository URL in the git parameter plugin which is not being adjusted when you change the repository URL elsewhere.

          Tim Bretz added a comment -

          markewaite The repository URL is only specified in the `scm` step and is not a paramter. Neither plugin has configurations available in the UI related to the remote URL. My only possible solution at this point is to change the IP of the new Bitbucket server, which amazes me that we can never change the IP because these plugins are not configurable on level beyond what is entered in the pipeline, and even then the configuration in the pipeline doesn't apply to the plugins.

          Tim Bretz added a comment - markewaite The repository URL is only specified in the `scm` step and is not a paramter. Neither plugin has configurations available in the UI related to the remote URL. My only possible solution at this point is to change the IP of the new Bitbucket server, which amazes me that we can never change the IP because these plugins are not configurable on level beyond what is entered in the pipeline, and even then the configuration in the pipeline doesn't apply to the plugins.

          Tim Bretz added a comment -

          deleting the workspace did not resolve this issue

          Tim Bretz added a comment - deleting the workspace did not resolve this issue
          Tim Bretz made changes -
          Rank New: Ranked higher

            Unassigned Unassigned
            tbretz94 Tim Bretz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: