New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to authenticate with private Github repo - fails build every time #103

Closed
joeandaverde opened this Issue Dec 26, 2014 · 7 comments

Comments

Projects
None yet
6 participants
@joeandaverde

joeandaverde commented Dec 26, 2014

The Github client is prompting for username when trying to clone private repo. It fails with:

[bunch of stuff show in image below]
Cloning into '/var/myorg/myrepo'...
fatal: could not read Username for 'https://github.com': No such device or address

I have provided client access key and authorized the application to have access to private repos through OAuth.

Jenkins ver. 1.595

May be related to #102

image

@joeandaverde

This comment has been minimized.

Show comment
Hide comment
@joeandaverde

joeandaverde Dec 27, 2014

I got this to work by creating a docker image that had a credential stored on the disk at ~/.git-credential. I also set git config --global credential.helper store. The format for the .git-credentials file should look like this:

https://<TOKEN>:x-oauth-basic@github.com

Replace with an Github OAuth Token. See https://help.github.com/articles/git-automation-with-oauth-tokens/

This could also be fixed if the git clone command contained the token:password like this:

git clone https://<TOKEN>:x-oauth-basic@github.com/org/repo

However, it would require a code change to make this happen by default. You COULD change the Github project url to include the credentials for each project but that's cumbersome.

joeandaverde commented Dec 27, 2014

I got this to work by creating a docker image that had a credential stored on the disk at ~/.git-credential. I also set git config --global credential.helper store. The format for the .git-credentials file should look like this:

https://<TOKEN>:x-oauth-basic@github.com

Replace with an Github OAuth Token. See https://help.github.com/articles/git-automation-with-oauth-tokens/

This could also be fixed if the git clone command contained the token:password like this:

git clone https://<TOKEN>:x-oauth-basic@github.com/org/repo

However, it would require a code change to make this happen by default. You COULD change the Github project url to include the credentials for each project but that's cumbersome.

@joeandaverde joeandaverde changed the title from Unable to authenticate with Github repo - fails build every time to Unable to authenticate with private Github repo - fails build every time Dec 27, 2014

@Dinoshauer

This comment has been minimized.

Show comment
Hide comment
@Dinoshauer

Dinoshauer Feb 4, 2015

Following this, as I would like to use dotCI with our private repos 👍

Dinoshauer commented Feb 4, 2015

Following this, as I would like to use dotCI with our private repos 👍

@Dinoshauer

This comment has been minimized.

Show comment
Hide comment
@Dinoshauer

Dinoshauer Feb 4, 2015

Just a correction to @joeandaverde 's temporary solution with a .git-credential file it should be named .git-credentials 👍 for that!

Dinoshauer commented Feb 4, 2015

Just a correction to @joeandaverde 's temporary solution with a .git-credential file it should be named .git-credentials 👍 for that!

@justicel

This comment has been minimized.

Show comment
Hide comment
@justicel

justicel Feb 20, 2015

@suryagaddipati I'm stuck on solving for this issue. Just wanted to +1 this as an issue for myself as well.

justicel commented Feb 20, 2015

@suryagaddipati I'm stuck on solving for this issue. Just wanted to +1 this as an issue for myself as well.

@pcorliss

This comment has been minimized.

Show comment
Hide comment
@pcorliss

pcorliss Mar 5, 2015

Same issue here.

pcorliss commented Mar 5, 2015

Same issue here.

@vineetbaldwa

This comment has been minimized.

Show comment
Hide comment
@vineetbaldwa

vineetbaldwa Apr 8, 2015

Same issue here with trying to load a private repo as a git submodule.

vineetbaldwa commented Apr 8, 2015

Same issue here with trying to load a private repo as a git submodule.

@suryagaddipati

This comment has been minimized.

Show comment
Hide comment
@suryagaddipati

suryagaddipati Apr 22, 2015

Contributor

Private repos now work in 2.7.1 using Docker compose build type

Contributor

suryagaddipati commented Apr 22, 2015

Private repos now work in 2.7.1 using Docker compose build type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment