Reputation: 47290
Using github for windows on same machine, with same credentials works fine. Can pull/clone.
However teamcity installed as a windows service on the same machine, returns the following error
List remote refs failed: org.eclipse.jgit.errors.TransportException: https://github.com/my-private-repo.git: not authorized
Upvotes: 22
Views: 37874
Reputation: 1361
To anyone encountering this issue with using Bitbucket.
Since March 2022, you cannot use your personal credentials to connect your apps to bitbucket anymore. You need to create an app password (see here how to do it).
The identifier will not be your email adress but your Bitbucket username.
Upvotes: 1
Reputation: 358
Had the same problem with my Repo in Azure DevOps so I went to Clone then Command line selected HTTPS, Copied the url, Username and password which I used in TeamCity.
Upvotes: 0
Reputation: 1151
In bitbucket, i resolved this by creating an App Password under settings, and used the app password instead of my bitbucket password
Upvotes: 5
Reputation: 7676
You can use SSH KEYS to allow you to access the Azure TFS GIT URL, or you can modify the settings in "Alternative Credentials" by checking "Enable alternate credentials" so you can access the repository by just using a username and password.
First in Azure DevOps go to your project:
Then choose Security in the RHS menu:
Finally choose "Alternate Credentials" in the LHS menu and click the "Enable authentication alternate credentials" where you will then put in your username and password:
Please beware that this is less secure than using the SSH KEYS.
Upvotes: 1
Reputation: 784
Had the same issue and resolved it by creating a Personal Access Token in Github and using it as a password in TeamCity.
Upvotes: 3
Reputation: 2382
Try to make push/get with same credentials with local git client it could provide more details, which could be related to credentials.
This was to me since TeamCity showed same error and these solutions didnt worked.
Upvotes: 0
Reputation: 11075
Maybe not that related, but you may come here by the keywords "teamcity, github, list remote refs failed."
For those whose server is behind a proxy, please set the proxy for TeamCity server according to Connection time out: github.com
The main idea is:
To enable TeamCity to use proxy, an environment variable has to be created:
Name: TEAMCITY_SERVER_OPTS
Value: -Dhttp.proxyHost=192.168.0.1 -Dhttp.proxyPort=80 -Dhttps.proxyHost=192.168.0.1 -Dhttps.proxyPort=80
Upvotes: 0
Reputation: 47290
In case anyone else has something similar, it was the user credentials in GitHub, but I have not tracked down exactly which setting yet.
Using a different user within TeamCity works, even though I could perform a clone/fetch/pull and ls remote on command line (as the problem user).
Upvotes: 2
Reputation: 4016
I had the same error for a git server hosted on IIS.
The problem came on the scene after installing 'basic authentication' for the IIS. After that, the new authentication method 'basic authentication' was enabled (seems to be the default) for the git server's website. Disable 'basic authentication' solved the problem.
Upvotes: 0
Reputation: 4822
Having same error with Stash (=Bitbucket server) and solution was to give the user specified in TeamCity the permissions in Stash to access the repository. Permissions are per-repository.
Upvotes: 2
Reputation: 296
In teamcity, in the project VCS Root, if the authentication method is based on ssh public/private key, then the fetch URL should be like [email protected]:.../repository.git
. Using https://
in the fetch URL causes the error message:
List remote refs failed: org.eclipse.jgit.errors.TransportException..
to occur.
Upvotes: 28