After further investigation, here is a summary of my analysis (Please feel free to comment)
CVS Polling fails due to missing private Key, even though the CVS checkout/update as part of a manually triggered build works fine. The path to private key (as part of SCM polling) contains the unexpanded $HOME variable, as indicated in the log.
I think the issue is caused by the following line of code in AbstractCvs.java (Line 509)
final EnvVars envVars = project.getLastBuild().getEnvironment(listener);
As the envVars now doesnt seem to contains HOME variable.
Note: While doing the CVS update/checkout, the envVars seem to be obtained from the current instance of build run containing HOME variable. And that's why the CVS update/checkout works fine.
final EnvVars envVars = build.getEnvironment(listener);
I am not sure yet what the best way to approach this problem is. Few things I am exploring are
- Investigate why getLastBuild().getEnvironment(listener) doesnt seem to contain HOME variable
- Modifying protected PollingResult compareRemoteRevisionWith to obtain complete list of envVars
Any help or pointers in the right direction would be highly appreciated.