Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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!

    Nuget push fails when Proget is running on linux and nuget client is >= 3.5

    Scheduled Pinned Locked Moved Support
    linuxprogetnuget
    4 Posts 1 Posters 43 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      The command:

      .\nuget.3.5.exe push  .\test.1.0.0.nupkg -Source http://myserver/nuget/nuget-all -apikey progetkey -verbosity detailed
      

      Fails with error:

      NuGet Version: 3.5.0.1938
      Pushing test.1.0.0.nupkg to 'http://myserver/nuget/nuget-all'...
       PUT http://myserver/nuget/nuget-all/
       BadRequest http://myserver/nuget/nuget-all/ 52ms
      System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
        at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c.<PushPackageToServer>b__19_1(HttpResponseMessage response)
        at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__14`1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageToServer>d__19.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageCore>d__13.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackage>d__12.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<Push>d__8.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Commands.PushRunner.<Run>d__0.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__28.MoveNext()
        --- End of inner exception stack trace ---
        at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
        at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
        at NuGet.CommandLine.Command.Execute()
        at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
      ---> (Inner Exception #0) System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
        at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c.<PushPackageToServer>b__19_1(HttpResponseMessage response)
        at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__14`1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageToServer>d__19.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageCore>d__13.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackage>d__12.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Protocol.Core.Types.PackageUpdateResource.<Push>d__8.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.Commands.PushRunner.<Run>d__0.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__28.MoveNext()<---
      

      Whereas the command:

       .\nuget.3.4.exe push .\test.1.0.0.nupkg -Source http://myserver/nuget/nuget-all -apikey progetkey -verbosity detailed
      

      Succeeds with message:

      Pushing test.1.0.0.nupkg to 'http://myserver/nuget/nuget-all'...
        PUT http://myserver/nuget/nuget-all/
        Created http://myserver/nuget/nuget-all/ 89ms
      Your package was pushed.
      

      By using fiddler, the response from the server is:

      X-UA-Compatible: IE=edge
      X-ProGet-Version: 4.7.11.7
      X-AspNet-Version: 4.0.30319
      Cache-Control: private
      Content-Type: text/html
      Server: Mono-HTTPAPI/1.0
      Date: Thu, 25 May 2017 17:33:48 GMT
      Content-Length: 34
      Connection: close
      
      There must be exactly one package.
      

      There are no issues when proget is run on windows.

      Product: ProGet
      Version: 4.7.11

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        We've investigated this a bit further, and have determined that it's a bug in .NET on Linux (Mono), specifically in the way chunked input streams are handled.

        It's not remotely trivial to debug, and it usually takes a long time to get a fix/pull/etc accepted. So, the workaround is to use an older NuGet client or just do regular HTTP Push.

        I've logged PG-1042 in the mean time to investigate. We will be considering a move to DNC at some point.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          This is successfully worked around by putting an nginx wrapper in front of proget

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Hey

            Thanks for the pointer to the nginx fix, works a treat.

            Here is my docker-compose setup for anyone looking for a quick and great fix...

            version: '3'
            services:
              proget-web:
                image: inedo/proget:latest
                ports:
                  - "888:80"
                hostname: proget-web
                restart: always
                volumes:
                  - "/var/proget/extensions:/var.progetextensions"
                  - "/var/proget/packages:/var/proget/packages"
                depends_on:
                  - proget-postgres
                expose:
                  - "888"
              proget-postgres:
                image: postgres:9.5
                restart: always
                volumes:
                  - "/etc/localtime:/etc/localtime:ro"
                  - "/var/proget/db:/var/lib/postgresql/data"
              proxy:
                image: nginx:1.11
                ports:
                  - "2345:2345"
                volumes:
                  - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
                depends_on:
                  - proget-web
            
            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation