question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yaml Build Task - DotNetCoreCLI@2 Restore working differently when using Proxy & No Proxy

See original GitHub issue

Issue moved from dotnet/sdk#12121


From @temelj on Monday, June 22, 2020 9:33:04 AM

Hi,

I have a step in my azure pipelines that does the following

    - task: DotNetCoreCLI@2
      displayName: 'Restore Packages'
      inputs:
        command: 'restore'
        projects: '**/*.csproj'
        feedsToUse: 'select'
        vstsFeed: '00000a00-ef00-0e00-0fb0-000bf0bda000'
        includeNuGetOrg: false    

The following logs are from a machine that has NO Proxy configured:

##[debug]Setting up auth
##[debug]SYSTEMVSSCONNECTION=https://dev.azure.com/REMOVED/
##[debug]Discovered URL prefixes: https://dev.azure.com/REMOVED/,https://REMOVED.pkgs.visualstudio.com/,https://pkgsprodcus1.pkgs.visualstudio.com/,https://REMOVED.pkgs.visualstudio.com/,https://REMOVED.pkgs.visualstudio.com/,https://pkgs.dev.azure.com/REMOVED/
##[debug]DotNetCoreCLITask.ExtraUrlPrefixesForTesting=undefined
##[debug]Getting credentials for local feeds
SYSTEMVSSCONNECTION exists true
##[debug]SYSTEMVSSCONNECTION exists true
##[debug]Got auth token
##[debug]externalEndpoints=null
##[debug]Setting up sources
##[debug]selectOrConfig=select
##[debug]Agent.BuildDirectory=D:\TEMELJ_v1\_work\1
##[debug]build.buildId=15518

##[debug]feedRestore=00000a00-ef00-0e00-0fb0-000bf0bda000
##[debug]NuGet.OverwritePackagingCollectionUrl=undefined
##[debug]Getting registry url from https://REMOVED.pkgs.visualstudio.com/
##[debug]Agent.ProxyUrl=undefined
##[debug]Created webApi client for https://REMOVED.pkgs.visualstudio.com/; options: {"proxy":null,"allowRetries":true,"maxRetries":5,"ignoreSslError":false}
##[debug]Feed registry url: https://REMOVED.pkgs.visualstudio.com/_packaging/00000a00-ef00-0e00-0fb0-000bf0bda000/nuget/v3/index.json
##[debug]includeNuGetOrg=false
##[debug]Adding the following sources to the config file: 00000a00-ef00-0e00-0fb0-000bf0bda000
##[debug]Adding sources to nuget.config
##[debug]Saving NuGet.config to a temporary config file.

Then the following when a proxy is configured:

##[debug]Setting up auth
##[debug]SYSTEMVSSCONNECTION=https://dev.azure.com/REMOVED/
##[debug]Discovered URL prefixes: https://dev.azure.com/REMOVED/
##[debug]DotNetCoreCLITask.ExtraUrlPrefixesForTesting=undefined
##[debug]Getting credentials for local feeds
SYSTEMVSSCONNECTION exists true
##[debug]SYSTEMVSSCONNECTION exists true
##[debug]Got auth token
##[debug]externalEndpoints=null
##[debug]Setting up sources
##[debug]selectOrConfig=select
##[debug]Agent.BuildDirectory=D:\TEMELJ_v1\_work\1
##[debug]build.buildId=15522
##[debug]feedRestore=00000a00-ef00-0e00-0fb0-000bf0bda000
##[debug]NuGet.OverwritePackagingCollectionUrl=undefined
##[debug]Getting registry url from https://dev.azure.com/REMOVED/
##[debug]Agent.ProxyUrl=http://127.0.0.1:3128
##[debug]Agent.ProxyUsername=undefined
##[debug]Agent.ProxyPassword=undefined
##[debug]Agent.ProxyBypassList=undefined
##[debug]Created webApi client for https://dev.azure.com/REMOVED/; options: {"proxy":{"proxyUrl":"http://127.0.0.1:3128","proxyBypassHosts":[]},"allowRetries":true,"maxRetries":5,"ignoreSslError":false}
##[debug]Network call failed. Number of retries left: 2
##[warning]Failed to find api location for area: nuget id: 9D3A4E8E-2F8F-4AE1-ABC2-B461A51CB3B3
##[debug]Processed: ##vso[task.issue type=warning;]Failed to find api location for area: nuget id: 9D3A4E8E-2F8F-4AE1-ABC2-B461A51CB3B3
##[debug]Error: Failed to find api location for area: nuget id: 9D3A4E8E-2F8F-4AE1-ABC2-B461A51CB3B3
    at beginGetLocation.then (D:\TEMELJ_v1\_work\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.171.3\node_modules\azure-devops-node-api\VsoClient.js:85:23)
    at process._tickCallback (internal/process/next_tick.js:109:7)

Based on the logs, I cannot identify whether the Proxy is blocking something but one difference I’ve observed is with the following:

NO PROXY: ##[debug]Discovered URL prefixes: https://dev.azure.com/REMOVED/,https://REMOVED.pkgs.visualstudio.com/,https://pkgsprodcus1.pkgs.visualstudio.com/,https://REMOVED.pkgs.visualstudio.com/,https://REMOVED.pkgs.visualstudio.com/,https://pkgs.dev.azure.com/REMOVED/ WITH PROXY: ##[debug]Discovered URL prefixes: https://dev.azure.com/REMOVED/

Why would that be the case?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
marcpopMSFTcommented, Jul 22, 2020

Issue moved from dotnet/sdk#12121


From @temelj on Tuesday, June 23, 2020 7:55:02 AM

Findings: api.nuget.org is blocked by the proxy I am attempting to purely use the private feed (to which I know that I have connectivity to).

And it is failing so far. I am starting to believe that the tooling relies on api.nuget.org to be accessible regardless of the fact that one uses a private feed additionally. I am waiting for api.nuget.org to be unblocked through the proxy - if it works then, my theory is correct, if it doesn’t, back at square one.

0reactions
github-actions[bot]commented, Feb 28, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

UseDotNet@2 - Use dotnet v2 task - Microsoft Learn
Use this task to change the version of .NET Core that is used in subsequent tasks. This task also provides proxy support. Syntax....
Read more >
azure pipelines with dotnet test causes a NU1101 with a ...
For this, I think you can resolve this issue by adding a dotnet restore command before dotnet test . Normally, dotnet restore instead...
Read more >
Proxy issue on Nuget Restore task - Visual Studio Feedback
I'm stuck on the following message within the Nuget Restore Task of my Build Definition. NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load ...
Read more >
cake-build/cake - Gitter
That task will try and pull down Cake from NuGet, and unless I specify a public ... dotnet tool with -g, --global or...
Read more >
SonarScanner for .NET - SonarQube Documentation
sonarqube\out\sonar-project.properties after MSBuild has finished. Using SonarScanner for .NET with a proxy. On build machines that connect to the Internet ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found