-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[UseDotNetV2] Not setting "no_proxy" nuget config on Windows agents #16935
Comments
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Issue still present |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Still an issue |
For the love of... please fix this! |
You cannot simply use the content of .proxybypass for the no_proxy setting of nuget.config, because they are different formats:
For example, a valid .proxybypass like |
Big thank you @danko-d for mentioning this. It took me several days to investigate that: Hosts that should be bypassed by the agent are defined according to https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/proxy?view=azure-devops&tabs=windows#specify-proxy-bypass-urls Later those setting are string joined with comma and added to the service user nuget.config (%AppData%/NuGet/NuGet.Config) with using Finally nuget.exe (since v4+) supports proxy settings in NuGet.config but only on user-level, and http_proxy / no_proxy environment variables. As you can see here https://github.com/NuGet/NuGet.Client/blob/a32bce39889f724fbd11cfd12e946f802168b583/src/NuGet.Core/NuGet.Configuration/Proxy/ProxyCache.cs#L80 if there is http_proxy setting present in the users' NuGet.config file, all settings (inlcuding no_proxy) take precedence over environment variables. The previously joined no_proxy values get splitted again and put into the bypassList. Later those values are used here https://github.com/NuGet/NuGet.Client/blob/a32bce39889f724fbd11cfd12e946f802168b583/src/NuGet.Core/NuGet.Configuration/Proxy/WebProxy.cs#L76. As you can see in the I recognize this is an edge case but I would really like a fix for this issue and maybe in the span of two years no less. |
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: UseDotNet
Environment
Issue Description
When UseDotNet (V2) runs on a Windows agent, it runs a series of nuget.exe commands at the end to setup the proxy configuration. However these series of commands do not set the "no_proxy" parameter resulting in a wrong configuration and following dotnet restore step failing.
Task logs
Setting up proxy configuration for NuGet.
D:\ado\agents\agent-1_work_tool\NuGet\4.4.1\x64\nuget.exe config -set http_proxy=http://myproxy.com:8080
D:\ado\agents\agent-1_work_tool\NuGet\4.4.1\x64\nuget.exe config -set http_proxy.user=undefined
D:\ado\agents\agent-1_work_tool\NuGet\4.4.1\x64\nuget.exe config -set http_proxy.password=undefined
Work Around
Added this step after UseDotNet@2 to make it work.
Fix
The issues is in nugetinstaller.ts
Which is not using the proxyBypassHosts parameter to set the no_proxy nuget parameter.
There should be another command issued to set the no_proxy parameter.
The text was updated successfully, but these errors were encountered: