Issue
The user is trying to use the Git repository under a proxy or firewall environment and the following error message appears:
LibGit2Sharp.LibGit2SharpException: failed to receive response: The server returned an invalid or unrecognized response
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_remote_connect(RemoteHandle remote, GitDirection direction, GitRemoteCallbacks& remoteCallbacks, GitProxyOptions& proxyOptions)
at LibGit2Sharp.Repository.ConnectToAnonymousRemote(RepositoryHandle repositoryHandle, String url, CredentialsHandler credentialsProvider, CertificateCheckHandler certificateCheckHandler, GitProxyOptions proxyOptions)
at LibGit2Sharp.Repository.ListRemoteReferences(String url, CredentialsHandler credentialsProvider, CertificateCheckHandler certificateCheckHandler, ProxyOptions proxyOptions)
at Mendix.Modeler.VersionControl.Git.GitRemoteConnector.ListRemoteReferences(String remoteUrl) in C:\Users\Autobuild\workspace\AppStudio4.0-Build\modeler\Mendix.Modeler.VersionControl\Git\GitRemoteConnector.cs:line 21
at Mendix.Modeler.VersionControl.Operations.Git.GitGetBranchesOperation.ListRemoteBranches(String remoteUrl) in C:\Users\Autobuild\workspace\AppStudio4.0-Build\modeler\Mendix.Modeler.VersionControl\Operations\Git\GitGetBranchesOperation.cs:line 119
at Mendix.Modeler.VersionControl.Operations.Git.GitGetBranchesOperation.GetBranchesRemotely(String remoteUrl) in C:\Users\Autobuild\workspace\AppStudio4.0-Build\modeler\Mendix.Modeler.VersionControl\Operations\Git\GitGetBranchesOperation.cs:line 111
at Mendix.Modeler.VersionControl.Operations.Git.GitGetBranchesOperation.Execute(GetBranchesRequest& request) in C:\Users\Autobuild\workspace\AppStudio4.0-Build\modeler\Mendix.Modeler.VersionControl\Operations\Git\GitGetBranchesOperation.cs:line 49Environment
- Version Control
- Studio Pro version 9.21 and newer
Cause
Proxy is currently not supported with Git for Windows, so it is not integrated with Studio Pro.
Solution/Workaround
As a workaround, the user can configure the proxy settings directly by either overriding the environment variables:http_proxy, https_proxy and all_proxy; or by setting the proxy URL in the locarl.git/config via the following commands:
- Configure the proxy settings:
git config --local http.proxy
[protocol://][user[:password]@]proxyhost[:port]
A full example could look like:
git config --local http.proxy
http://proxyuser:proxypwd@proxy.server.com:8080 - Check if the setting has changed:
git config --local http.proxyBased on the above example one would expect to see the following output:
http://proxyuser:proxypwd@proxy.server.com:8080
It is possible to use --global flag for applying the changes system-wide, but it is not recommended if Git is not only utilized for Mendix development.
Internal information related
- 186030, 186862
0 Comments