-
Notifications
You must be signed in to change notification settings - Fork 706
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
"A task was canceled" exception with CredentialProvider.Microsoft.exe v0.1.15 #91
Comments
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. |
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: |
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 FYI @dtivel |
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? |
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. |
Possibly related to NuGet/Home#8198 |
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. |
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? 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? |
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. |
Hey team. I'm receiving a similar error when restoring on TeamCity:
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! |
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?). |
We have a similar issue on Azure hosted agents (Hosted VS 2017). Unlike @cannehag, in our case
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. |
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: 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 |
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. |
@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. |
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.
|
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. |
Experiencing the same problem on NuGet 5.3:
|
For me adding -DisableParallelProcessing option to "nuget restore" command resolved this issue with latest nuget and 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. |
This is an instance of NuGet/Home#8528 |
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. |
Our AzureDevOps build pipeline continues to see "System.Threading.Tasks.TaskCanceledException: A task was canceled." exceptions during NuGet restore, similar to #77, but we have version 0.1.15 that contains the fix for that issue.
We are using NuGet.exe v4.9.4 on AzureDevOps, installed using the NuGetToolInstaller@0 and performing a Restore using NuGetCommand@2, v2.150.0.
From the build logs, here's the NuGet.exe invocation:
Here's the output from the
CredentialProvider.Microsoft.exe
showing version information:And the unhandled exception that fails builds:
The text was updated successfully, but these errors were encountered: