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

GetMetadataAsync() throws "'0.0.0-~3' is not a valid version string" #5935

Closed
mistakenot opened this issue Sep 25, 2017 · 3 comments
Closed
Labels
Resolution:External This issue appears to be External to nuget
Milestone

Comments

@mistakenot
Copy link

Retrieving Metadata for particular packages, in this case "MassTransit.RavenDbIntegration", causes the .NET client to throw an exception when enumerating the results:

System.ArgumentException occurred
HResult=-2147024809
Message='0.0.0-~3' is not a valid version string.
Source=NuGet.Versioning
StackTrace:
at NuGet.Versioning.VersionRange.Parse(String value, Boolean allowFloating)
at NuGet.Protocol.PackageDependencyGroupConverter.LoadDependency(JToken dependency)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at NuGet.Protocol.PackageDependencyGroupConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.ToObject[T](JsonSerializer jsonSerializer)
at NuGet.Protocol.PackageMetadataResourceV3.ParseMetadata(JObject metadata)...

Code to repoduce is:

var resource = _sourceRepository.GetResource<PackageMetadataResource>();
var metadata = await resource.GetMetadataAsync(id, true, false, new NullLogger(), CancellationToken.None); 
metadata.ToList();

Where Id = "MassTransit.RavenDbIntegration".

Using Nuget.Client and related packages at version 4.2.0 on .NET Framework 4.6.

@emgarten
Copy link
Member

The work to remove invalid version ranges from the nuget.org v3 feed is here: NuGet/NuGetGallery#3482

@mishra14
Copy link
Contributor

@emgarten does this need work from the client side? or can we close this as external?

@emgarten
Copy link
Member

Currently there is no client side worked planned. Feeds should not return invalid data.

We could ignore these bad ranges on the client side. If v2 does this we could consider it.

@rrelyea rrelyea added the Resolution:External This issue appears to be External to nuget label Oct 2, 2017
@rrelyea rrelyea added this to the 4.5 milestone Oct 2, 2017
@rrelyea rrelyea removed the Viewed label Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:External This issue appears to be External to nuget
Projects
None yet
Development

No branches or pull requests

5 participants