-
Notifications
You must be signed in to change notification settings - Fork 585
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
Fake.DotNet.NuGet.NuGet.getLatestPackage fails with NullReferenceException #2575
Comments
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project! |
I have run your code in the following test case:
And the test passes and the follow is the output from tracing statments:
For the second package, it returned FSharp.Core instead of Pulumi.FSharp.Kubernetes since query service matches on package title, this is the underlying GET request that was used to request the package information: The current FAKE release uses V1 of NuGet Feed which is deprecated and is no longer supported. The current WIP release has fixed this and uses the V3 NuGet Feed which will return results as shown above. So your problem should be fixed by the next release. Thanks |
I tried again today and I had the same result, I will try to do it from a Windows machine and maybe a fresh checkout of the repository. Full context for reference: https://github.com/UnoSD/Pulumi.FSharp.Extensions/blob/f43ad73fa849e7c5585da5d0f756274e6dfc409e/build.fsx#L209 Thank you EDIT: Same issue checking out the repository from scratch on a Arch Linux box OK, same problem on a Windows VM, so it must be something in my repository |
Note that fake writes a lockfile (https://github.com/UnoSD/Pulumi.FSharp.Extensions/blob/f43ad73fa849e7c5585da5d0f756274e6dfc409e/build.fsx.lock) to provide a stable build. So you need to delete it to force fake to update to latest packages to get the bugfix. |
@matthid same issue on a fresh clone of the repo, but I also just tried to remove the build.fsx.lock as suggested and I get the error anyway |
@UnoSD In your build.fsx file you have pinned FSharp.Core to 4.7.0 which forces Paket to install FAKE modules with version 5.19.1 Which is an old version of FAKE. Could you please try to pin FSharp.Core to 4.7.2 and try again? |
thank you for the help @yazeedobaid that is an interesting development to the story, pinning to 4.7.2 got rid of the error, but now the get package function returns the wrong package.
returns:
The package search string is therefore "Pulumi.FSharp.AzureAD", but the package returned is "Azure.Storage.Blobs" Looking at your previous message, it should match the package title, is there any way to match on ID instead? The package does not have a title specified in the NuSpec. Thank you EDIT: I've updated the packages to include the "title" in the NuSpec, but I wonder if this change is going to break other people's code, too. Given that it was working before, I presume it was searching on ID instead in the previous implementation. |
It seems that the packageid is the query string that is the one returning exact results. I tried the id property but it is the same as the title. For example, searching for Microsoft.AspNetCore.Authentication.AzureAD.UI returns results for Microsoft.AspNetCore.Authentication.Abstractions: But if you replace the id with packageid it will match exact and returns information for Microsoft.AspNetCore.Authentication.AzureAD.UI The old API was broken since NuGet has deprecated V1 of NuGet feed APIs, I can work on a PR to give more control on the API form to use for NuGet. I'm thinking of the following options: // search by title by default, or should it change to search for packageid by default? // search by packageid, id, owner, see this link for all available options Do u have any other options or thoughts on it? |
Personally, I would be OK with the search by package title or ID at this stage (as I have updated the title in my package, too). As for what would be right, I presume it should be retro-compatible with the previous behaviour not to break other people's scripts, I was able to find the package by the package ID and the nuspec did not have a title before, so I presume PID would be the most non-disruptive option for search by default; then it would be nice to have also search by different properties, but I don't know if the previous implementation also searched into those. Please do let me know if I can help. |
thank you for the help |
Description
I have a build script that has been working well for a few months, I recently re-run it and the error from the title occurred.
This is the stack trace:
The code to reproduce it:
The first line works and returns the (I presume) correct feed URL:
https://packages.nuget.org/v1/FeedService.svc
I tried running with
Bogus
as another similar issue is present in the repository, but in that case the second line seems to work (but not for me).Repro steps
Please provide the steps required to reproduce the problem
Add the code above to a build script
Run FAKE
Expected behavior
To retrieve the NuGet package details
Actual behavior
NullReferenceException
Known workarounds
No known workaround
Related information
Arch Linux
Installed as dotnet tool, dotnet fake --version:
Medium?
5.20.3
I fetched the https://packages.nuget.org/v1/FeedService.svc/ URL and does not seem to return any package (which may be the issue), is there an active URL I can hardcode instead of calling getFeedUrl to get it to work?
Thank you
The text was updated successfully, but these errors were encountered: