7
votes

I am unable to get a successful connection to my GitHub repository from my TeamCity configuration.

When I perform a "Test Connection", I get the message;

Test connection failed in ***** :: Pull-Build-Test. List remote refs failed: com.jcraft.jsch.JSchException: session is down.

From the teamcity-server.log I get:

WARN - jetbrains.buildServer.SERVER - jetbrains.buildServer.serverSide.ExecutionException: Failed to collect changes, error: List remote refs failed: com.jcraft.jsch.JSchException: session is down.

I am using TeamCity 7.1 on Ubuntu LTS 12.

I have tried both a password and private key authentication, but both give the same message (above).

2
If you use default private key you must keep in mind that TeamCity server/agent can run as different users, so you will have to setup crypto keys for them properly. - Sergey K.
What about using a standard username and password option? - Koekiebox
i never tried it myself. - Sergey K.
Maybe it is TW-24074, also check if you use the correct username, for github it should be git - neverov

2 Answers

12
votes

For others that come across this error in search of solving TeamCity / git connection issues:

The error List remote refs failed: com.jcraft.jsch.JSchException: session is down can also appear because you have entered a Username as a part of the GIT connection details is not required because the connection uses ssh keys, in my case connecting to CodeBaseHQ.com service.

Also consider your general GIT configuration settings, using the Test Connection button is always a good idea.

3
votes

The problem was related to the server I was pointing to.

Bottom line, my bad.