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

Mercurial plugin cannot find installation in multibranch pipeline environment

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.73.1
      Mercurial 2.1
      Pipeline 2.5
    • Similar Issues:

      Description

      The mercurial plugin cannot find mercurial installation when multibranch pipeline configuration. 

      In the logs it says: 

       
      {{[Thu Sep 21 20:56:18 UTC 2017] Starting branch indexing... }}
      {{ERROR: No configured Mercurial installation }}
      {{[Thu Sep 21 21:15:36 UTC 2017] Finished branch indexing. Indexing took 19 min }}
      Finished: SUCCESS
       
      It appears that multibranch pipeline uses MercurialSCMSource.retrieve method. The code exempt that I analyzed is below:

       

      try (MercurialSCMSourceRequest request= new MercurialSCMSourceContext<>(criteria, observer).withCredentialsId(credentialsId).withTraits(traits).newRequest(this, listener) ) {

          MercurialInstallation inst = MercurialSCM.findInstallation(request.installation());
          if (inst == null) {
              listener.error("No configured Mercurial installation");
              return;
      {{    }}}

       

      In that code, it appears that the MercurialSCMSourceContext never has "installation" field initialized. MercurialSCMSourceRequest (request) gets its installation from the context, thus it is always null in that trace. The next line MercurialSCM.findInstallation will be called with a null parameter, and it always returns null in that case. It appears that inst is always null and we always get "No configured Mercurial installation", even though we have. 

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kartal Kartal Tabak
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: