git Teamcity 到 github List?remote?refs?failed 未授权 jgit
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22958859/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Teamcity to github List?remote?refs?failed not authorized jgit
提问by NimChimpsky
Using github for windows on same machine, with same credentials works fine. Can pull/clone.
在同一台机器上为 windows 使用 github,使用相同的凭据工作正常。可以拉/克隆。
However teamcity installed as a windows service on the same machine, returns the following error
但是teamcity作为windows服务安装在同一台机器上,返回以下错误
List remote refs failed: org.eclipse.jgit.errors.TransportException: https://github.com/my-private-repo.git: not authorized
回答by user4193783
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:
在teamcity中,在VCS Root项目中,如果认证方式是基于ssh公钥/私钥,那么获取的URL应该是这样的[email protected]:.../repository.git
。使用https://
在获取URL导致该错误消息:
List remote refs failed: org.eclipse.jgit.errors.TransportException..
列出远程引用失败:org.eclipse.jgit.errors.TransportException..
to occur.
发生。
回答by NimChimpsky
In case anyone else has something similar, it was the user credentials in GitHub, but I have not tracked down exactly which setting yet.
如果其他人有类似的东西,那就是 GitHub 中的用户凭据,但我还没有确切地追踪到哪个设置。
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).
在 TeamCity 中使用不同的用户是可行的,即使我可以在命令行上执行 clone/fetch/pull 和 ls remote(作为问题用户)。
回答by sawe
In bitbucket, i resolved this by creating an App Password under settings, and used the app password instead of my bitbucket password
在 bitbucket 中,我通过在设置下创建一个应用密码解决了这个问题,并使用了应用密码而不是我的 bitbucket 密码
回答by Riga
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.
Stash(=Bitbucket 服务器)有同样的错误,解决方案是授予 TeamCity 中指定的用户在 Stash 中访问存储库的权限。权限是每个存储库。
回答by user8128167
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.
您可以使用 SSH KEYS 来允许您访问 Azure TFS GIT URL,或者您可以通过选中“启用备用凭据”来修改“备用凭据”中的设置,以便您只需使用用户名和密码即可访问存储库。
First in Azure DevOps go to your project:
首先在 Azure DevOps 中转到您的项目:
Then choose Security in the RHS menu:
然后在 RHS 菜单中选择 Security:
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:
最后在 LHS 菜单中选择“Alternate Credentials”并单击“Enable authentication替代凭据”,然后您将在其中输入您的用户名和密码:
Please beware that this is less secure than using the SSH KEYS.
请注意,这不如使用 SSH KEYS 安全。
回答by JanDotNet
I had the same error for a git server hosted on IIS.
对于托管在 IIS 上的 git 服务器,我遇到了同样的错误。
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.
为 IIS 安装“基本身份验证”后,问题就出现了。之后,为 git 服务器的网站启用了新的身份验证方法“基本身份验证”(似乎是默认设置)。禁用“基本身份验证”解决了问题。
回答by Eugene
Maybe not that related, but you may come here by the keywords "teamcity, github, list remote refs failed."
也许不是那么相关,但您可能会通过关键字“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
对于那些服务器在代理后面的,请根据连接超时设置TeamCity服务器的代理: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
要使 TeamCity 能够使用代理,必须创建一个环境变量:
名称:TEAMCITY_SERVER_OPTS
值:-Dhttp.proxyHost=192.168.0.1 -Dhttp.proxyPort=80 -Dhttps.proxyHost=192.168.0.1 -Dhttps.proxyPort=80
回答by valentasm
Try to make push/get with same credentials with local git client it could provide more details, which could be related to credentials.
尝试使用本地 git 客户端使用相同的凭据进行推送/获取,它可以提供更多详细信息,这可能与凭据有关。
This was to me since TeamCity showed same error and these solutions didnt worked.
这对我来说是因为 TeamCity 显示了同样的错误并且这些解决方案不起作用。
回答by Fernando Moreira
Had the same issue and resolved it by creating a Personal Access Token in Github and using it as a password in TeamCity.
遇到了同样的问题,并通过在 Github 中创建个人访问令牌并将其用作 TeamCity 中的密码来解决它。