Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-9577

Problem downloading artifacts from Remote and Virtual NuGet repositories

    XMLWordPrintable

    Details

    • Severity:
      High

      Description

      There is some problem setting up Virtual repository (nuget) containing a remote NuGet repository for MyGet (myget).
      ‚Äč
      This is what I get when I download directly from our MyGet (successful):

      > nuget.exe Install Internal.Json.FSharp -Verbosity detailed
      
      Attempting to resolve dependency 'Internal.Json.FSharp (= 1.1.30)'.
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Internal.Json.FSharp'
      GET https://company.myget.org/F/my_feed/auth/AUTH_TOKEN/api/v2/FindPackagesById()?id='Internal.Json.FSharp'
      GET https://company.myget.org/F/my_feed/auth/AUTH_TOKEN/api/v2/FindPackagesById?id='Internal.Json.FSharp'&$skiptoken='Internal.Json.FSharp','1.0.269-alpha'
      GET https://company.myget.org/F/my_feed/auth/AUTH_TOKEN/api/v2/FindPackagesById?id='Internal.Json.FSharp'&$skiptoken='Internal.Json.FSharp','1.0.375'
      GET https://company.myget.org/F/my_feed/auth/AUTH_TOKEN/api/v2/package/Internal.Json.FSharp/1.1.30
      

      However, when I configure NuGet with the Virtual Repository i get an error:

      > nuget.exe Install Internal.Json.FSharp -Verbosity detailed
      
      GET https://www.nuget.org/api/v2/FindPackagesById()?$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='Internal.Json.FSharp'
      GET https://artifacts.company.example.com/api/nuget/nuget/FindPackagesById()?$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='Internal.Json.FSharp'
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Internal.Json.FSharp'
      GET https://www.nuget.org/api/v2/Packages(Id='Internal.Json.FSharp',Version='1.1.42')
      GET https://www.nuget.org/api/v2/Packages(Id='Internal.Json.FSharp',Version='1.1.42.0')
      GET https://artifacts.company.example.com/api/nuget/nuget/Packages(Id='Internal.Json.FSharp',Version='1.1.42')
      Attempting to resolve dependency 'Newtonsoft.Json (= 7.0.1)'.
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'
      GET https://artifacts.company.example.com/api/nuget/nuget/FindPackagesById()?id='Newtonsoft.Json'
      Attempting to resolve dependency 'Internal.FSharp (? 2.1.61)'.
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Internal.FSharp'
      GET https://artifacts.company.example.com/api/nuget/nuget/FindPackagesById()?id='Internal.FSharp'
      GET http://artifacts.company.example.com/artifactory/api/nuget/nuget/FindPackagesById()?$skiptoken='Internal.FSharp','2.0.1-alpha165'&id='Internal.FSharp'
      WARNING: Exception has been thrown by the target of an invocation.
      System.InvalidOperationException: Unable to resolve dependency 'Internal.FSharp (? 2.1.61)'.
        at NuGet.InstallWalker.OnDependencyResolveError (NuGet.PackageDependency dependency) <0x420f0130 + 0x001c3> in <filename unknown>:0
        at NuGet.PackageWalker.Walk (IPackage package) <0x420ae560 + 0x0013b> in <filename unknown>:0
        at NuGet.InstallWalker.ResolveOperations (IPackage package) <0x420ae2a0 + 0x000df> in <filename unknown>:0
        at NuGet.PackageManager.Execute (IPackage package, IPackageOperationResolver resolver) <0x420ae0f0 + 0x0003a> in <filename unknown>:0
        at NuGet.PackageManager.InstallPackage (IPackage package, System.Runtime.Versioning.FrameworkName targetFramework, Boolean ignoreDependencies, Boolean allowPrereleaseVersions, Boolean ignoreWalkInfo) <0x420ad370 + 0x000eb> in <filename unknown>:0
        at NuGet.PackageManager.InstallPackage (IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) <0x420ad330 + 0x0002b> in <filename unknown>:0
        at NuGet.PackageManager.InstallPackage (System.String packageId, NuGet.SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) <0x420a18d0 + 0x00052> in <filename unknown>:0
        at NuGet.Commands.InstallCommand.InstallPackage (IFileSystem fileSystem, System.String packageId, NuGet.SemanticVersion version) <0x41f54dc0 + 0x001f3> in <filename unknown>:0
        at NuGet.Commands.InstallCommand.ExecuteCommand () <0x41f93970 + 0x00183> in <filename unknown>:0
        at NuGet.Commands.Command.Execute () <0x41f7bc40 + 0x0038e> in <filename unknown>:0
        at NuGet.Program.Main (System.String[] args) <0x41f36920 + 0x00636> in <filename unknown>:0
      

      When I do this, I get a corresponding WARN in my artifactory.log:

      2016-03-15 15:52:19,007 [http-nio-8081-exec-4] [WARN ] (o.a.w.s.RequestUtils:134) - Request /artifactory/api/nuget/nuget/FindPackagesById() should be a repo request and does not match any repo key
      

      I notice that it seems to be adding /artifactory in front of my API URL. I have a reverse-proxy setup eliminates this, but since its a warning - I'm unsure if its a symptom of the problem.

      If I run configure NuGet with the Remote instead of the Virtual repository, i get a 404 Not Found when it tries to download the package, which is untrue since it found it.

      > nuget Install Internal.Json.FSharp -Verbosity detailed
      
      Using credentials from config. UserName: nuget-readonly
      GET https://www.nuget.org/api/v2/FindPackagesById()?$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='Internal.Json.FSharp'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/FindPackagesById()?$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='Internal.Json.FSharp'
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Internal.Json.FSharp'
      GET https://www.nuget.org/api/v2/Packages(Id='Internal.Json.FSharp',Version='1.1.42')
      GET https://www.nuget.org/api/v2/Packages(Id='Internal.Json.FSharp',Version='1.1.42.0')
      GET https://artifacts.company.example.com/api/nuget/jet-myget/Packages(Id='Internal.Json.FSharp',Version='1.1.42')
      Attempting to resolve dependency 'Newtonsoft.Json (= 7.0.1)'.
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/FindPackagesById()?id='Newtonsoft.Json'
      Attempting to resolve dependency 'Internal.FSharp (? 2.1.61)'.
      GET https://www.nuget.org/api/v2/FindPackagesById()?id='Internal.FSharp'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/FindPackagesById()?id='Internal.FSharp'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/FindPackagesById?id='Internal.FSharp'&$skiptoken='Internal.FSharp','2.0.1-alpha188'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/FindPackagesById?id='Internal.FSharp'&$skiptoken='Internal.FSharp','2.0.289-alpha'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/FindPackagesById?id='Internal.FSharp'&$skiptoken='Internal.FSharp','2.0.395'
      GET https://artifacts.company.example.com/api/nuget/jet-myget/Download/Internal.FSharp/2.1.61
      System.Net.WebException: The remote server returned an error: (404) Not Found.
        at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) <0x40651690 + 0x001ab> in <filename unknown>:0
        at System.Net.HttpWebRequest.GetResponse () <0x4064c010 + 0x0005a> in <filename unknown>
      

      I get no logs in artifactory.log when i run it this way, but i do get this trace in the requests.log:

      20160315161226|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget|HTTP/1.0|401|0
      20160315161226|0|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget|HTTP/1.0|401|0
      20160315161226|1|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget|HTTP/1.0|200|0
      20160315161226|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/FindPackagesById()|HTTP/1.0|401|0
      20160315161227|490|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/FindPackagesById()|HTTP/1.0|200|0
      20160315161228|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/Packages(Id='Internal.Json.FSharp',Version='1.1.42')|HTTP/1.0|401|0
      20160315161228|583|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/Packages(Id='Internal.Json.FSharp',Version='1.1.42')|HTTP/1.0|200|0
      20160315161228|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/$metadata|HTTP/1.0|401|0
      20160315161229|1|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/$metadata|HTTP/1.0|200|0
      20160315161229|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/FindPackagesById()|HTTP/1.0|401|0
      20160315161229|669|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/FindPackagesById()|HTTP/1.0|200|0
      20160315161230|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/FindPackagesById()|HTTP/1.0|401|0
      20160315161231|866|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/FindPackagesById()|HTTP/1.0|200|0
      20160315161231|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/FindPackagesById|HTTP/1.0|401|0
      20160315161232|810|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/FindPackagesById|HTTP/1.0|200|0
      20160315161233|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/FindPackagesById|HTTP/1.0|401|0
      20160315161234|866|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/FindPackagesById|HTTP/1.0|200|0
      20160315161235|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/FindPackagesById|HTTP/1.0|401|0
      20160315161235|738|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/FindPackagesById|HTTP/1.0|200|0
      20160315161236|1|REQUEST|10.51.8.41|anonymous|GET|/api/nuget/myget/Download/Internal.FSharp/2.1.61|HTTP/1.0|401|0
      20160315161236|2|REQUEST|10.51.8.41|nuget-readonly|GET|/api/nuget/myget/Download/Internal.FSharp/2.1.61|HTTP/1.0|404|0
      

      Note how it gets the 200 requests - indicating that it found the requested package, but when it hits the Download endpoint it gets a 404.

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              justenwalker Justen Walker (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-9577 -
                  SYNCHRONIZED
                  • Last Sync Date: