Skip to content

LibGit2Sharp.LibGit2SharpException: Request failed with status code: 401 / Unsupported URL protocol #436

Closed
@babadofar

Description

@babadofar

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 -> 'git@...git').
[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions