Using password authentication to connect to GitLab from TeamCity

Answered

I am using TeamCity version 2017.2 on Windows to configure a VCS attached to a project build. I am using user name and password to authenticate but get an auth fail error.

I have tried the fetch and pull URL as below and populate the User Name and Password:

  1) G1DCG_BUILD@gitlab.pitneycloud.com:spectrum/platformsdk.git

  2) git@gitlab.pitneycloud.com:spectrum/platformsdk.git

  3) gitlab.pitneycloud.com:spectrum/platformsdk.git

What am I doing incorrectly here?

Thanks.

 

0
1 comment

Hi Sidney,

 

there are two things to consider. First, you are using a pretty old version which is already out of support. Particularly, multiple providers disabled their support for incoming connections using specific protocols with very few advanced notice and we introduced the fix later in the 2017.2 cycle. I can't confirm this is your case, but because you did not provide an exact error message, rather only a generic "auth fail error" we cannot currently confirm this to be the case. You might need to upgrade just for this fix if this is what is impacting your login, besides the fact that your version is anyway unsupported.

 

Regarding which kind of URL you should use, it depends on your server and what it expects as a connection string. Every single one of your urls has this "spectrum" bit at the end, which is strange. A URL:<value> usually expects <value> to be the port, if "spectrum" is the password that's usually not the place where it should go (it should be user:pass@URL/repo). Furthermore, if you use authentication via the username in the URL, you should not need to add the username to the username and password fields.

 

Consider that teamcity will use this string to pretty much pass it "as is" to the git commands, so if you would "git clone <url>/repo" in your command line, use that same url in the url field.

0

Please sign in to leave a comment.