Skip to content
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

Can not configure the agent behind a proxy. #2658

Closed
ARMAAN7139 opened this issue Apr 29, 2019 · 4 comments
Closed

Can not configure the agent behind a proxy. #2658

ARMAAN7139 opened this issue Apr 29, 2019 · 4 comments

Comments

@ARMAAN7139
Copy link

ARMAAN7139 commented Apr 29, 2019

Issue Title

The agent is failing to connect no matter how I configure the proxy.

here is the agent logs:

[2019-04-29 20:36:15Z ERR LocationServer] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization
at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions()
at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl()
at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState) at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.Agent.LocationServer.ConnectAsync(VssConnection jobConnection) [2019-04-29 20:36:16Z INFO VisualStudioServices] Starting operation Location.GetConnectionData [2019-04-29 20:36:16Z ERR VisualStudioServices] GET request to https://bpt-informationsecurity-cat-com.visualstudio.com/_apis/connectionData?connectOptions=1&lastChangeId=-1&lastChangeId64=-1 failed. System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions() at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl() at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) [2019-04-29 20:36:16Z INFO VisualStudioServices] Finished operation Location.GetConnectionData [2019-04-29 20:36:16Z INFO LocationServer] Catch exception during connect. 2 attempt left. [2019-04-29 20:36:16Z ERR LocationServer] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions() at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl() at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)
at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.LocationServer.ConnectAsync(VssConnection jobConnection)
[2019-04-29 20:36:16Z INFO VisualStudioServices] Starting operation Location.GetConnectionData
[2019-04-29 20:36:16Z ERR VisualStudioServices] GET request to https://bpt-informationsecurity-cat-com.visualstudio.com/_apis/connectionData?connectOptions=1&lastChangeId=-1&lastChangeId64=-1 failed. System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization
at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions()
at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl()
at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
[2019-04-29 20:36:16Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2019-04-29 20:36:16Z INFO LocationServer] Catch exception during connect. 1 attempt left.
[2019-04-29 20:36:16Z ERR LocationServer] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization
at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions()
at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl()
at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState) at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.Agent.LocationServer.ConnectAsync(VssConnection jobConnection) [2019-04-29 20:36:16Z INFO VisualStudioServices] Starting operation Location.GetConnectionData [2019-04-29 20:36:16Z ERR VisualStudioServices] GET request to https://bpt-informationsecurity-cat-com.visualstudio.com/_apis/connectionData?connectOptions=1&lastChangeId=-1&lastChangeId64=-1 failed. System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions() at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl() at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) [2019-04-29 20:36:16Z INFO VisualStudioServices] Finished operation Location.GetConnectionData [2019-04-29 20:36:16Z INFO CommandSettings] Flag 'unattended': 'False' [2019-04-29 20:36:16Z ERR Terminal] WRITE ERROR (exception): [2019-04-29 20:36:16Z ERR Terminal] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failed initialization at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.EasyRequest.SetNetworkingOptions() at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl() at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)
at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.LocationServer.ConnectAsync(VssConnection jobConnection)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.IsHostedServer(String serverUrl, VssCredentials credentials)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
[2019-04-29 20:36:16Z ERR Terminal] WRITE ERROR: Failed to connect. Try again or ctrl-c to quit
[2019-04-29 20:36:16Z INFO CommandSettings] Arg 'url': ''
[2019-04-29 20:36:16Z INFO CommandSettings] Flag 'unattended': 'False'
[2019-04-29 20:36:16Z INFO PromptManager] ReadValue
[2019-04-29 20:36:16Z INFO Terminal] WRITE: Enter server URL >
[2019-04-29 20:36:16Z INFO Terminal] READ LINE
[2019-04-29 20:36:58Z INFO Terminal] WRITE LINE: Exiting...

@ARMAAN7139 ARMAAN7139 changed the title Can not configure the agent behind the proxy. Can not configure the agent behind a proxy. Apr 29, 2019
@ARMAAN7139
Copy link
Author

Adding the new curl lib worked for me.

@cawoodm
Copy link

cawoodm commented Jun 8, 2020

Could you elaborate @ARMAAN7139 ? What solved this for you?

@4F2E4A2E
Copy link

I am experiencing the same error all over different agent version:
at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)

Pls anyone, what is this? Can you provide some dotnet new console example code to reproduce this in a manner that brings us closer to a solution?

all agent dependencies: installed and functional
all dotnet dependencies: installed and functional
curl: works
csharp-example-code: works
libcurl: works
openssh: works
ssl connections in any way: works
dotnet dependencies and tools: works

azure agent for linux: does not work at all

Experiencing the same behavior on rhel6 with curl 7.67, no matter what I do.
openssh, curl and dotnet-console tests to the very same host can be established are nominal

but with the agent it's not working at all
image
image
image

@cawoodm
Copy link

cawoodm commented Jul 13, 2020

We had similar issues and I would suggest 2 things to try:

  • Set the environment variable https_proxy (note the httpS) in addition to http_proxy: my experience was the task was ignoring http_proxy for HTTPS requests
  • If that fails try downgrading the agent to say 2.165.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants