Adding a private bitbucket repo as Material to a GoCD pipeline with HTTPS authentication

1,803 views
Skip to first unread message

mta...@thoughtworks.com

unread,
Feb 16, 2016, 6:28:15 AM2/16/16
to go-cd
I'm trying to configure a GoCD installation on Windows 2012 R2 to access a private BitBucket repository over HTTPS, using Basic Auth. When I click "Check Connection" I get the following error:

STDERR: fatal: unable to access 'https://<redacted-username>:******@bitbucket.org/<redacted>/<redacted>': Failed to connect to bitbucket.org 443: Connection refused

If I run the git ls-remote command that is output in Go from a Git Bash prompt on the same machine it works.

Access to the internet is via CNTLM, with global git config set (from the Git Bash prompt) to use http://localhost:3128 for http.proxy and https.proxy.

Any ideas on how to resolve this would be much appreciated (Is Go using a different git client that is not using the global configuration that has been set?)

Mark

Ketan Padegaonkar

unread,
Feb 16, 2016, 6:32:32 AM2/16/16
to go...@googlegroups.com
Go uses the git.exe executable on PATH to execute stuff. I'd suggest you look at running `git ls-remote` from the usual command prompt `cmd.exe` instead of git bash. git bash may be doing something funny.

If you're setting proxies in global git configuration from git bash, they go in a different location. Try running this in a normal `cmd` window (tweak the file and key, value to your needs)

git config --file "C:\Program Files (x86)\Git\etc\gitconfig" <KEY> <VALUE>


--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mta...@thoughtworks.com

unread,
Feb 16, 2016, 7:14:54 AM2/16/16
to go-cd
Hi Ketan,

If I run

git config --global --list

from the standard Windows Command Prompt then I do see my proxy settings (set from Git Bash) listed. I can also run the git ls-remote command from there and it works.

I tried running the git config command you specified anyway (changing "Program Files (x86)" to "Program Files") but it made no difference.

Any other suggestions?

Thanks

Mark

mta...@thoughtworks.com

unread,
Feb 16, 2016, 8:21:13 AM2/16/16
to go-cd
Ok, I've come to a resolution.

Since the only difference I could think of between what was happening from the Command Prompt and what Go was trying to do was the account being run as (my user account vs Local System), I changed the Go Agent and Go Server services to run under my user account. This seems to have resolved the connection issue.

Thanks for your help!

Mark
Reply all
Reply to author
Forward
0 new messages