isaacabraham / vsts-fsharp

Azure Devops extension for F#-friendly tools
https://marketplace.visualstudio.com/items?itemName=isaacabraham.fsharp-helpers-extension
Apache License 2.0
13 stars 7 forks source link

Paket restore failing with TF400813 #22

Closed sdargaud closed 5 years ago

sdargaud commented 5 years ago

Hi,

We noticed that since today the paket restore task fails while trying to download a package from our internal Azure DevOps nuget feed: failed with: 401 Unauthorized - TF400813: Resource not available for anonymous access. Client authentication required. It was working flawlessly for months (using the previous F# extension). I wonder if this is due to the renaming / rebranding. I tried uninstalling / reinstalling the extension but it keeps telling me it's version 0.x. Here is the output from the setup credentials task

2018-09-11T12:01:14.2825206Z ##[debug]Evaluating condition for step: 'Setup Paket Credential Manager' 2018-09-11T12:01:14.2825932Z ##[debug]Evaluating: succeeded() 2018-09-11T12:01:14.2826214Z ##[debug]Evaluating succeeded: 2018-09-11T12:01:14.2826563Z ##[debug]=> True 2018-09-11T12:01:14.2826909Z ##[debug]Result: True 2018-09-11T12:01:14.2827208Z ##[section]Starting: Setup Paket Credential Manager 2018-09-11T12:01:14.2831015Z ============================================================================== 2018-09-11T12:01:14.2831177Z Task : Paket Credential Manager 2018-09-11T12:01:14.2831347Z Description : Creates a credential manager for Paket to access internal NuGet feeds. 2018-09-11T12:01:14.2831489Z Version : 0.2.0 2018-09-11T12:01:14.2831608Z Author : Matthias Dittrich 2018-09-11T12:01:14.2831794Z Help : This task allows you to consume NuGet packages hosted in your own private feed by providing a credential manager. 2018-09-11T12:01:14.2831993Z ============================================================================== 2018-09-11T12:01:14.5802704Z ##[debug]agent.TempDirectory=D:\a_temp 2018-09-11T12:01:14.5830611Z ##[debug]loading inputs and endpoints 2018-09-11T12:01:14.5837350Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2018-09-11T12:01:14.5855333Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2018-09-11T12:01:14.5858164Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2018-09-11T12:01:14.5865165Z ##[debug]loaded 3 2018-09-11T12:01:14.5883689Z ##[debug]Agent.ProxyUrl=undefined 2018-09-11T12:01:14.5886098Z ##[debug]Agent.CAInfo=undefined 2018-09-11T12:01:14.5886458Z ##[debug]Agent.ClientCert=undefined 2018-09-11T12:01:14.5886761Z ##[debug]Agent.SkipCertValidation=undefined 2018-09-11T12:01:14.6489217Z ##[debug]Agent.ProxyUrl=undefined 2018-09-11T12:01:14.6492950Z ##[debug]check path : D:\a_tasks\setCredentialManager_c2aea098-6aab-4cd3-9a0c-57b074df3df5\0.2.0\node_modules\vsts-task-tool-lib\lib.json 2018-09-11T12:01:14.6494724Z ##[debug]adding resource file: D:\a_tasks\setCredentialManager_c2aea098-6aab-4cd3-9a0c-57b074df3df5\0.2.0\node_modules\vsts-task-tool-lib\lib.json 2018-09-11T12:01:14.6495645Z ##[debug]system.culture=en-US 2018-09-11T12:01:14.6637804Z ##[debug]set NUGET_CREDENTIALPROVIDERS_PATH=D:\a_tasks\setCredentialManager_c2aea098-6aab-4cd3-9a0c-57b074df3df5\0.2.0\node_modules\vsts-fsharp-task-common\CredentialProvider 2018-09-11T12:01:14.6640219Z ##[debug]Processed: ##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDERS_PATH;issecret=false;]D:\a_tasks\setCredentialManager_c2aea098-6aab-4cd3-9a0c-57b074df3df5\0.2.0\node_modules\vsts-fsharp-task-common\CredentialProvider 2018-09-11T12:01:14.6665240Z SYSTEMVSSCONNECTION exists true 2018-09-11T12:01:14.6665749Z ##[debug]SYSTEMVSSCONNECTION exists true 2018-09-11T12:01:14.6666816Z ##[debug]set PAKET_VSS_NUGET_ACCESSTOKEN= 2018-09-11T12:01:14.6669114Z ##[debug]Processed: ##vso[task.setvariable variable=PAKET_VSS_NUGET_ACCESSTOKEN;issecret=false;] 2018-09-11T12:01:14.6753259Z ##[section]Finishing: Setup Paket Credential Manager

And the error in the paket restore task :

2018-09-11T12:01:14.6777813Z ##[debug]Evaluating condition for step: 'Restore Paket dependencies' 2018-09-11T12:01:14.6778736Z ##[debug]Evaluating: succeeded() 2018-09-11T12:01:14.6779003Z ##[debug]Evaluating succeeded: 2018-09-11T12:01:14.6779349Z ##[debug]=> True 2018-09-11T12:01:14.6779712Z ##[debug]Result: True 2018-09-11T12:01:14.6780017Z ##[section]Starting: Restore Paket dependencies 2018-09-11T12:01:14.6784206Z ============================================================================== 2018-09-11T12:01:14.6784390Z Task : Paket Restore 2018-09-11T12:01:14.6784527Z Description : Restores your Paket dependencies. 2018-09-11T12:01:14.6785219Z Version : 0.4.0 2018-09-11T12:01:14.6785366Z Author : Isaac Abraham 2018-09-11T12:01:14.6785569Z Help : This task restores your dependencies from the paket.dependencies file located in your repository. 2018-09-11T12:01:14.6785783Z ============================================================================== 2018-09-11T12:01:14.6885487Z ##[debug]Working directory: 'D:\a\1\s.paket' 2018-09-11T12:01:14.6886058Z ##[debug]Fail on standard error: 'True' 2018-09-11T12:01:14.6886245Z ##[debug]Modify environment: 'False' 2018-09-11T12:01:14.6886482Z ##[debug]C:\Windows\system32\cmd.exe /c "D:\a_tasks\PaketRestore_90d5ae45-3fc2-4ede-b572-9a57379fbf8a\0.4.0\Paket.bat " 2018-09-11T12:01:14.6886742Z ##[command]D:\a_tasks\PaketRestore_90d5ae45-3fc2-4ede-b572-9a57379fbf8a\0.4.0\Paket.bat 2018-09-11T12:01:16.4981978Z Checking Paket version (downloading latest stable)... 2018-09-11T12:01:20.2241376Z Hash file of version 5.177.2 not found in cache. 2018-09-11T12:01:20.2242222Z Starting download from https://github.com/fsprojects/Paket/releases/download/5.177.2/paket-sha256.txt 2018-09-11T12:01:20.8230095Z Version 5.177.2 not found in cache. 2018-09-11T12:01:20.8245854Z Starting download from https://github.com/fsprojects/Paket/releases/download/5.177.2/paket.exe 2018-09-11T12:01:25.0115608Z Done in 8.94 second(s). 2018-09-11T12:01:25.1849319Z Paket version 5.177.2 2018-09-11T12:01:26.1437883Z Starting full restore process. 2018-09-11T12:01:26.2620572Z Downloading Akka 1.3.9 2018-09-11T12:01:26.2634085Z Downloading Hyperion 0.9.8 2018-09-11T12:01:26.3110333Z Downloading Microsoft.AspNet.WebApi.WebHost 5.2.3 2018-09-11T12:01:26.3114893Z Downloading RazorEngine 3.10.0 2018-09-11T12:01:26.9184795Z Possible Performance degradation, V3 was not working: One or more errors occurred. 2018-09-11T12:01:26.9185857Z Possible Performance degradation, V3 was not working: One or more errors occurred. 2018-09-11T12:01:26.9248432Z Possible Performance degradation, V3 was not working: One or more errors occurred. 2018-09-11T12:01:26.9576168Z Possible Performance degradation, V3 was not working: One or more errors occurred. 2018-09-11T12:01:26.9646000Z Possible Performance degradation, V3 was not working: One or more errors occurred. 2018-09-11T12:01:27.0696741Z Possible Performance degradation, blacklist '1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='hyperion',Version='0.9.8')' 2018-09-11T12:01:27.0736498Z Possible Performance degradation, blacklist '1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='MyLib.web.mvc5',Version='5.7.5')' 2018-09-11T12:01:27.0736952Z Possible Performance degradation, blacklist '1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='akka',Version='1.3.9')' 2018-09-11T12:01:27.7197953Z Possible Performance degradation, blacklist '1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='Hyperion',Version='0.9.8')' 2018-09-11T12:01:27.7214377Z Possible Performance degradation, blacklist '1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='MyLib.Web.Mvc5',Version='5.7.5')' 2018-09-11T12:01:27.7214706Z Possible Performance degradation, blacklist '2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(Id eq 'Hyperion') and (NormalizedVersion eq '0.9.8')' 2018-09-11T12:01:27.7217329Z Possible Performance degradation, blacklist '2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'MyLib.web.mvc5') and (NormalizedVersion eq '5.7.5')' 2018-09-11T12:01:27.7217663Z Possible Performance degradation, blacklist '2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(Id eq 'Hyperion') and (Version eq '0.9.8')' 2018-09-11T12:01:27.7217996Z Possible Performance degradation, blacklist '2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'MyLib.web.mvc5') and (Version eq '5.7.5')' 2018-09-11T12:01:27.7218336Z Possible Performance degradation, blacklist '2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'hyperion') and (Version eq '0.9.8')' 2018-09-11T12:01:27.7218647Z Source 'https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v3/index.json' exception: System.Exception: All possible sources are already blacklisted. 2018-09-11T12:01:27.7218946Z - 1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='razorengine',Version='3.10.0') 2018-09-11T12:01:27.7219354Z - 1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='razorengine',Version='3.10.0') 2018-09-11T12:01:27.7219581Z - 1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='RazorEngine',Version='3.10.0') 2018-09-11T12:01:27.7219797Z - 1_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages(Id='RazorEngine',Version='3.10.0') 2018-09-11T12:01:27.7220037Z - 2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(Id eq 'RazorEngine') and (NormalizedVersion eq '3.10.0') 2018-09-11T12:01:27.7220471Z - 2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'razorengine') and (NormalizedVersion eq '3.10.0') 2018-09-11T12:01:27.7221038Z - 2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(Id eq 'RazorEngine') and (Version eq '3.10.0') 2018-09-11T12:01:27.7221266Z - 2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'razorengine') and (Version eq '3.10.0') 2018-09-11T12:01:27.7221656Z - 2_https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'razorengine') and (Version eq '3.10.0') 2018-09-11T12:01:27.7221851Z at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1645.Invoke(String message) 2018-09-11T12:01:27.7222679Z at Paket.NuGetCache.tryAndBlacklistUrl@583-8.Invoke(Tuple2 _arg5) 2018-09-11T12:01:27.7222831Z at Microsoft.FSharp.Control.AsyncBuilderImpl.args@506-1.Invoke(a a) 2018-09-11T12:01:27.7223239Z Source 'https://<myfeed>.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v3/index.json' exception: System.Exception: error ---> System.Exception: Could not retrieve data from 'https://<myfeed>.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'MyLib.web.mvc5') and (Version eq '5.7.5')' ---> Paket.NetUtils+RequestFailedException: Request to 'https://<myfeed>.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v2/Packages?$filter=(tolower(Id) eq 'MyLib.web.mvc5') and (Version eq '5.7.5')' failed with: 401 Unauthorized - TF400813: Resource not available for anonymous access. Client authentication required. 2018-09-11T12:01:27.7223831Z at Paket.NetUtils.failIfNoSuccess@219-5.Invoke(RequestFailedInfo _arg1) 2018-09-11T12:01:27.7224196Z at Microsoft.FSharp.Control.AsyncBuilderImpl.args@506-1.Invoke(a a) 2018-09-11T12:01:27.7224358Z --- End of inner exception stack trace --- 2018-09-11T12:01:27.7224509Z at Paket.NetUtils.getFromUrl@512-2.Invoke(Exception _arg4) 2018-09-11T12:01:27.7224693Z at Microsoft.FSharp.Control.AsyncBuilderImpl.callA@522.Invoke(AsyncParams1 args) 2018-09-11T12:01:27.7225416Z --- End of inner exception stack trace --- 2018-09-11T12:01:27.7226063Z at Paket.NuGetV2.getDetailsFromNuGetViaODataFast@379-1.Invoke(FSharpChoice`2 _arg5) 2018-09-11T12:01:27.7226274Z at Microsoft.FSharp.Control.AsyncBuilderImpl.args@506-1.Invoke(a a) 2018-09-11T12:01:27.7226554Z Something failed in GetPackageDetails, trying again with force: Couldn't get package details for package RazorEngine 3.10.0 on https://.pkgs.visualstudio.com/_packaging/ItechToolsFeed/nuget/v3/index.json. ...

I am not sure the v3 version of the feed ever worked and maybe this is the root cause ?

Any help would be greatly appreciated!

matthid commented 5 years ago

Sorry, I'll try to reproduce this tomorrow. I probably broke something :/. As a workaround can you try to get the latest version from https://github.com/matthid/Paket.TeamBuildCredentials/releases/tag/0.2.1 and install into your tfs/vsts/azure devops and try again?

sdargaud commented 5 years ago

Sorry I am not the administrator and cannot install extensions directly, but I can do any test in the build pipeline if needed.

matthid commented 5 years ago

Ok sorry for the delay, I hope I can push out a fix soon. I had to put something in place that this doesn't happen again. (Which is a PIA for azure devops extensions)

matthid commented 5 years ago

Ok there was indeed an additional problem with the visualstudio.com -> dev.azure.com change. Everything should be working again. Just try to edit the build process with an empty space, task version should be reported as 0.2.5

sdargaud commented 5 years ago

Thanks it's working fine!