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!

How can you let the TFS-Deploy-Task fail if a packet is rejected? (Overwrite off)



  • Hello,

    our feed is configured to reject a package with the same version. Unfortunately no error is returned with the PUSH.

    What do I have to do in order to get an error and terminate the TFS TASK?

    Pushing Datron.Jaguar.Common.TestHello.0.2.2.nupkg to 'http://ds2016tfs:8624/nuget/next-packages/'...
    2019-03-12T10:32:12.9978729Z PUT http://ds2016tfs:8624/nuget/next-packages/
    2019-03-12T10:32:13.0981037Z Created http://ds2016tfs:8624/nuget/next-packages/ 100ms
    2019-03-12T10:32:13.1009196Z Your package was pushed.

    Many thanks
    Alexander

    Product: ProGet
    Version: 5.1.23



  • If the ProGet version you listed (5.1.23) is accurate, it should already just work. ProGet will send a 403 if the user performing the push does not have overwrite permission, which I would assume fail the task.

    Is it possible you are authenticating with a different user, or that Anonymous has overwrite privileges?



  • I have checked the version and the privileges. The publishing task is using the Publish User. None of the user have overwrote permissions.

    Have you some other suggestions?

    Do we need a newer nuget version ? We use currently 4.1.0.2450

    ![Image Text](C:\Users\aFamularo\Desktop\Publish privileges.png)
    ![Image Text](C:\Users\aFamularo\Desktop\Anonymous privileges.png)
    ![Image Text](C:\Users\aFamularo\Desktop\admin privileges.png)

    Protokoll:
    ******************************************************************************
    Starting: NuGet push
    ******************************************************************************
    ==============================================================================
    Task         : NuGet
    Description  : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
    Version      : 2.0.24
    Author       : Microsoft Corporation
    Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
    ==============================================================================
    Found tool in cache: NuGet 4.1.0 x64
    Found tool in cache: NuGet 4.1.0 x64
    Resolved from tool cache: 4.1.0
    Using version: 4.1.0
    Found tool in cache: NuGet 4.1.0 x64
    C:\Windows\system32\chcp.com 65001
    Active code page: 65001
    SYSTEMVSSCONNECTION exists true
    Detected NuGet version 4.1.0.2450 / 4.1.0
    9b4f1acd-fe90-40ea-8c4c-3d67f8dac43a exists true
    Saving NuGet.config to a temporary config file.
    E:\Agents\1\_work\_tool\NuGet\4.1.0\x64\nuget.exe sources Add -NonInteractive -Name httpalmswent8624nugetnextpackages -Source http://almswent:8624/nuget/next-packages/ -ConfigFile E:\Agents\1\_work\23\Nuget\tempNuGet_40310.config
    Package Source with Name: httpalmswent8624nugetnextpackages added successfully.
    Saving NuGet.config to a temporary config file.
    Using authentication information for the following URI: http://almswent:8624/nuget/next-packages/
    E:\Agents\1\_work\_tool\NuGet\4.1.0\x64\nuget.exe setapikey *** -NonInteractive -Source httpalmswent8624nugetnextpackages -ConfigFile E:\Agents\1\_work\23\Nuget\tempNuGet_40310.config
    The API Key '***' was saved for 'http://almswent:8624/nuget/next-packages/'.
    E:\Agents\1\_work\_tool\NuGet\4.1.0\x64\nuget.exe push E:\Agents\1\_work\23\b\NuGetPackages\Datron.Jaguar.Common.TestHello.0.2.2.nupkg -NonInteractive -Source http://almswent:8624/nuget/next-packages/ -ApiKey *** -ConfigFile E:\Agents\1\_work\23\Nuget\tempNuGet_40310.config -Verbosity Detailed
    NuGet Version: 4.1.0.2450
    Pushing Datron.Jaguar.Common.TestHello.0.2.2.nupkg to 'http://almswent:8624/nuget/next-packages/'...
      PUT http://almswent:8624/nuget/next-packages/
      Created http://almswent:8624/nuget/next-packages/ 79ms
    Your package was pushed.
    ******************************************************************************
    


  • I found my mistake I had to specify the "Feed API user" in the API Key configuration.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation