Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31212

git clone with embedded username/password failed using https auth

XMLWordPrintable

      I can use "https://root:123456@gitlab.asdfsx.cn/root/helloworld.git" to clone my project.
      But when I use it in jenkins, it fails. And I got the exception below.
      U can see in log after "Fetching upstream", the password is missing

      Cloning the remote Git repository
      Cloning repository https://root:123456@gitlab.asdfsx.cn/root/helloworld.git
      > git init /jenkins/workspace/git # timeout=10
      Fetching upstream changes from https://root@gitlab.ptengine.cn/root/helloworld.git
      > git --version # timeout=10
      > git -c core.askpass=true fetch --tags --progress https://root@gitlab.ptengine.cn/root/helloworld.git +refs/heads/:refs/remotes/origin/
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress https://root@gitlab.ptengine.cn/root/helloworld.git +refs/heads/:refs/remotes/origin/" returned status code 128:
      stdout:
      stderr: fatal: Authentication failed for 'https://root@gitlab.ptengine.cn/root/helloworld.git/'

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:505)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at hudson.remoting.Engine$1$1.run(Engine.java:69)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to mesos-jenkins-adfd6047-57c5-4579-aa7f-9d3c79aaec7e(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1413)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
      at hudson.remoting.Channel.call(Channel.java:778)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
      at com.sun.proxy.$Proxy58.execute(Unknown Source)
      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1003)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
      at hudson.scm.SCM.checkout(SCM.java:485)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1275)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
      at hudson.model.Run.execute(Run.java:1741)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      ERROR: null
      Finished: FAILURE

            Unassigned Unassigned
            asdfsxsx sam sun
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: