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

5.0.300 dotnet restore ignores proxy settings #17991

Closed
jirikopecky opened this issue May 31, 2021 · 14 comments
Closed

5.0.300 dotnet restore ignores proxy settings #17991

jirikopecky opened this issue May 31, 2021 · 14 comments
Labels
Area-NuGet untriaged Request triage from a team member

Comments

@jirikopecky
Copy link

Our build server is behind proxy and we use private NuGet feed. This feed have to be accessed directly, without the proxy. Feed DNS name is configured in no_proxy environment variable. dotnet restore fails with HTTP 504 Gateway Timeout.

Summaray:

  • Environment: Docker (using mcr.microsoft.com/dotnet/sdk:5.0 image)
  • Custom NuGet feed configured in NuGet.config (nuget.mycorp.com)
  • HTTP(S) proxy configured using http_proxy and https_proxy env variables
  • Using no_proxy env variable to configure direct access to custom feed (no_proxy=nuget.mycorp.com)
  • Restore works with SDK 5.0.203, same setup fails with SDK 5.0.300
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label May 31, 2021
@tempel3
Copy link

tempel3 commented Jun 1, 2021

Hello,

i have a similar issue.

While trying to setup a proxy WITH Authentication for the docker build using the nuget.config and environmental variables. The settings are ignored or not handled correctly.

For more information regarding the test setup, please ask.

Best regards
Paul

@protonyx
Copy link

protonyx commented Jun 2, 2021

I noticed this same issue with SDK v5.0.300. If I clear my proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY), dotnet restore begins working (we also have a private feed on our intranet). It seems that the NO_PROXY environment variable is being ignored, even when I specify it in a solution-local nuget.config:

  <config>
    <add key="http_proxy" value="http://proxy.mycorp.com" />
    <add key="no_proxy" value=".mycorp.com" />
  </config>

@sfoslund sfoslund removed their assignment Jun 2, 2021
@michal-ciechan
Copy link

Adding from NuGet/Home#6981 (comment)


My issue is that we need to use proxy for a single source. and not for others.

We have HTTP_PROXY set so that everything picks it up correctly.

We also have NO_PROXY set for various domains/IP ranges that cannot go through the proxy.

Global NuGet.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!-- This needs to go through Proxy -->
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />

    <!-- This cannot go through Proxy. Has exclusion in NO_PRXY -->
    <add key="TeamCityInternal" value="http://nuget.internal/" />
  </packageSources>
</configuration>

And then we have

HTTP_PROXY=http://somproxy
NO_PROXY=.internal

This works perfectly fine when running nuget restore using nuget.exe versions v5.9.1 or v5.10.0-preview2

It doesn't work when running dotnet restore using .NET SDK 5.0.300 or .NET SDK 6.0.100-preview.4.

Using dotnet restore get a 403 forbidden error. (Proxy uses standard NTLM)

@michal-ciechan
Copy link

5.0.301 still broken

@sfoslund
Copy link
Member

sfoslund commented Jun 9, 2021

FYI @nkolev92

@nkolev92
Copy link
Contributor

nkolev92 commented Jun 9, 2021

Dup in NuGet/Home#10902.

cc @erdembayar who fixed it.

fyi @aortiz-msft, we might need to consider patching this.

@nkolev92
Copy link
Contributor

nkolev92 commented Jun 9, 2021

For reference, the fix is available in the 5.0.400 dailies, #18041.

@nkolev92
Copy link
Contributor

nkolev92 commented Jun 9, 2021

@sfoslund I moved it to the NuGet side so that we can consider patching.

@erdembayar
Copy link
Contributor

Here is link for daily build if someone wants to download 5.0.400 daily build
https://github.com/dotnet/installer/blob/main/README.md#installers-and-binaries

@michal-ciechan
Copy link

this is still broken in VS 16.10 and 16.11 preview2 as those use a broken SDK version ignoring what is installed on the machine or global.json

@aortiz-msft
Copy link

@michal-ciechan: Could you please try 16.11 preview 3 and letting us know the outcome?

@erdembayar
Copy link
Contributor

@michal-ciechan: Could you please try 16.11 preview 3 and letting us know the outcome?

@aortiz-msft
He already confirmed problem is fixed with 16.11 Preview 2, also I manually verified it yesterday.
NuGet/Home#10932 (comment)

@jirikopecky
Copy link
Author

Hello, I can confirm that SDK 5.0.400 fixed the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NuGet untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

8 participants