-
Notifications
You must be signed in to change notification settings - Fork 651
LibGit2Sharp.LibGit2SharpException: Request failed with status code: 401 / Unsupported URL protocol #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To the best of my knowledge, SSH is currently not supported in libgit2, therefore not supported in GitVersion. You can find some more information about this here: Therefore, you best option would be to use HTTPS connection. Perhaps open another issue specifically for that? |
Thanks, it definitely helped when I stopped using ssh. |
👍 |
Yip, this has been merged, and should be in the next release: If you want to, you can compile from source and give it a try if you wanted to try this out. |
Our build configuration using GitVersionTask in TeamCity looks like this:
I believe this is everything required to get all git operations to work with GitVersion. Does your build configuration look identical to this, @babadofar? |
Thanks Asbjørn! 2015-05-08 9:14 GMT+02:00 Asbjørn Ulsberg [email protected]:
|
@babadofar, even better would be for libgit2 to get SSH support, since SSH is unquestionably preferable when it is available. But until then, HTTPS is a compromise we're willing to accept since the value GitVersion gives us far outweighs HTTPS' downsides. 😃 |
Agreed! 👍 |
We are having this problem in our TeamCity setup. I am accessing the repo using SSH, and I get a very similar callstack:
Our TeamCity setup is: |
Huh: I did this:
and the problem went away. Cool! No idea why it didn't throw a better exception, but this will work for now. |
The one thing that fixed it for me today based on having was putting in %teamcity.build.branch% with the same environment variable. |
Hi,
I'm trying to use GitVersionTask, 3.0.0-beta2 with TeamCity 8.0.5
Have set the environment variables GITVERSION_REMOTE_PASSWORD and GITVERSION_REMOTE_USERNAME as explained here: https://github.com/ParticularLabs/GitVersion/wiki/MSBuild-Task-Usage
We normally use ssh to checkout from bitbucket, but I tried using https as well, they give slightly different error messages, both seem to indicate connection/authentication failures.
ssh error message:
[UpdateAssemblyInfo] WriteVersionInfoToBuildLog
[16:57:50][WriteVersionInfoToBuildLog] Applicable build agent found: 'TeamCity'.
[16:57:50][WriteVersionInfoToBuildLog] Executing PerformPreProcessingSteps for 'TeamCity'.
[16:57:50][WriteVersionInfoToBuildLog] One remote found (origin -> '[email protected]').
[16:57:50][WriteVersionInfoToBuildLog] Fetching from remote 'origin' using the following refspecs: +refs/heads/:refs/remotes/origin/.
[16:57:50]
[WriteVersionInfoToBuildLog] Error occurred: LibGit2Sharp.LibGit2SharpException: Unsupported URL protocol
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in :line 0
at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle remote, Signature signature, String logMessage) in :line 0
https error message:
[...csproj] UpdateAssemblyInfo
[16:44:00][UpdateAssemblyInfo] WriteVersionInfoToBuildLog
[16:44:00][WriteVersionInfoToBuildLog] Applicable build agent found: 'TeamCity'.
[16:44:00][WriteVersionInfoToBuildLog] Executing PerformPreProcessingSteps for 'TeamCity'.
[16:44:00][WriteVersionInfoToBuildLog] One remote found (origin -> 'https://....git').
[16:44:00][WriteVersionInfoToBuildLog] Fetching from remote 'origin' using the following refspecs: +refs/heads/:refs/remotes/origin/.
[16:44:01]
[WriteVersionInfoToBuildLog] Error occurred: LibGit2Sharp.LibGit2SharpException: Request failed with status code: 401
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in :line 0
at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle remote, Signature signature, String logMessage) in :line 0
at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signature signature, String logMessage) in :line 0
at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options, Signature signature, String logMessage) in :line 0
at GitVersion.GitHelper.NormalizeGitDirectory(String gitDirectory, Authentication authentication, Boolean noFetch) in c:\BuildAgent\work\5106452ed7682238\GitVersionCore\BuildServers\GitHelper.cs:line 23
at GitVersion.TeamCity.PerformPreProcessingSteps(String gitDirectory, Boolean noFetch) in c:\BuildAgent\work\5106452ed7682238\GitVersionCore\BuildServers\TeamCity.cs:line 26
at VersionAndBranchFinder.TryGetVersion(String directory, Tuple`2& versionAndBranch, Config configuration, Boolean noFetch) in c:\BuildAgent\work\5106452ed7682238\GitVersionTask\VersionAndBranchFinder.cs:line 31
at GitVersionTask.WriteVersionInfoToBuildLog.InnerExecute() in c:\BuildAgent\work\5106452ed7682238\GitVersionTask\WriteVersionInfoToBuildLog.cs:line 58
at GitVersionTask.WriteVersionInfoToBuildLog.Execute() in c:\BuildAgent\work\5106452ed7682238\GitVersionTask\WriteVersionInfoToBuildLog.cs:line 34
[16:44:01][....csproj failed.
The text was updated successfully, but these errors were encountered: