msbuildazure-devopscontinuous-integrationlibman

Azure DevOps + LibMan + UNPKG Intermittent Error LIB010: Failed to download resource from unpkg.com


I've setup Continuous Integration on Azure DevOps but I keep getting an intermittent issue whereby libman fails to download a resource here's a few examples:

##[error]libman.json(0,0): Error LIB010: Failed to download resource from "http://unpkg.com/devextreme@18.2.6/dist/css/icons/dxiconsmaterial.woff2"

##[error]libman.json(0,0): Error LIB010: Failed to download resource from "http://unpkg.com/globalize@1.4.2/dist/globalize-runtime/date.js"

##[error]libman.json(0,0): Error LIB010: Failed to download resource from "http://unpkg.com/cropperjs@2.0.0-alpha/src/js/preview.js"

It's always a different package that's causing the error so I'm assuming it's a timeout issue (either too slow or I'm abusing it - not sure).

Here's the actual exception message:

exception was thrown --- [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.CacheService.<RefreshCacheAsync>d__9.MoveNext() [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : --- End of stack trace from previous location where exception was thrown --- [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Providers.Unpkg.UnpkgProvider.<RefreshCacheAsync>d__22.MoveNext() [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
[error]C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): Error : Microsoft.Web.LibraryManager.Contracts.ResourceDownloadException: Failed to download resource from "http://unpkg.com/knockout@3.4.0/package.json"
   at Microsoft.Web.LibraryManager.WebRequestHandler.<GetStreamAsync>d__5.MoveNext()

How can I remedy this issue? Is there a way of caching and reusing the downloaded packages on DevOps the same way VS does when running a build?


Solution

  • There's an updated version of the LibraryManager package which retries the downloads a few times. Install the latest and see if that helps with the problem.