4

I am getting this error when doing a test connection against my git repository from TeamCity Enterprise 9.1.3 . Can anybody explain this error more closely?

Test connection failed in List remote refs failed: org.eclipse.jgit.errors.TransportException: https://git_repo_url: git-upload-pack not permitted

Share_Improve
  • 417
  • 5
  • 15
  • What is authentication method? Have you tested if you have permission on repository for user you're authenticating with? – sarbis Feb 01 '17 at 15:06
  • I am having this same problem. I am an administrator on the repo, and I can clone the repo outside of team city. – Nathan Tregillus May 09 '17 at 15:44

3 Answers3

4

I also had this problem last week. Github disabled username/password auth on 13 August 2021, causing our TeamCity authentication to break with the OP's error.

Solution was to

  • log in to GitHub via the browser, using the username we use within TeamCity
  • Go to https://github.com/settings/tokens and generate a new access token. For us full access to 'repo' but no other rights seems to work. Give it whatever expiry date fits your security requirements.
  • Update TeamCity VCS settings to use that access token as the 'password', keeping the 'username' as normal.
Rory
  • 40,559
  • 52
  • 175
  • 261
2

I'm very glad and excited to share my experience.

Test connection failed with exactly correct password/acess token.

Teamcity VCS

Suddenly, I checked gitconfig, git config --global --get credential.helper, I found there is

[credential]
    helper = store

I solved by :

git config --global --unset credential.helper

After dinner, Teamcity VCS works again. Teamcity VCS

Samt
  • 109
  • 8
  • Under which user account did you run those `git` commands? When I run them I get a message like `fatal: unable to read config file 'C:/Windows/system32/.gitconfig': No such file or directory` (when logged in as the service account), and a similar error with a normal users directory when I log in as my user account. – Rory Aug 17 '21 at 09:42
  • 1
    @Rory I run `git` commands under user which starts Teamcity application. On Linux server, I launched Teamcity by `root`, thus all commands teamcity process executes are also run as `root`. Now I see your question is, `.gitconfig` offen exists in %USERPROFILE% on Windows, if not, `git` will find git 'system' folder. On my PC, `git config --system -e` opens `C:\Program Files\Git\etc`, if you do not have permission or 'system' `.gitconfig` not exists, you may not installed git properly. – Samt Sep 25 '21 at 06:25
0

For bitbucket, you would just create an app password to fix this issue.

https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/#Create-an-app-password

the username should not be in email format, bitbucket will have a username assigned when you would have created the account.

you will also see errors such as unauthorized when directly using the https username and password login.

bitbucket has enforced this Mar 1 onwards, as read at this article deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity