Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

ArgumentNullException while rendering package page



  • I have a feed with connector to official nuget feed. (
    When accessing http://nuget.it.unistreambank.ru/feeds/DEV.Libs/RavenDB.Client I get the following error (for other packages from official nuget feed everything looks fine):

    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 04.10.2013 13:04:27
    Event time (UTC): 04.10.2013 9:04:27
    Event ID: 27b1266d73814740a5ca469f780fab18
    Event sequence: 2
    Event occurrence: 1
    Event detail code: 0

    Application information:
    Application domain: /LM/W3SVC/2/ROOT-2-130253510558897946
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\Program Files\ProGet\WebApp\
    Machine name: SR-DTL03-P01

    Process information:
    Process ID: 12212
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE

    Exception information:
    Exception type: ArgumentNullException
    Exception message: Value cannot be null.
    Parameter name: packageId
    at Inedo.NuGet.Packages.NuGetPackage.<.ctor>b__5(String[] s)
    at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
    at Inedo.NuGet.Packages.NuGetPackage.<.ctor>b__3()
    at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
    at Inedo.NuGet.Packages.NuGetPackage.get_Dependencies()
    at Inedo.ProGet.WebApplication.Pages.Feeds.PackageDetailsPage.Dependencies.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Request information:
    Request URL: http://nuget.it.unistreambank.ru/feeds/DEV.Libs/RavenDB.Client
    Request path: /feeds/DEV.Libs/RavenDB.Client
    User host address: 10.77.200.73
    User:
    Is authenticated: False
    Authentication Type:
    Thread account name: NT AUTHORITY\NETWORK SERVICE

    Thread information:
    Thread ID: 43
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace: at Inedo.NuGet.Packages.NuGetPackage.<.ctor>b__5(String[] s)
    at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
    at Inedo.NuGet.Packages.NuGetPackage.<.ctor>b__3()
    at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
    at Inedo.NuGet.Packages.NuGetPackage.get_Dependencies()
    at Inedo.ProGet.WebApplication.Pages.Feeds.PackageDetailsPage.Dependencies.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)



  • That error indicates that the NuGet package is missing an ID element in the .nuspec file. Can you post the .nuspec file here to verify?



  • As I wrote in first message it comes from official nuget feed via connector. You may get the package here https://www.nuget.org/packages/RavenDB.Client/2.5.2700
    Native nuget tools cmd line and VS plugin have no problem with it.



  • Thank you for the report - we've been able to repro this behavior in our testing environment. Once we determine the problem, we will publish a new maintenance release to address the issue.



  • I've upgraded to 2.2.0
    Now the package (https://www.nuget.org/packages/RavenDB.Client/2.5.2700) page is ok, but when I try to install this package i get an error. I've found workaround:
    manually "pull to proget" the package and all it's dependencies one by one , I can install it from proget.

    If I try to pull the package with "dopwnload dependencies", I get the following exception:

    System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Sequence contains no elements
    at System.Linq.Enumerable.First[TSource](IEnumerable1 source) at Inedo.NuGet.Packages.Dependencies.PackageDependencyResolver.<>c__DisplayClass6.<ResolveDependencies>b__2(CandidateSet d) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
    at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
    at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Inedo.NuGet.Packages.Dependencies.PackageDependencyResolver.ResolveDependencies(IPackageDependencyQueryable feed, IEnumerable1 packages, DependencyResolutionOptions options)
    at Inedo.NuGet.Packages.NuGetFeed.GetAllRequiredPackages(IEnumerable`1 imports, DependencyResolutionOptions options)
    at Inedo.ProGet.WebApplication.Pages.Packages.PullFromRepositoryPage.<>c__DisplayClass20.<CreateChildControls>b__18(Object s, EventArgs e)
    at Inedo.Web.Controls.ButtonLinks.PostBackButtonLink.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



  • What error are you getting when you try to install the package?

    I'm able to reproduce the "download dependencies" issue, but I haven't had any problems downloading or installing that package.



  • Sorry, I described the situation wrong (got error message on build server and did not notice that it is not compilation time error but error from my app started by the build ).

    I use Nuget.Core to install plugins and their dependencies in my application and it failes to install RavenDb.Client package.

    Exception I get:

    System.InvalidOperationException : Unable to find version '2.5.2700' of package 'RavenDb.Client'.
    at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVersion version, Boolean allowPrereleaseVersions)
    at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
    at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version)

    Here is a test reproducing the issue:

    [TestFixture]
    public class NugetInvestigation
    {
    [Test]
    [Ignore]
    public void ProgetResolutionErrorDemoTest()
    {
    var tmpRepo = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
    Directory.CreateDirectory(tmpRepo);
    try
    {
    Console.WriteLine(tmpRepo);
    var manager = new PackageManager(PackageRepositoryFactory.Default.CreateRepository("http://nuget.it.unistreambank.ru/feeds/DEV.Libs"), tmpRepo) { Logger = new NugetConsoleLogger() };
    manager.InstallPackage("RavenDb.Client",new SemanticVersion("2.5.2700"));

            }
            finally
            {
                Directory.Delete(tmpRepo,true);
            }
          
        }
    
        public class NugetConsoleLogger : NuGet.ILogger
        {
            public FileConflictResolution ResolveFileConflict(string message)
            {
                return FileConflictResolution.Ignore;
            }
    
            public void Log(MessageLevel level, string message, params object[] args)
            {
                Console.WriteLine("[" + level + "] " + message, args);
            }
        }
    
    }


  • Sorry the test above is wrong. Issue occures when nuget resolves package with dependency on 'RavenDB.Client (= 2.5.2700)' while it is not pulled to proget.

    Here is correct test (update progetRepo URL to your local proget, please ). It creates package depnedent on RavenDB.Client and tryes to install it. When RavenDB.Client is pulled to proget it works fine , when RavenDB.Client is available only via connector it crashes with

    System.InvalidOperationException : Unable to resolve dependency 'RavenDB.Client (= 2.5.2700)'.
    at NuGet.InstallWalker.OnDependencyResolveError(PackageDependency dependency)
    at NuGet.PackageWalker.Walk(IPackage package)
    at NuGet.InstallWalker.ResolveOperations(IPackage package)
    at NuGet.PackageManager.Execute(IPackage package, IPackageOperationResolver resolver)
    at NuGet.PackageManager.InstallPackage(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)

    [TestFixture]
    public class NugetInvestigation
    {
    [Test]
    [Ignore]
    public void ProgetResolutionErrorDemoTest()
    {
    var tmp = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            string targetRepo=Path.Combine(tmp,"TargetRepo");
            string sourceRepo = Path.Combine(tmp, "SourceRepo");
    
            Directory.CreateDirectory(sourceRepo);
            Directory.CreateDirectory(targetRepo);
            Console.WriteLine(sourceRepo);
    
    
    
            //Create empty package with dependency on RavenDB.Client 2.5.2700
            var metadata = new ManifestMetadata()
            {
                Authors = "none",
                Version = "1.0.0.0",
                Id = "RavenDependentPackage",
                Description = "A description",
            };
    
            var builder = new PackageBuilder();
            builder.DependencySets.Add(new PackageDependencySet(new FrameworkName(".NETFramework,Version=v4.5"), new[] { new PackageDependency("RavenDB.Client", new VersionSpec(new SemanticVersion("2.5.2700"))) }));
            builder.Populate(metadata);
            using (FileStream stream = File.Open(Path.Combine(sourceRepo, "RavenDependentPackage.1.0.0.0.nupkg"), FileMode.OpenOrCreate))
            {
                builder.Save(stream);
            }
    
    
    
            try
            {
                //Repository hosted by proget with connector to nuget.org (put your local proget instance here)
                var progetRepo = PackageRepositoryFactory.Default.CreateRepository("http://proget/nuget/DEV.Libs");
                //Temporary folder where package would be installed
                var localRepo = PackageRepositoryFactory.Default.CreateRepository(sourceRepo);
    
                var aggregateRepository = new AggregateRepository(new[] {progetRepo, localRepo});
                var manager = new PackageManager(aggregateRepository, targetRepo) { Logger = new NugetConsoleLogger() };
                
                //just created package lookup in temporary folder repostory
                var package = localRepo.GetPackages().Where(p => p.Id == "RavenDependentPackage" && p.IsLatestVersion).First();
    
                //install from manager aware of proget and temporary folder repostories
                manager.InstallPackage(package, false, false);
            }
            finally
            {
                 Directory.Delete(targetRepo,true);
            }
          
        }
    
        public class NugetConsoleLogger : NuGet.ILogger
        {
            public FileConflictResolution ResolveFileConflict(string message)
            {
                return FileConflictResolution.Ignore;
            }
    
            public void Log(MessageLevel level, string message, params object[] args)
            {
                Console.WriteLine("[" + level + "] " + message, args);
            }
        }


  • Hmm, thanks for the repro code.

    Can you try running a Fiddler trace to see what calls to the ProGet server this is trying to use?



  • fiddler export:
    https://dl.dropboxusercontent.com/u/1055156/proget.saz

    there are only three requests and looks like you need this one:
    GET http://nuget.it.unistreambank.ru/nuget/DEV.Libs/Packages()?$filter=tolower(Id) eq 'ravendb.client'&$orderby=Id HTTP/1.1
    DataServiceVersion: 1.0;NetFx
    MaxDataServiceVersion: 2.0;NetFx
    User-Agent: NuGet/2.7.40911.225 (Microsoft Windows NT 6.2.9200.0)
    Accept: application/atom+xml,application/xml
    Accept-Charset: UTF-8
    Host: nuget.it.unistreambank.ru
    Accept-Encoding: gzip, deflate

    In response proget sends list of package versions but there is no requesed 2.5.2700. It lists 40 versions from 1.0.531 to 1.2.2005. While there are versions earlier than 1.0.531 and greater than 1.2.2005:
    https://www.nuget.org/packages/RavenDB.Client/2.5.2700



  • Thanks for the additional debugging information; we now see why this doesn't work. It would appear that NuGet stopped streaming all versions of the packages at some point, and now appends the following at the end of its package search XML...

    <link rel="next" 
    href="http://www.nuget.org/api/v2/Packages?
    $filter=tolower(Id)%20eq%
    20'ravendb.client'&$orderby=Id&
    $skiptoken='RavenDB.Clie
    nt','RavenDB.Client','1.2.2005-Unstable'" /> 
    

    So, we will need to add support for this as well... I've added this as PG-140, but it's not scheduled for a release yet. If an enterprise (i.e. paying) user requests this, we can expedite it of course.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation