Comments (13)
Hi @PeterJakubik, unfortunately that is the exact intermittent issue that I was referring to in my earlier message. To understand your scenario better, could you turn the variable system.debug to true and try again? This will hopefully provide us some more logs. Also would you mind attaching a screen shot of your build definition?
Are you filling your credentials in the restore task's "Credentials for feeds outside this account/collection" section correctly? I should have mentioned this in my first message but the NuGet build task will automatically populate the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS variable if the Azure Artifacts credential provider (V2) is being used and the "Credentials for feeds outside this account/collection" section is filled. With the old way of authenticating (currently, when not setting the build env vars to force-enable "V2", or using NuGet version lesser than 4.8.1), the task will not use VSS_NUGET_EXTERNAL_FEED_ENDPOINTS env var but will create a temp nuget.config with the credentials provided and call NuGet restore with the nuget.config with credentials. Did this not work for you? If you didn't try yet or if you have a reason not to, please try and remove the build variables that force-enable V2 cred provider and fill out the "Credentials for feeds outside this account/collection" section with the credentials you want to use.
We are still investigating the issue but please let me know if using the old credential provider worked for you.
from artifacts-credprovider.
We are currently investigating an intermittent issue with the Artifacts Credential Provider in the NuGet build tasks. Therefore, we default to the old way of authenticating which doesn't recognize this environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS. To force your build task to use the Artifacts Credential Provider in NuGet build tasks you need to set two more build variables: NuGet_ForceEnableCredentialProviderV2=true and NuGet.ForceEnableCredentialProvider=false.
from artifacts-credprovider.
Thank you, I tried it but got
2018-11-28T14:36:55.3167976Z [command]C:\hostedtoolcache\windows\NuGet\4.8.1\x64\nuget.exe restore D:\a\1\s\ForecastWeb.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\s\src\SomeWeb\NuGet.Config
2018-11-28T14:37:13.9054685Z NuGet Version: 4.8.1.5435
2018-11-28T14:37:13.9055281Z MSBuild auto-detection: using msbuild version '15.8.169.51996' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
2018-11-28T14:37:13.9055472Z MSBuild P2P timeout [ms]: 120000
2018-11-28T14:37:13.9055746Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe "C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\tbvb5kt1.lv4.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\tp03cbxu.0rc.nugetrestore.targets" /p:RestoreUseCustomAfterTargets="True" /p:RestoreTaskAssemblyFile="C:\hostedtoolcache\windows\NuGet\4.8.1\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\1\s\\" /p:RestoreConfigFile="D:\a\1\s\src\ForecastWeb\NuGet.Config" /p:SolutionDir="D:\a\1\s\\" /p:SolutionName="ForecastWeb"
...
...
2018-11-28T14:37:13.9063495Z Using D:\a\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.0.48\node_modules\nuget-task-common\NuGet\CredentialProviderV2\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe as a credential provider plugin.
2018-11-28T14:37:13.9063697Z Terminating plugin 'CredentialProvider.Microsoft' due to an unrecoverable fault: NuGet.Protocol.Plugins.ProtocolException: A plugin protocol exception occurred. ---> NuGet.Protocol.Plugins.ProtocolException: The message type 'Cancel' is invalid at this time.
2018-11-28T14:37:13.9064016Z at NuGet.Protocol.Plugins.OutboundRequestContext`1.HandleCancelResponse()
2018-11-28T14:37:13.9064271Z at NuGet.Protocol.Plugins.MessageDispatcher.OnMessageReceived(Object sender, MessageEventArgs e)
2018-11-28T14:37:13.9064499Z at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
2018-11-28T14:37:13.9064663Z at NuGet.Protocol.Plugins.StandardOutputReceiver.OnLineRead(Object sender, LineReadEventArgs e)
2018-11-28T14:37:13.9064826Z --- End of inner exception stack trace ---
2018-11-28T14:37:13.9064975Z Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.AspNetCore.CookiePolicy'&semVerLevel=2.0.0'.
2018-11-28T14:37:13.9065219Z A task was canceled.
I'm using following NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Telerik" value="https://nuget.telerik.com/nuget/" />
</packageSources>
</configuration>
and VSS_NUGET_EXTERNAL_FEED_ENDPOINTS with json
from artifacts-credprovider.
Hi @satbai
Thank you. When I set the "Credentials for feeds outside this account/collection" it works!
So my NuGet.config looks like this
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Telerik" value="https://nuget.telerik.com/nuget/" />
</packageSources>
</configuration>
I set Build variables NuGet.ForceEnableCredentialProvider, NuGet_ForceEnableCredentialProviderV2, VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
Variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
{
"endpointCredentials": [
{
"endpoint":"https://nuget.telerik.com/nuget/",
"username":"[email protected]",
"password":"secret password"}
]}
The same credentials must be set in build task in credentials provider
So the credentials must be set in VSS_NUGET_EXTERNAL_FEED_ENDPOINTS and once more the exact credentials in build credentials provider. Nice would be to set the credentials only once
from artifacts-credprovider.
Hi @satbai
Although it works, i'm still getting occasional authentication Problems from Azure
2018-11-29T10:41:16.3477604Z GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.Reporting.Services.AspNetCore'&semVerLevel=2.0.0
2018-11-29T10:41:16.3477733Z GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'&semVerLevel=2.0.0
2018-11-29T10:41:16.3477894Z Using D:\a\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.0.48\node_modules\nuget-task-common\NuGet\CredentialProviderV2\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe as a credential provider plugin.
2018-11-29T10:41:16.3478210Z Terminating plugin 'CredentialProvider.Microsoft' due to an unrecoverable fault: NuGet.Protocol.Plugins.ProtocolException: A plugin protocol exception occurred. ---> NuGet.Protocol.Plugins.ProtocolException: The message type 'Cancel' is invalid at this time.
2018-11-29T10:41:16.3478368Z at NuGet.Protocol.Plugins.OutboundRequestContext`1.HandleCancelResponse()
2018-11-29T10:41:16.3478493Z at NuGet.Protocol.Plugins.MessageDispatcher.OnMessageReceived(Object sender, MessageEventArgs e)
2018-11-29T10:41:16.3478588Z at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
2018-11-29T10:41:16.3478839Z at NuGet.Protocol.Plugins.StandardOutputReceiver.OnLineRead(Object sender, LineReadEventArgs e)
2018-11-29T10:41:16.3478929Z --- End of inner exception stack trace ---
2018-11-29T10:41:16.3479058Z Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.Reporting.Services.AspNetCore'&semVerLevel=2.0.0'.
2018-11-29T10:41:16.3479168Z A task was canceled.
Any update on this intermittent issue?
from artifacts-credprovider.
When you use the "Credentials for feeds outside this account/collection" you shouldn't need to set the variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS at all. If the task uses the Artifacts Cred Provider, which in your case it does because of the build variables that force it, the task will populate the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS variable under the covers based on the credentials that you've set in the task.
We'll update this issue once we know more about the intermittent exception in the NuGet build tasks when using the Artifacts Credential Provider.
from artifacts-credprovider.
I tried removing VSS_NUGET_EXTERNAL_FEED_ENDPOINTS.
Started Build 5x and 5x got an error.
2018-11-30T09:15:14.2877565Z GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'&semVerLevel=2.0.0
2018-11-30T09:15:14.2877710Z Using D:\a\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.0.48\node_modules\nuget-task-common\NuGet\CredentialProviderV2\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe as a credential provider plugin.
2018-11-30T09:15:14.2878100Z Terminating plugin 'CredentialProvider.Microsoft' due to an unrecoverable fault: NuGet.Protocol.Plugins.ProtocolException: A plugin protocol exception occurred. ---> NuGet.Protocol.Plugins.ProtocolException: The message type 'Cancel' is invalid at this time.
2018-11-30T09:15:14.2878255Z at NuGet.Protocol.Plugins.OutboundRequestContext`1.HandleCancelResponse()
2018-11-30T09:15:14.2878369Z at NuGet.Protocol.Plugins.MessageDispatcher.OnMessageReceived(Object sender, MessageEventArgs e)
2018-11-30T09:15:14.2878464Z at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
2018-11-30T09:15:14.2878574Z at NuGet.Protocol.Plugins.StandardOutputReceiver.OnLineRead(Object sender, LineReadEventArgs e)
2018-11-30T09:15:14.2878665Z --- End of inner exception stack trace ---
I will test again when the exception in the NuGet build tasks is fixed.
from artifacts-credprovider.
@PeterJakubik were you able to get this resolved?
from artifacts-credprovider.
I removed VSS_NUGET_EXTERNAL_FEED_ENDPOINTS, NuGet.ForceEnableCredentialProvider, NuGet_ForceEnableCredentialProviderV2 Pipline Variables and now I have only Nuget credentials provider .
It seems to be working right now.
from artifacts-credprovider.
I still need to set VSS_NUGET_EXTERNAL_FEED_ENDPOINTS
explicitly in order for this to work on Mac agents even after installing the latest credentials provider. Adding all the endpoints as nuget service connections didn't work. The same tokens specified in the envvar do work, however.
from artifacts-credprovider.
@kzu if you're using the NuGetCommandV2 task with nuget version 4.8 or greater, it should automatically use the version of the cred provider that gets installed with the task, so you shouldn't have to install it separately. In the task, if you're using feeds in your nuget.config, the task will use the PATs that you set in the task as service connections and behind the scenes will populate VSS_NUGET_EXTERNAL_FEED_ENDPOINTS for you without you having to set it manually.
Please make sure that the service connections that you set in the task are PATs and that you're using the External Azure DevOps Server type of service connection:
If you're still having issues after verifying the service connection and removing the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS variable, please set the system.debug build variable to true and share the failing logs and I can take a look.
from artifacts-credprovider.
we're using msbuild /t:restore
, not the nuget task. Would that apply in that case too?
from artifacts-credprovider.
For cases that are not using the NuGetCommandV2 task, you have to set things up manually.
from artifacts-credprovider.
Related Issues (20)
- Issue authenticating to Azure Artifacts via Python behind firewall decryption HOT 1
- Use Windows authentication context from in WSL HOT 6
- System.Security.Cryptography.CryptographicException on remote connections HOT 10
- The last Create 1.1.0 release Build Failed. When v1.1.0 will be released? HOT 6
- The messages logged by the credential providers are not localized. HOT 4
- Inconsistent account selection modal behavior across operating systems HOT 3
- MsalInteractiveTokenProvider breaks if no console window handle available HOT 4
- Artifacts Conda Remove SDK Dependency HOT 2
- Credential provider is not working on new laptop HOT 4
- `JsonException` with Release `1.1.0` when using `VSS_NUGET_EXTERNAL_FEED_ENDPOINTS` HOT 4
- dotnet list <SOLUTION> package --vulnerable/--outdated/--deprecated fails with Azure Artifacts Credential Provider HOT 10
- Are the Requirements Correct? HOT 4
- The proxy tunnel request to proxy failed with status code '407' HOT 1
- .NET 8 is not supported yet
- nuget not prompting for credentials when querying Azure Artifacts feed on WSL HOT 5
- CVE-2024-38095 being picked up in security scan
- Breaking change in VSS_NUGET_EXTERNAL_FEED_ENDPOINTS HOT 2
- dotnet restore --interactive FROZEN HOT 7
- Not working in Linux PowerShell with `Register-PSRepository` on a Ubuntu docker image HOT 1
- CVE-2024-35255 being picked up in security scan
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artifacts-credprovider.