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

[BUG]: UseNode task sets HTTP_PROXY but doesn't take over settings for NO_PROXY #19248

Closed
2 of 4 tasks
klapantius opened this issue Nov 8, 2023 · 2 comments
Closed
2 of 4 tasks
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug stale

Comments

@klapantius
Copy link

Task name

UseNode

Task version

1.231.0

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

windows

Task log

2023-11-08T13:43:29.0512922Z ##[debug]Evaluating condition for step: 'Use Node 16.16.0'
2023-11-08T13:43:29.0513942Z ##[debug]Evaluating: succeeded()
2023-11-08T13:43:29.0514174Z ##[debug]Evaluating succeeded:
2023-11-08T13:43:29.0514683Z ##[debug]=> True
2023-11-08T13:43:29.0514984Z ##[debug]Result: True
2023-11-08T13:43:29.0515267Z ##[section]Starting: Use Node 16.16.0
2023-11-08T13:43:29.3746414Z ==============================================================================
2023-11-08T13:43:29.3746619Z Task         : Use Node.js ecosystem
2023-11-08T13:43:29.3746729Z Description  : Set up a Node.js environment and add it to the PATH, additionally providing proxy support
2023-11-08T13:43:29.3746879Z Version      : 1.230.0
2023-11-08T13:43:29.3746994Z Author       : Microsoft Corporation
2023-11-08T13:43:29.3747077Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks
2023-11-08T13:43:29.3747202Z ==============================================================================
2023-11-08T13:43:29.4180826Z ##[debug]Using node path: D:\Buildagents\on03\externals\node16\bin\node.exe
2023-11-08T13:43:29.6863683Z ##[debug]agent.TempDirectory=d:\b\on03\_temp
2023-11-08T13:43:29.6880866Z ##[debug]loading inputs and endpoints
2023-11-08T13:43:29.6896704Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2023-11-08T13:43:29.6907051Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2023-11-08T13:43:29.6910367Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2023-11-08T13:43:29.6915878Z ##[debug]loading INPUT_CHECKLATEST
2023-11-08T13:43:29.6917979Z ##[debug]loading INPUT_FORCE32BIT
2023-11-08T13:43:29.6920198Z ##[debug]loading INPUT_VERSION
2023-11-08T13:43:29.6928647Z ##[debug]loading SECRET_NDEPENDSHAREPASSWORD
2023-11-08T13:43:29.6932452Z ##[debug]loading SECRET_SHS_SONARSERVERTOKEN
2023-11-08T13:43:29.6950213Z ##[debug]loaded 8
2023-11-08T13:43:29.6958832Z ##[debug]Agent.ProxyUrl=http://proxy-fo:83
2023-11-08T13:43:29.6959552Z ##[debug]Agent.ProxyUsername=undefined
2023-11-08T13:43:29.6960252Z ##[debug]Agent.ProxyPassword=undefined
2023-11-08T13:43:29.6961373Z ##[debug]Agent.ProxyBypassList=["artifactory","sonarqube-cloud","sast-service"]
2023-11-08T13:43:29.6962551Z ##[debug]expose agent proxy configuration.
2023-11-08T13:43:29.6964183Z ##[debug]Agent.CAInfo=undefined
2023-11-08T13:43:29.6964872Z ##[debug]Agent.ClientCert=undefined
2023-11-08T13:43:29.6965711Z ##[debug]Agent.SkipCertValidation=undefined
2023-11-08T13:43:29.8437201Z ##[debug]Agent.ProxyUrl=http://proxy-fo:83
2023-11-08T13:43:29.8437819Z ##[debug]Agent.ProxyUsername=undefined
2023-11-08T13:43:29.8438256Z ##[debug]Agent.ProxyPassword=undefined
2023-11-08T13:43:29.8438979Z ##[debug]Agent.ProxyBypassList=["artifactory","sonarqube-cloud","sast-service"]
2023-11-08T13:43:29.8442144Z ##[debug]Agent.CAInfo=undefined
2023-11-08T13:43:29.8442710Z ##[debug]Agent.ClientCert=undefined
2023-11-08T13:43:29.8443561Z ##[debug]check path : d:\b\on03\_tasks\UseNode_31c75bbb-bcdf-4706-8d7c-4da6a1959bc2\1.230.0\node_modules\azure-pipelines-tool-lib\lib.json
2023-11-08T13:43:29.8448521Z ##[debug]adding resource file: d:\b\on03\_tasks\UseNode_31c75bbb-bcdf-4706-8d7c-4da6a1959bc2\1.230.0\node_modules\azure-pipelines-tool-lib\lib.json
2023-11-08T13:43:29.8449145Z ##[debug]system.culture=en-US
2023-11-08T13:43:29.8541900Z ##[debug]force32bit=false
2023-11-08T13:43:29.8559565Z ##[debug]check path : d:\b\on03\_tasks\UseNode_31c75bbb-bcdf-4706-8d7c-4da6a1959bc2\1.230.0\task.json
2023-11-08T13:43:29.8560248Z ##[debug]adding resource file: d:\b\on03\_tasks\UseNode_31c75bbb-bcdf-4706-8d7c-4da6a1959bc2\1.230.0\task.json
2023-11-08T13:43:29.8560624Z ##[debug]system.culture=en-US
2023-11-08T13:43:29.8583511Z ##[debug]version=16.16.0
2023-11-08T13:43:29.8584496Z ##[debug]checkLatest=false
2023-11-08T13:43:29.8588390Z ##[debug]isExplicit: 16.16.0
2023-11-08T13:43:29.8590074Z ##[debug]explicit? true
2023-11-08T13:43:29.8603631Z ##[debug]isExplicit: 16.16.0
2023-11-08T13:43:29.8604113Z ##[debug]explicit? true
2023-11-08T13:43:29.8604526Z ##[debug]Agent.Version=3.227.1
2023-11-08T13:43:29.8604965Z ##[debug]Agent.ToolsDirectory=d:\b\on03\_tool
2023-11-08T13:43:29.8605434Z ##[debug]checking cache: d:\b\on03\_tool\node\16.16.0\x64
2023-11-08T13:43:29.8656425Z Found tool in cache: node 16.16.0 x64
2023-11-08T13:43:29.8661849Z ##[debug]Agent.Version=3.227.1
2023-11-08T13:43:29.8664034Z Prepending PATH environment variable with directory: d:\b\on03\_tool\node\16.16.0\x64
2023-11-08T13:43:29.8665701Z ##[debug]new Path: d:\b\on03\_tool\node\16.16.0\x64;D:\Buildagents\on03\externals\git\cmd;D:\Buildagents\on03\externals\git\mingw64\bin;C:\Program Files\Zulu\zulu-11\bin\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Zulu\zulu-8\bin\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\;C:\Program Files\PowerShell\7\;C:\Users\tfsbuild3_test\AppData\Local\Microsoft\WindowsApps;C:\Users\tfs_test\.dotnet\tools
2023-11-08T13:43:29.8667418Z ##[debug]Processed: ##vso[task.prependpath]d:\b\on03\_tool\node\16.16.0\x64
2023-11-08T13:43:29.8667897Z ##[debug]Agent.Version=3.227.1
2023-11-08T13:43:29.8668386Z ##[debug]SYSTEM_TASKINSTANCEID=183d5bb0-819f-561c-6d3d-be0f218e0933
2023-11-08T13:43:29.8668886Z ##[debug]SYSTEM_JOBID=5cbe02b7-f6b9-55cb-82aa-3f30e762cc8c
2023-11-08T13:43:29.8669377Z ##[debug]SYSTEM_PLANID=e7550369-d84c-40d9-9a76-345800bb6d19
2023-11-08T13:43:29.8669897Z ##[debug]SYSTEM_COLLECTIONID=3478969d-ef4f-44f8-b799-1527ec385f8f
2023-11-08T13:43:29.8670372Z ##[debug]AGENT_ID=28
2023-11-08T13:43:29.8670836Z ##[debug]AGENT_MACHINENAME=DEFOR09T2240VD
2023-11-08T13:43:29.8671308Z ##[debug]AGENT_NAME=on03
2023-11-08T13:43:29.8671765Z ##[debug]AGENT_JOBSTATUS=Succeeded
2023-11-08T13:43:29.8672226Z ##[debug]AGENT_OS=Windows_NT
2023-11-08T13:43:29.8672695Z ##[debug]AGENT_VERSION=3.227.1
2023-11-08T13:43:29.8673170Z ##[debug]BUILD_BUILDID=5316546
2023-11-08T13:43:29.8673686Z ##[debug]BUILD_BUILDNUMBER=Modules.DsktCore-WinContainer.Main.PLMSonar.FOR_Main_20231108.16
2023-11-08T13:43:29.8674159Z ##[debug]BUILD_BUILDURI=vstfs:///Build/Build/5316546
2023-11-08T13:43:29.8674602Z ##[debug]BUILD_CONTAINERID=10834627
2023-11-08T13:43:29.8675052Z ##[debug]BUILD_DEFINITIONNAME=Modules.DsktCore-WinContainer.Main.PLMSonar.FOR
2023-11-08T13:43:29.8675499Z ##[debug]BUILD_DEFINITIONVERSION=12
2023-11-08T13:43:29.8675918Z ##[debug]BUILD_REASON=Manual
2023-11-08T13:43:29.8676337Z ##[debug]BUILD_REPOSITORY_CLEAN=True
2023-11-08T13:43:29.8676789Z ##[debug]BUILD_REPOSITORY_GIT_SUBMODULECHECKOUT=False
2023-11-08T13:43:29.8677262Z ##[debug]BUILD_REPOSITORY_NAME=Modules.DsktCore-WinContainer
2023-11-08T13:43:29.8677753Z ##[debug]BUILD_REPOSITORY_PROVIDER=TfsGit
2023-11-08T13:43:29.8678196Z ##[debug]BUILD_SOURCEVERSION=e54a4f89aeab0ffcc35a2c033c719cf8cd7b1d52
2023-11-08T13:43:29.8964182Z ##[debug]Processed: ##vso[telemetry.publish area=TaskHub;feature=UseNodeV1]{"SYSTEM_TASKINSTANCEID":"183d5bb0-819f-561c-6d3d-be0f218e0933","SYSTEM_JOBID":"5cbe02b7-f6b9-55cb-82aa-3f30e762cc8c","SYSTEM_PLANID":"e7550369-d84c-40d9-9a76-345800bb6d19","SYSTEM_COLLECTIONID":"3478969d-ef4f-44f8-b799-1527ec385f8f","AGENT_ID":"28","AGENT_MACHINENAME":"DEFOR09T2240VD","AGENT_NAME":"on03","AGENT_JOBSTATUS":"Succeeded","AGENT_OS":"Windows_NT","AGENT_VERSION":"3.227.1","BUILD_BUILDID":"5316546","BUILD_BUILDNUMBER":"Modules.DsktCore-WinContainer.Main.PLMSonar.FOR_Main_20231108.16","BUILD_BUILDURI":"vstfs:///Build/Build/5316546","BUILD_CONTAINERID":"10834627","BUILD_DEFINITIONNAME":"Modules.DsktCore-WinContainer.Main.PLMSonar.FOR","BUILD_DEFINITIONVERSION":"12","BUILD_REASON":"Manual","BUILD_REPOSITORY_CLEAN":"True","BUILD_REPOSITORY_GIT_SUBMODULECHECKOUT":"False","BUILD_REPOSITORY_NAME":"Modules.DsktCore-WinContainer","BUILD_REPOSITORY_PROVIDER":"TfsGit","BUILD_SOURCEVERSION":"e54a4f89aeab0ffcc35a2c033c719cf8cd7b1d52","versionSpec":"16.16.0","checkLatest":false,"force32bit":false}
2023-11-08T13:43:29.8966849Z ##[debug]Agent.ProxyUrl=http://proxy-fo:83
2023-11-08T13:43:29.8967159Z ##[debug]Agent.ProxyUsername=undefined
2023-11-08T13:43:29.8967429Z ##[debug]Agent.ProxyPassword=undefined
2023-11-08T13:43:29.8967779Z ##[debug]Agent.ProxyBypassList=["artifactory","sonarqube-cloud","sast-service"]
2023-11-08T13:43:29.8968242Z ##[debug]HTTP_PROXY=undefined
2023-11-08T13:43:29.8968511Z ##[debug]HTTPS_PROXY=undefined
2023-11-08T13:43:29.8968782Z ##[debug]using proxy http://proxy-fo:83
2023-11-08T13:43:29.8969524Z ##[debug]set HTTP_PROXY=http://undefined:***@proxy-fo:83/
2023-11-08T13:43:29.8970240Z ##[debug]Processed: ##vso[task.setvariable variable=HTTP_PROXY;isOutput=false;issecret=false;]http://undefined:***@proxy-fo:83/
2023-11-08T13:43:29.8972228Z ##[section]Finishing: Use Node 16.16.0

