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



  • 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


  • inedo-engineer

    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.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation