Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
Jenkins: 1.580
Git Plugin 2.2.6 (before update 2.2.5)
All plugins up to date (21. September)
Description
Since 2.2.6 ssh credentials on git push seems to have a problem.
When i revert back to 2.2.5 everything works as expected.
I'm using jenkins credential with a ssh key.
Don't know if that has something to say, but I'm using env var's to set the git url, and in the failing log it's not resolved. But I guess the error prints it before the resolution, because the connection itself seems to work, just not the authentication.
I attached a log success.txt (with version 2.2.5) and a failing.txt (version 2.2.6). The only difference is that i reverted the plugin to 2.2.5 and everything worked again.
let me know if you need more information. But maybe so find the problem due the recent changes.
Attachments
Issue Links
- is duplicated by
-
JENKINS-24879 Git Plugin env variable resolution not working in Git Publisher
-
- Closed
-
- is related to
-
JENKINS-49834 Variable at branch name do not eval
-
- Closed
-
Hi Mark,
I also ran into the issue and had a look into the code. I try to summarize what I already found out - I hope this helps:
As the fetch is working I focused on analyzing the differences between the fetch and the push. As far as I understood the code the GitSCM holds the remote repository without expanded environment variables and expands them right before the fetch (https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L915). This step is is missing in the GitPublisher where the specified remote repository is retrieved from the gitSCM (https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitPublisher.java#L318). As this issue is urgent for our production I already started to prepare a test and fix for this issue. My naive approach would be simply do the same thing as GitSCM.getParamExpandedRepos() does right where the push command is created and executed. But as you wrote that you hit a wall here I'm a bit unconfident. Could you please share your concerns? I would need some more days to prepare a fix for a pull request but so far my first tests looked promising.