Relevant log output

Http response 403 will be received from a nuget repository hosted on premises, by msbuild in a subsequent step:

2023-11-08T09:24:21.4654314Z                      Assembly loaded during TaskRun (NuGet.Build.Tasks.RestoreTask): System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (location: C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll, MVID: 5806d44d-2724-471f-a988-a9d01d49624e, AppDomain: [Default]) (TaskId:48)
2023-11-08T09:24:21.4655023Z                        GET https://artifactory.***/artifactory/api/nuget/v3/di_dna_native_nuget/FindPackagesById()?id='***.CodeAnalysis.Analyzers'&semVerLevel=2.0.0 (TaskId:48)
2023-11-08T09:24:21.4655514Z                        GET https://artifactory.***/artifactory/api/nuget/v3/di_dna_native_nuget/FindPackagesById()?id='Microsoft.CodeAnalysis.NetAnalyzers'&semVerLevel=2.0.0 (TaskId:48)
2023-11-08T09:24:21.4656045Z                      Retrying 'FindPackagesByIdAsyncCore' for source 'https://artifactory.***/artifactory/api/nuget/v3/di_dna_native_nuget/FindPackagesById()?id='Microsoft.CodeAnalysis.NetAnalyzers'&semVerLevel=2.0.0'.
2023-11-08T09:24:21.4656340Z                      An error occurred while sending the request.
2023-11-08T09:24:21.4656547Z                        The remote server returned an error: (403) Forbidden. (TaskId:48)

Aditional info

Environment variable HTTP_PROXY/HTTPS_PROXY will be set by UseNode task with values from the agent configuration file '.proxy'. Unfortunately, NO_PROXY won't be set accordingly with values from file '.proxybypass'.
See https://github.com/microsoft/azure-pipelines-tasks/blob/c10f72b6e11f0dc0efbbf8437aa6788918bcfa48/Tasks/UseNodeV1/proxyutil.ts#L19-L20

Workaround 1: set NO_PROXY in a subsequent step for the current build job or for the step only.
Workaround 2: set NO_PROXY globally on the agent host - this is not always an option.

I propose to either set NO_PROXY too where HTTP_PROXY will be set - or to make setting of HTTP_PROXY optional with a checkbox (checked as default for sake of backward compatibility).
@klapantius
Copy link
Author

In the meantime, I understand that the entries in .proxybypasslist can be dynamic patterns (regex), while those of the NO_PROXY variable are static ones (no regex, no wildcards). However, setting only the HTTP*_PROXY variable(s) still results in an incomplete state.

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug stale
Projects
None yet
Development

No branches or pull requests

2 participants