Change By: Ron MacNeil (07/Jan/15 3:07 AM)
Summary: Git plugin incorrectly adds trailing slash to repository  URL when it ends with  URLs containing  property reference (s) when polling
Description: We use  a  global  properties  property called "RepoRoot"  to specify :

Where
 where  our Git repositories live,  so our repository URL's look similar to:

 ${RepoRoot}

Whether or not they have a "
/RepoA .git " suffix,

 ${ RepoSuffix RepoRoot } /RepoB.git


So our repository URL These resolve correctly when the job actually runs, but we ' s look re seeing errors  similar to  the following in our polling log :

{code}
Fetching upstream changes from
${RepoRoot}/RepoA .git
 > git.exe --version # timeout=10
 > git.exe -c core.askpass=true fetch --tags --progress
${ RepoSuffix RepoRoot } /RepoA.git +refs/heads/*:refs/remotes/origin/*

FATAL: hudson.plugins.git.GitException: Failed to fetch from ${RepoRoot}/ RepoB RepoA.git
hudson.util.IOException2: hudson.plugins.git.GitException: Failed to fetch from
${ RepoSuffix RepoRoot } /RepoA.git
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:518)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:380)
When at hudson.scm.SCM.poll(SCM.java:397)
at org.jenkinsci.plugins.multiplescms.MultiSCM.compareRemoteRevisionWith(MultiSCM.java:92)
at hudson.scm.SCM.poll(SCM.java:397)
at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1462)
at hudson.model.AbstractProject._poll(AbstractProject.java:1433)
at hudson.model.AbstractProject.poll(AbstractProject.java:1344)
at hudson.triggers.SCMTrigger
 $ Runner.runPolling(SCMTrigger.java:515)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:544)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Failed to fetch from $
{ RepoSuffix RepoRoot }  is set to " /RepoA .git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:695)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:598)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:516)
... 16 more
Caused by: hudson.plugins.git.GitException: Command
" , we're seeing errors similar to the following in our polling log, note the incorrectly git.exe - added trailing slash c core.askpass=true fetch --tags --progress ${RepoRoot}/RepoA.git +refs/heads/* : refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal:  Authentication failed for  repository  'https://github.com/Foo/RepoA.git/'  not found

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1457)
I'm sure auto-adding the trailing slash was well-intentioned, but it's a case of trying to make the software too clever for its own good at org .   At the very least, there needs to be an option to disable this behaviour jenkinsci . plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1245)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:85)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:280)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:693)
... 18 more
Done. Took 2.3 sec
{code}


Thanks folks, love your work.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to