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

Support google cloud source repos with git client plugin

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • git-client-plugin
    • None
    • Jenkins 2.190.1
      Git client plugin 3.0.0-beta11

      Google cloud source repositories can host Git repositories (optionally copied from Bitbucket or GitHub) on Google cloud infrastructure.

      When I configured a Google cloud source repository with my Google account, it offered an SSH url format that is not supported by the Jenkins git client plugin. The URL format is:

      ssh://mark.earl.waite@gmail.com@source.developers.google.com:2022/p/jenkins-plugins-markewaite/r/github_markewaite_git-client-plugin
      

      Note that there is an extra '@' character embedded in the username portion of that ssh URL. I've never seen the '@' character as an allowed part of the username or password in a URL, but I assume it must be allowed.

      When the git client plugin checks the remote server for branches, it detects the branches correctly using the git ls-remote command. However, when it attempts to clone the repository, the message is:

      Fetching upstream changes from ssh://mark.earl.waite%40gmail.com@source.developers.google.com:2022/p/jenkins-plugins-markewaite/r/github_markewaite_git-client-plugin
       > git fetch --tags --force --progress --prune -- ssh://mark.earl.waite%40gmail.com@source.developers.google.com:2022/p/jenkins-plugins-markewaite/r/github_markewaite_git-client-plugin +refs/heads/*:refs/remotes/google-cloud/* # timeout=10
      ERROR: Error fetching remote repo 'google-cloud'
      hudson.plugins.git.GitException: Failed to fetch from ssh://mark.earl.waite%40gmail.com@source.developers.google.com:2022/p/jenkins-plugins-markewaite/r/github_markewaite_git-client-plugin
      	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:897)
      	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1112)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1143)
      	at hudson.scm.SCM.checkout(SCM.java:504)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      	at hudson.model.Run.execute(Run.java:1815)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --prune -- ssh://mark.earl.waite%40gmail.com@source.developers.google.com:2022/p/jenkins-plugins-markewaite/r/github_markewaite_git-client-plugin +refs/heads/*:refs/remotes/google-cloud/*" returned status code 128:
      stdout: 
      stderr: Host key verification failed.
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1985)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:563)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      	at hudson.remoting.Request$2.run(Request.java:369)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to testing-a-jagent
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
      		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
      		at hudson.remoting.Channel.call(Channel.java:957)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      		at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
      		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      		at java.lang.reflect.Method.invoke(Method.java:498)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      		at com.sun.proxy.$Proxy95.execute(Unknown Source)
      		at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:895)
      		at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1112)
      		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1143)
      		at hudson.scm.SCM.checkout(SCM.java:504)
      		at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
      		at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      		at hudson.model.Run.execute(Run.java:1815)
      		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      		at hudson.model.ResourceController.execute(ResourceController.java:97)
      		at hudson.model.Executor.run(Executor.java:429)
      ERROR: Error fetching remote repo 'google-cloud'
      

      The issue may be due to the changes in the git plugin that allowed embedded username and password. The issue may be that the SSH URL is invalid if it contains an embedded '@' character. More research is needed.

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: