-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Jenkins 2.73.1
Mercurial 2.1
Pipeline 2.5
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.