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 sometimes fails

    Scheduled Pinned Locked Moved Support
    nugetproget
    2 Posts 2 Posters 24 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.
    • J Offline
      jaroslav.malec_8365
      last edited by

      We regularly push to our Proget from CI jobs. As a transient failure flags the job as failed, it is less trivial to overcome than if run from a keyboard.

      Happens in about 3-10% of cases.

      • On Debian
      • In Docker
      • With Postgres in a separate container

      Logs are empty AFAIK. (In case some should be present, I'd like to know where)


      Redacted CI output:

      Running with gitlab-runner 11.7.0 (8bb608ff)
        on BlackieTestServer 4eafc0bc
      Using Shell executor...
      Running on BLACKIEMACHINE...
      Cloning repository...
      Cloning into 'C:/Users/Blackie/builds/4eafc0bc/0/#####/#####/#####-hardware'...
      Checking out 69d3afdf as master...
      Skipping Git submodules setup
      $ Set-ExecutionPolicy Unrestricted -Scope Process
      $ ci/Add-NugetConfig.ps1
      $ dotnet pack #####.#####.Hardware\#####.#####.Hardware.csproj
      Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
      Copyright (C) Microsoft Corporation. All rights reserved.
      
        Restoring packages for C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-hardware\#####.#####.Hardware\#####.#####.Hardware.csproj...
        Generating MSBuild file C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-hardware\#####.#####.Hardware\obj\#####.#####.Hardware.csproj.nuget.g.props.
        Generating MSBuild file C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-hardware\#####.#####.Hardware\obj\#####.#####.Hardware.csproj.nuget.g.targets.
        Restore completed in 516.99 ms for C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-Hardware\#####.#####.Hardware\#####.#####.Hardware.csproj.
        #####.#####.Hardware -> C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-hardware\#####.#####.Hardware\bin\Debug\netstandard2.0\#####.#####.Hardware.dll
        #####.#####.Hardware -> C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-hardware\#####.#####.Hardware\bin\Debug\net471\#####.#####.Hardware.dll
        Successfully created package 'C:\Users\Blackie\builds\4eafc0bc\0\#####\#####\#####-hardware\#####.#####.Hardware\bin\Debug\#####.#####.Hardware.0.3.0.nupkg'.
      $ dotnet nuget push -k $Env:NUGET_SOURCE_APIKEY -s $Env:NUGET_SOURCE_URL #####.#####.Hardware\bin\Debug\#####.#####.Hardware*.nupkg
      info : Pushing #####.#####.Hardware.0.3.0.nupkg to 'https://proget.#####.cz/nuget/Nuget/'...
      info :   PUT https://proget.#####.cz/nuget/Nuget/
      info :   BadRequest https://proget.#####.cz/nuget/Nuget/ 205ms
      error: Response status code does not indicate success: 400 (There must be exactly one package.).
      ERROR: Job failed: exit status 1
      

      A subsequent run succeeds with:

      $ dotnet nuget push -k $Env:NUGET_SOURCE_APIKEY -s $Env:NUGET_SOURCE_URL #####.#####.Hardware\bin\Debug\#####.#####.Hardware*.nupkg
      info : Pushing #####.#####.Hardware.0.3.0.nupkg to 'https://proget.#####.cz/nuget/Nuget/'...
      info :   PUT https://proget.#####.cz/nuget/Nuget/
      info :   Created https://proget.#####.cz/nuget/Nuget/ 360ms
      info : Your package was pushed.
      Job succeeded
      

      Product: ProGet
      Version: 5.1.23

      1 Reply Last reply Reply Quote 0
      • jjonesJ Offline
        jjones inedo-engineer
        last edited by

        The error message you are getting (There must be exactly one package.) is essentially saying the file that you are trying to push doesn't exist. And since I can see that the file is created in the previous pack command, My thought is that file creation is not fully complete or the file is still in use by the pack command. I am thinking it might be useful to add a Start-Sleep -s 5 command between the pack and push commands.

        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