Skip to content
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

When IsLatest is not set on a package user profile page doesn't load #4281

Closed
skofman1 opened this issue Jun 26, 2017 · 3 comments
Closed

When IsLatest is not set on a package user profile page doesn't load #4281

skofman1 opened this issue Jun 26, 2017 · 3 comments

Comments

@skofman1
Copy link
Contributor

For example https://www.nuget.org/profiles/kzu
The package Moq doesn't have IsLatest or IsLatestStable set.

Call stack:
System.InvalidOperationException:
at System.Linq.Enumerable.Single (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at NuGetGallery.PackageService.MergeLatestPackagesByOwner (NuGetGallery, Version=4.3.0.0, Culture=neutral, PublicKeyToken=null)
at NuGetGallery.PackageService.FindPackagesByOwner (NuGetGallery, Version=4.3.0.0, Culture=neutral, PublicKeyToken=null)
at NuGetGallery.UsersController.Profiles (NuGetGallery, Version=4.3.0.0, Culture=neutral, PublicKeyToken=null)
at lambda_method (Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39 (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`2.CallEndDelegate (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters.b__3d (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters+<>c__DisplayClass46.b__3f (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21+<>c__DisplayClass2b.b__1c (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass21.b__1e (System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)

Related to bug: #2514

Fixes:

  1. Make the code resilient to this bug (like before, this is a regression)
  2. Package reflow should recalculate IsLatest, to allow manual fix by on-call
@chenriksson
Copy link
Member

AI outerMessage is "Sequence contains more than one matching element", indicating that multiple rows were set to IsLatest. Package at fault is IFluentInterface, where both 2.0.1 and 2.0.3 versions are set to latest.

DisplayPackage is more resilient by using FirstOrDefault, however I think we should use LastOrDefault when ordering by version ascending. Will recommend fixing the exception now by using First instead of Single, but will file a separate issue to consider LastOrDefault and to fix reflow.

@kzu
Copy link

kzu commented Jun 28, 2017

Funny, just unlisted all other versions of IFluentInterface and now my profile shows up :)

Thanks for the investigation!

@chenriksson
Copy link
Member

Verified in PROD that profiles load for all users with duplicate IsLatest packages. Reflow update (#4308) will allow us to correct the IsLatest state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants