Jenkins and Git Error Returned Status Code 128:

19,127 views
Skip to first unread message

angel.w...@centrallogic.com

unread,
Sep 9, 2015, 7:12:07 PM9/9/15
to Jenkins Users
How do I allow jenkins to access GIT source from the VSOnline GIT source?


Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe -c core.askpass=true ls-remote -h 'https://company.visualstudio.com/DefaultCollection/_git/Company HEAD" returned status code 128:
stdout: 

I set up an alternate authentication method on my account in VSOnline but I still can't access it.

Someone suggested I use a commandline option in a build step but am unfamiliar with how to do that as well..

Any help would be greatly appreciated.

Mark Waite

unread,
Sep 9, 2015, 7:50:57 PM9/9/15
to Jenkins Users
Some of the things you can test to see if any of them help:
  1. Use a command line git version that is new enough to support credentials (1.8 or newer is enough, 1.7.10 is also reported to work)
  2. Confirm you can clone your repository using command line git and the specific URL, username and password
  3. Add a Jenkins credential with username and password, then use that credential with a Jenkins  job to see if the repository is cloned
  4. Confirm you can clone your repository using command line git and the URL https://username:pass...@company.visualstudio.com/DefaultCollection/_git/Company/
  5. Try a test job with URL https://username:pass...@company.visualstudio.com/DefaultCollection/_git/Company/
  6. Try a test job with the prior credential and URL https://user...@company.visualstudio.com/DefaultCollection/_git/Company/
Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e2d491cb-34e4-4729-b0a5-d9db22979bbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

angel.w...@centrallogic.com

unread,
Sep 10, 2015, 2:40:41 PM9/10/15
to Jenkins Users
Mark,

Can you supply a commandline to use.. that is how new to GIT I am and if you know a good site for details on GIT that I can get up to speed on it.


On Wednesday, September 9, 2015 at 5:50:57 PM UTC-6, Mark Waite wrote:
Some of the things you can test to see if any of them help:
  1. Use a command line git version that is new enough to support credentials (1.8 or newer is enough, 1.7.10 is also reported to work)
  2. Confirm you can clone your repository using command line git and the specific URL, username and password
  3. Add a Jenkins credential with username and password, then use that credential with a Jenkins  job to see if the repository is cloned
  1. Confirm you can clone your repository using command line git and the URL https://username:password@company.visualstudio.com/DefaultCollection/_git/Company/
  2. Try a test job with URL https://username:password@company.visualstudio.com/DefaultCollection/_git/Company/
  3. Try a test job with the prior credential and URL https://username@company.visualstudio.com/DefaultCollection/_git/Company/
Mark Waite

Mark Waite

unread,
Sep 10, 2015, 5:42:56 PM9/10/15
to jenkins...@googlegroups.com
If you're new to git, then I'd suggest the following steps to have some quick, positive experiences that will also confirm your Jenkins installation is working reasonably.  Those steps may also help you identify areas where you need to fine tune or improve your Jenkins installation.
  1. Add JGit as a git installation from the "Manage Jenkins", "Configure System", "Git installations" 
  2. Confirm the JGit installation works by creating a job which clones a publicly accessible git repository (either git://github.com/jenkinsci/git-client-plugin.git or https://github.com/jenkinsci/git-client-plugin). That job will show you that your git installation is sufficient to clone the repository
  3. Install command line git on your Jenkins server and slaves
  4. Confirm the command line git installation works by creating a job which clones a publicly accessible git repository (same repositories as were used for JGit)
  5. Confirm JGit works with your repository by creating a job which clones your private repository
  6. Confirm command line git works with your repository by creating a job which clones your repository
Those steps should give you several initial successes with Jenkins and give you confidence that you have the git plugin working at its most fundamental level.

To learn more about Git, there are youtube videos, online books, and more.

Mark Waite

On Thu, Sep 10, 2015 at 12:40 PM <angel.w...@centrallogic.com> wrote:
Mark,

Can you supply a commandline to use.. that is how new to GIT I am and if you know a good site for details on GIT that I can get up to speed on it.


On Wednesday, September 9, 2015 at 5:50:57 PM UTC-6, Mark Waite wrote:
Some of the things you can test to see if any of them help:
  1. Use a command line git version that is new enough to support credentials (1.8 or newer is enough, 1.7.10 is also reported to work)
  2. Confirm you can clone your repository using command line git and the specific URL, username and password
  3. Add a Jenkins credential with username and password, then use that credential with a Jenkins  job to see if the repository is cloned
  1. Confirm you can clone your repository using command line git and the URL https://username:pass...@company.visualstudio.com/DefaultCollection/_git/Company/
  2. Try a test job with URL https://username:pass...@company.visualstudio.com/DefaultCollection/_git/Company/
  3. Try a test job with the prior credential and URL https://user...@company.visualstudio.com/DefaultCollection/_git/Company/
Mark Waite

On Wed, Sep 9, 2015 at 5:12 PM <angel.w...@centrallogic.com> wrote:
How do I allow jenkins to access GIT source from the VSOnline GIT source?


Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe -c core.askpass=true ls-remote -h 'https://company.visualstudio.com/DefaultCollection/_git/Company HEAD" returned status code 128:
stdout: 

I set up an alternate authentication method on my account in VSOnline but I still can't access it.

Someone suggested I use a commandline option in a build step but am unfamiliar with how to do that as well..

Any help would be greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

angel.w...@centrallogic.com

unread,
Sep 16, 2015, 5:41:16 PM9/16/15
to Jenkins Users
Mark,

I can through jenkins do a complete commandline clone, checkout and all what I can't do is get the GIT Plugin/ Source inside a job do it without that type of access i can't use scm polling at all to start a build if there are changes.  I do not do daily builds unles there is a change.

I can't do any of these due to the error when I try to setup the repository in Jenkins:
    1. Add a Jenkins credential with username and password, then use that credential with a Jenkins  job to see if the repository is cloned


    On Thursday, September 10, 2015 at 3:42:56 PM UTC-6, Mark Waite wrote:
    If you're new to git, then I'd suggest the following steps to have some quick, positive experiences that will also confirm your Jenkins installation is working reasonably.  Those steps may also help you identify areas where you need to fine tune or improve your Jenkins installation.
    1. Add JGit as a git installation from the "Manage Jenkins", "Configure System", "Git installations" 
    2. Confirm the JGit installation works by creating a job which clones a publicly accessible git repository (either git://github.com/jenkinsci/git-client-plugin.git or https://github.com/jenkinsci/git-client-plugin). That job will show you that your git installation is sufficient to clone the repository
    3. Install command line git on your Jenkins server and slaves
    4. Confirm the command line git installation works by creating a job which clones a publicly accessible git repository (same repositories as were used for JGit)
    5. Confirm JGit works with your repository by creating a job which clones your private repository
    6. Confirm command line git works with your repository by creating a job which clones your repository
    Those steps should give you several initial successes with Jenkins and give you confidence that you have the git plugin working at its most fundamental level.

    To learn more about Git, there are youtube videos, online books, and more.

    Mark Waite
    On Thu, Sep 10, 2015 at 12:40 PM <angel.w...@centrallogic.com> wrote:
    Mark,

    Can you supply a commandline to use.. that is how new to GIT I am and if you know a good site for details on GIT that I can get up to speed on it.


    On Wednesday, September 9, 2015 at 5:50:57 PM UTC-6, Mark Waite wrote:
    Some of the things you can test to see if any of them help:
    1. Use a command line git version that is new enough to support credentials (1.8 or newer is enough, 1.7.10 is also reported to work)
    2. Confirm you can clone your repository using command line git and the specific URL, username and password
    3. Add a Jenkins credential with username and password, then use that credential with a Jenkins  job to see if the repository is cloned
    1. Confirm you can clone your repository using command line git and the URL https://username:password@company.visualstudio.com/DefaultCollection/_git/Company/
    2. Try a test job with URL https://username:password@company.visualstudio.com/DefaultCollection/_git/Company/
    3. Try a test job with the prior credential and URL https://username@company.visualstudio.com/DefaultCollection/_git/Company/
    Mark Waite

    angel.w...@centrallogic.com

    unread,
    Sep 16, 2015, 6:06:55 PM9/16/15
    to Jenkins Users
    Again this is the error I get if I supply credentials via the GIT source code setup traditionaly:
    Failed to connect to repository : Command "C:\Git\cmd\git.exe -c core.askpass=true ls-remote -h https://company.visualstudio.com/DefaultCollection/_git/CompanyHEAD" returned status code 128:
    stdout:
    stderr: fatal: unable to access 'https://company.visualstudio.com/DefaultCollection/_git/Company/': error setting certificate verify locations:
      CAfile: C:/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
      CApath: none

    I get this error:
    Failed to connect to repository : Command "C:\Git\cmd\git.exe -c core.askpass=true ls-remote -h https://user:pass...@company.visualstudio.com/DefaultCollection/_git/Company HEAD" returned status code 128:
    stdout:
    stderr: fatal: unable to access 'https://user:pass...@company.visualstudio.com/DefaultCollection/_git/Company/': error setting certificate verify locations:
      CAfile: C:/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
      CApath: none

    Mark Waite

    unread,
    Sep 16, 2015, 7:58:31 PM9/16/15
    to Jenkins Users
    I created https://markwaite.visualstudio.com/ .  I was able to upload the git client plugin source code and checkout from that repository into a Jenkins job using my Visual Studio Online user name and password in the credentials associated with the Jenkins job.  

    I confirmed I could checkout on Windows and Linux machines using both command line git and JGit as the implementation.  I used https://markwaite.visualstudio.com/DefaultCollection/_git/git-client-plugin as the git URL.

    I was not able to clone using https://username:password@markwaite.visualstudio.com/DefaultCollection/_git/git-client-plugin (where I replaced username with my user name and password with my password).

    It could be that you're encountering an unexpected incompatibility between your version of git and Visual Studio Online (possibly as described in http://stackoverflow.com/questions/3778042/github-error-cloning-my-private-repository )

    I'm not sure what other ideas to offer you.  One of the cases you described works for me.  

    One of the cases you described (username:password) also fails for me.  I suspect that is the same git plugin bug which causes bitbucket repositories with username and password embedded in the URL to fail.  Refer to https://issues.jenkins-ci.org/browse/JENKINS-26757 for more information on that bug.

    Thanks,
    Mark Waite

    --
    You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
    Reply all
    Reply to author
    Forward
    0 new messages