-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins version 1.598; Git plugin 2.3.4
The SO question describes my exact problem down to the log file: http://stackoverflow.com/questions/27786733/why-is-the-git-plugin-for-jenkins-rewriting-my-local-git-repo-url-with-extra-sla
[Repost Summary]
-----------------------
I'm having an issue right now trying to set up a Jenkins job (on one Windows server) to monitor an internal Git repo located on a Gitosis server (on a different Windows server).
The url looks like this: ssh://git@192.168.0.1:relative_path/repo.git (real values replaced for security, also the relative path will not work with a '~/', it only works without a leading '/').
When running git clone from the command line with the url, everything comes out fine.
When configuring a Git SCM in the Jenkins job it is able to run an ls-remote command (this confirms that the ssh keys are properly configured for the Jenkins instance).
However when the job executes, the url appears to be rewritten with an additional forward slash which causes the clone command to fail.
Started by user Meh
[EnvInject] - Loading node environment variables.
Building in workspace D:\local_repo_test
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url ssh:///git@192.168.0.1:relative_path/repo.git # timeout=10
Fetching upstream changes from ssh:///git@192.168.0.1:relative_path/repo.git
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress ssh:///git@192.168.0.1:relative_path/repo.git +refs/heads/:refs/remotes/origin/
ERROR: Error fetching remote repo 'origin'
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
It's the '///' that bothers me. Has anyone seen anything like this?
Any help on this would be appreciated.
- is duplicated by
-
JENKINS-27483 Repository URL containg double points couldn't be resolved correctly.
-
- Closed
-
[JENKINS-26680] Extraneous Forward-Slash in ssh:// path to repository
Link |
New:
This issue is duplicated by |
Workflow | Original: JNJira [ 160755 ] | New: JNJira + In-Review [ 180475 ] |
I suspect there is something in the plugin which is attempting to rewrite the URL and is adding the extra slash.
I think the syntax ssh://user@hostname:relative_path/repo.git is ambiguous, though you say that it seems to be understood by git.
I use ssh://user@hostname:port_number/absolute_path/repo.git to allow my Jenkins job ssh access through port_number to a git repository on hostname at /absolute_path/repo.git. On my computer named "wheezy64b", I specify the URL as ssh://mwaite@wheezy64b:45022/var/lib/git/mwaite/jenkins/git-client-plugin.git
I can use ssh://user@hostname:ssh/absolute_path/repo.git to allow my Jenkins job ssh access through the ssh port to a git repository on hostnanme at /absolute_path/repo.git. On my computer named "mark-pc1", I specify the URL as ssh://mwaite@mark-pc1:ssh/var/lib/git/mwaite/jenkins/git-client-plugin.git
I'm impressed that the git command recognizes the relative path, since it seems like my second syntax (using the word "ssh" for the ssh port number) creates a conflicting case with your relative path case. I've been unable to make a relative path work with ssh:// syntax and the git plugin. Can you provide more details on the syntax you use which works?
I agree that this is a bug in the git plugin or the git client plugin, though considering the ambiguity in the ssh URL syntax, I don't think I will ever work on fixing that bug. The fix would need to identify those cases where the plugin rewrites the URL and intentionally decide not to rewrite the URL, at least for this case.