-
Notifications
You must be signed in to change notification settings - Fork 82
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
Libraries could not be resolved by the "cdnjs" provider #685
Comments
The workaround is to clear Libman cache |
possibly related to cdnjs API change, see cdnjs/cdnjs#14140; it's being rolled out partially, which would explain the intermittent failure |
Ah. Cleaning cache is just a lucky shot I think the main issue is related to Libman still uses the old endpoint:
Failed restore/install fall into their 10% production request I think clean cache somehow and sometime helps our request to fall outside of above 10% :D |
yes I think so |
Hey folks, just wanted to note that after a quick read through the code here, it does seem like this is caused by the deprecation of the The fix for libman here would be to use the |
Does someone have an example of syntax to do this? This is what I have been doing: |
it's not a change for the end user, MattIPv4 is suggesting LibMan issue an update to their code, something that could take days, to conform to the altered API behavior.... instead of just reverting the cdnjs api change that is causing this issue |
Unfortunately, LibMan is not the only consumer of the cdnjs API, and the deprecation that caused this issue is part of larger ongoing work across the API to improve stability (the cdnjs API often runs 5xx errors for assorted consumers, not just LibMan users). We're not really in a position where we can revert this API change as doing so will only increase the failure rate for the API generally. |
I understand the change is necessary and inevitable, but time could and should be given to allow for proper deprecation updates by all the users of the API who may be negatively affected (or outright broken) by this change. By your own proposal the deprecation was fast-tracked under the incorrect assumption nobody would be affected... |
I appreciate what you're saying, and this is why we're approaching this as a slow rollout with only 10% of traffic reaching endpoints that implement this deprecation, so that folks are made aware of if they're impacted by the deprecation (turns out it's pretty impossible to determine who consumes what properties of a public API just looking at unauthenticated GET requests), but can also still easily get around the deprecation by just re-requesting (falling into the 90% of traffic that is unaffected at present). Until we hear more here in terms of what a fix would look like on LibMan's end, we don't intend to further rollout the change, so it will remain at 10% for now. That being said, ultimately we will have to continue with this deprecation as until we complete this rollout a large number of requests to the API from all consumers, not just LibMan users, will continue to fail unexpectedly. |
Just quickly jumping in here to say: I'm working on the code change for LibMan, but the rollout will require servicing each version of Visual Studio that includes it (2017, 2019, 2022). There will be some delays to prepare the LibMan builds and VS servicing changes in each product, and then ultimately it will require customers to install the updates as well. I don't have timelines yet, I'm focusing first on making the code change for VS2022 and our CLI tool, then I will start investigating the servicing requirements for each VS release. |
I think the safest and fastest way to workaround this issue is to include the successfully generated static files by LibMan to our project (when our restore client-side libraries command falls into the 90% of traffic that is unaffected at present) and then disable LibMan. We can re-enable it when the issue is fixed. Another workaround is try to use other CDN providers like filesystem, jsdelivr, unpkg instead of cdnjs for LibMan Cleaning LibMan cache is not really a workaround for this issue. |
I'm not sure if this will help but in our case we had a "dotnet restore" followed by a "dotnet publish" the publish was restoring the packages again. So I disable that by "dotnet publish --no-restore" and the build is now happy. |
Alright, for folks using the CLI tool or MSBuild task could you please update to the latest version (2.1.174) and see if you have any issues with that? From a few projects I've tried, it's working fine. This will be the fastest way to workaround the issue (at least for unblocking CI or local builds) as the VS servicing cycle will take a longer to sort out. Timeline on VS updates still TBD... |
On our azure pipelines we are getting this error after updating the package to the 2.1.174 version, this persists even if we have Newtonsoft.Json installed.
|
updating the MSBuild task fixed the issue for me building locally, thank you @jimmylewis for the timly fix; our azure devops pipeline is using the CLI tool and was running flawlessly all the time, so I guess it is/was still on the 90% of traffic unaffected by the API change. |
Running into Hyrum's Law: With a sufficient number of users of an API, |
cdnjs issue is resolved in the new update of the LibraryManager package. |
I just tried the new version, and I'm still having problems:
|
@thiago-bessa try again after running I was able to restore fine with this libman.json file
|
have you tried to clean cache using this? |
Sorry @farhadmammadli and @jimmylewis, I didn't copy/paste everything. I did run Now I ran it an hour later (same cmd prompt, with the same project), and it could restore everything. Then I ran it in other project of ours (after the first one restored correctly), and it again failed to resolve: Then I just ran restore for 3 times in a row, it finally worked. It seems kind of intermittent. |
any ETA? |
@JosephAmalfitanoSSA The releases with the fix were made available mid July: #685 (comment) |
@MattIPv4 I noticed that, but i see the ticket is still marked open. I assumed because it wasn't working again. I'm still running into. I've tried:
All results are the same X library could not be resolved by the "cdnjs" provider. |
Update VS to latest stable AND update the Library Manager (Microsoft.Web.LibraryManager.Build) to the latest in the project. |
Ahh -- that was the "maybe something else i can't remember"...tried as well. If it's working for the general population, then maybe it's a proxy issue on my end then. |
If you can capture network traces of the requests sent by VS or by the libman tool, we can try to figure out what is going wrong (either the message is getting caught by a proxy, an error being returned from the API, or unexpected response content). |
I'm also running into this |
My issue was a proxy issue. It looks like if you have a Steps for me to remedy
|
@mmcdonald47 can you capture a Fusion log while running the build? The NuGet package includes a copy of that assembly, so I'm wondering if that log can help clarify why it's not being located. (See how to capture Fusion logs at https://docs.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer) |
@jimmylewis how can I install this in my Azure CI pipeline? I've tried adding a Command Line Script task, but when running the build it failed because it couldn't recognize (Apologies for my ignorance. I've not had much experience configuring CI pipelines.) |
@mmcdonald47 I assume this only occurs on your CI and not locally? In that case, we can try doing it with via the registry, as in https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net The |
@jimmylewis per that SO post I was able to locate the Fusion Log Viewer and get some more information after running my application locally. In checking the logs I see this message
|
Updating to |
I also have the issue with Newtonsoft.Json, Version=13.0.0.0 during deployments. Did anyone found a solution for it? |
If you are using Newtonsoft directly then upgrade it to the latest v13. If you are including another package that uses Netwonsoft then upgrade that. Or add Newtonsoft v13 and set it to be used for all versions. Newtonsoft less than v13 has a vulnerability so should no longer be used. This is not on Topic though and there is enough help for mismatched package versions on stack overflow etc. |
@mentormate-ivandzhunov you can try the solution in this StackOverflow post: https://stackoverflow.com/questions/46111749/adding-a-bindingredirect-to-a-net-standard-library/46120907#46120907 My solution was to uninstall LibraryManager, though that doesn't seem like a real solution to me. |
At my side, in my csproj, I made the following change, and it finally works gracefully!!! from
to
|
I confirm |
This issue is fixed. Please create another bugs for other issue! Thank you very much! 😄 |
Is there a workaround for VS2017? The issue is still present there with Microsoft.Web.LibraryManager.Build.2.1.175 |
@GeorgeMaharis123 Did you update VS2017 to the latest version? |
@GeorgeMaharis123 unfortunately we hadn't maintained the build infrastructure for VS2017 over the last several years, and our CI configurations aren't currently able to build the This is the first request we've received about this issue on VS2017; our telemetry showed very little remaining usage in that version of VS, so we originally postponed the effort to get the build pipeline running again. I'll see if I can request some resources (i.e. time) to get the CI build running again to put the fix into a servicing patch for VS2017. |
@duykhiem Yes, i am using version 15.9.50 |
@LLIAMAH can you get a network trace of the requests and responses? |
I took fiddler stack - if you need some special info please guide me which props i've to switch on to help you to investigate problem. https://github.com/LLIAMAH/CDNPoblemVS2022/blob/master/FiddlerStack.txt |
Edit : As I spoke about all of the versions of Visual Studio that I tried to use to overcome this issue below, I had one remaining Visual Studio component listed in the installer as having an available update that should have had absolutely nothing to do with my reported problem. Visual Studio Build Tools 2017 had an available update and after updating 2019, 2022 and 2022 Preview, I went ahead and updated the 2017 Build Tools to 15.9.50 and imediately afterwards, I tried to build my project in vs2019 and it worked. I then did a clean and tried vs2022 and it worked there too. I don't know how this could have affected this issue or if it is a Red Herring, but I no longer have the problem, for now. Here is the Original Problem The Error
** Most of What I have Tried and I got the Same Error**
Beyond That |
Describe the bug
We are having an issue with the "cdnjs" provider when building our project in both Hanoi, Vietnam, and Grimstad, Norway.
It is happening with both local build and Azure DevOps Pipeline build.
Failed on some random libraries like jquery@3.4.1, tabulator@4.4.1, tempusdominus-bootstrap-4@5.1.2...
Error:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Build and restore client libraries successfully
Screenshots
Additional context
LibMan CLI version: 2.1.161+abc97ecc7d.RR
Visual Studio 2022
Microsoft.Web.LibraryManager.Build" version="2.1.161" targetFramework="net472"
The text was updated successfully, but these errors were encountered: