Comments (25)
I have narrowed it down to that this occurs when using "dotnet restore". If I do "nuget.exe restore" it works all the time.
from artifacts-credprovider.
The issue is still being investigated with the help of the NuGet client team. In the meantime, clearing the nuget http-cache before running the install, as well as increasing plugin timeout values, seems to help.
nuget locals http-cache -c
$env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS=20
$env:NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS=20
from artifacts-credprovider.
NuGet 5.2.0 works for me, tried 2 builds of 10 agents, all passed. And the release notes of 5.2.0 point to many fixes around authentication, including NuGet/Home#8198 which very much look like the current issue. Thanks @satbai.
from artifacts-credprovider.
Thank you for reporting. Does this happen intermittently, and if so, what's the failure rate? In your pipeline, are you using a hosted or private agent? Seeing the whole log, including everything that both the NuGet build task and the cred provider writes, might help investigation.
from artifacts-credprovider.
It is intermittent. We had a 12 hour window when 4 of 7 CI builds failed with this issue. But we haven't hit it in the past ~24 hours. We are using private agents.
I took a look at the 4 recent instances, and 2 of them don't appear to have anything untoward in the logs, beyond what I already shared. The other 2, however, do have logs that suggest that spurious 401's were returned by the package source (all package sources that we're pulling from are Azure Artifact Feeds). I've attached those logs:
InterestingLog1.txt
InterestingLog2.txt
from artifacts-credprovider.
Thanks for the logs. I can see "Object reference not set to an instance of an object." in the logs, which is certainly interesting. Could you add a build variable system.debug = true
in your pipeline and make sure the task has Verbosity set to detailed? After those settings the following logs should have more details. We need to determine whether this error is thrown by the cred provider or NuGet and hopefully the more verbose logs will help.
FYI @dtivel
from artifacts-credprovider.
I haven't been able to get a repro so I have a few more questions. When is the first time you started seeing this error? How many feeds do you have in your nuget.config? Are they all feeds from Azure DevOps Artifacts? Do you have a lot of packages you're restoring?
from artifacts-credprovider.
We have this problem at the moment also.
We are using NuGet.exe v4.9.3 on AzureDevOps, installed using the NuGetToolInstaller@0 and restore performing through "dotnet build" (dotnet 2.2.105).
This was intermittent for us for a while, but now we have a pipeline that we never get to pass because of this error.
C:\Program Files\dotnet\sdk\2.2.105\NuGet.targets(114,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/[org]/_packaging/[name]/nuget/v3/index.json. [D:\a\1\s\src[project][project].csproj]
C:\Program Files\dotnet\sdk\2.2.105\NuGet.targets(114,5): error : A task was canceled. [D:\a\1\s\src[project][project].csproj]
from artifacts-credprovider.
Possibly related to NuGet/Home#8198
from artifacts-credprovider.
According to the discussion in the related NuGet issue, the new version 5.1 should have some logging fixes that might help investigating this issue. Please try updating the NuGet version and see if the logs are more interesting.
from artifacts-credprovider.
Sorry for the delay in replying. I'll switch to NuGet 5.1 and keep an eye on things. Here's the details that satbai asked for back in May:
When is the first time you started seeing this error?
We'd seen it occasionally before (maybe a couple of times per week?), but a tight cluster of hits that took out half the builds in an afternoon (as I commented before) resulted in this issue.
How many feeds do you have in your nuget.config? Are they all feeds from Azure DevOps Artifacts?
At the time we had 7 feeds in nuget.config. All of them were from AzureDevOps. One of them Upstreamed nuget.org (which is how we 'proxy' nuget.org). To try and help with this incident I moved three of the feeds to be Upstreamed by the upstream feed we already had, leaving us with 4 feeds in Nuget.config.
Do you have a lot of packages you're restoring?
We restore ~140 packages.
from artifacts-credprovider.
I have narrowed it down to that this occurs when using "dotnet restore". If I do "nuget.exe restore" it works all the time.
Thanks a lot.
We had the same issue, and with your hint, using "nuget.exe restore", it works like a charm.
from artifacts-credprovider.
Hey team. I'm receiving a similar error when restoring on TeamCity:
[09:21:03][Execute nuget:restore] https://pkgs.dev.azure.com/{company}/_packaging/{feed}/nuget/v3/index.json: Unable to load the service index for source https://pkgs.dev.azure.com/{company}/_packaging/{feed}/nuget/v3/index.json.
[09:21:03][Execute nuget:restore] A task was canceled.
This is unfortunate because when I was testing Azure Artifacts everything worked fine. This also appears to be intermittent for us. I've moved 50,000 packages from our hosted server to Azure Artifacts and was hoping I can get this running today.
Can anyone advise what to do? We're using nuget.exe.
Edit: This may just be an authentication issue. Currently investigating.
Edit2: The error message is a bit misleading. I had to restart our build agents to pick up the environment variables. Thanks!
from artifacts-credprovider.
When reading the discussion related to the NuGet issue jeffkl mentioned earlier, it sounds like for those who see this error with nuget.exe, there might be a fix for this in the next version of NuGet that's coming up (version 5.2?).
from artifacts-credprovider.
We have a similar issue on Azure hosted agents (Hosted VS 2017). Unlike @cannehag, in our case nuget restore
fails with the same error (and we cannot use dotnet restore
). With 5.1.0 the following error is reported:
Problem starting the plugin 'D:\a\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.155.0\CredentialProviderV2\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe'. A task was canceled.
Tried with NuGet 4.9.1 and 4.9.2 following NuGet/Home#7699, and also 5.1.0, all installedusing the NuGetToolInstaller task, but they all fail. Very occasionally one of the 6 failing jobs succeeds to restore, randomly, then fails again on next CI run. The other 4 jobs almost always succeed. All 10 jobs are running in parallel on different agents, and restoring one single prerelease package each from the same owner on nuget.org with no other source configured. This was working fine until yesterday 30th July although we had only 2 jobs instead of 10, although the issues started to manifest today 31st July even before I increased the number of jobs.
from artifacts-credprovider.
Hi @djee-ms
If the only package source is nuget.org, the credential provider shouldn't be launched. Could you try with NuGet 5.2? It looks like it's now available for download.
from artifacts-credprovider.
No, 5.2 doesn't work. It failed consistently for one of my pipelines. But others with same build template works fine. I have to use the fix in another github issue by adding two build variables:
NuGet.ForceEnableCredentialProvider: true and NuGet_ForceEnableCredentialProviderV2: false (lower case true and false)
Looks like v2 has some weird authentication errors. as the status code is 401.
It begins to work after I remove NuGet tool installer task, this means NuGet is back to the default version of 4.1.0
from artifacts-credprovider.
@djee-ms that's great!
@melcloud the most common reason for a 401 in the pipeline is that one of your PATs in your service connections is expired. Could you please verify that all of them are valid? This cred provider only works with NuGet 4.8 or higher, so version 4.1 will use the old authentication method.
from artifacts-credprovider.
This is still a problem with Nuget 5.3 in Azure pipelines. The restore fails in my project after ~50 seconds with the same error.
from artifacts-credprovider.
Experiencing the same problem on NuGet 5.3:
##[error]The nuget command failed with exit code(1) and error(Problem starting the plugin
'd:\a\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.158.0\CredentialProviderV2\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe'.
Plugin 'CredentialProvider.Microsoft' failed within 0.716 seconds with exit code -1.)
##[error]Packages failed to restore
from artifacts-credprovider.
For me adding -DisableParallelProcessing option to "nuget restore" command resolved this issue with latest nuget and CredProvider.
from artifacts-credprovider.
If anyone else hits this issue, I've had the same issue with one restore working and another failing in Azure DevOps using NuGet 5.3.1.
I had to add disableParallelProcessing to the restore step
from artifacts-credprovider.
This is an instance of NuGet/Home#8528
from artifacts-credprovider.
According to the discussion in the NuGet issue posted above, NuGet version 5.5.x should have all fixes related to this problem, and it looks like there is a preview version now available. Please update to nuget 5.5.x with the latest cred provider release 0.1.20.
from artifacts-credprovider.
According to the discussion in the NuGet issue posted above, NuGet version 5.5.x should have all fixes related to this problem, and it looks like there is a preview version now available. Please update to nuget 5.5.x with the latest cred provider release 0.1.20.
We are using nuget 5.8.1 and still hitting this issue with Azure feeds. about 1 in 5 builds will fail because auth and restore fail. Re-run the job, and it passes.
I'm going to try moving our CiCd pipeline to the latest version of nuget available, but I don't have confidence that will fix the reliability issue, since many posts on this thread expects this bug to be fixed before 5.8.1 that we are already using.
from artifacts-credprovider.
Related Issues (20)
- How to do enhanced debugging? HOT 1
- 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
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.