TFS - 409 Conflict during package upload

2.9k views Asked by At

I have an issue with TFS (version 15.105.25910.0) during nuget's package upload:

    ******************************************************************************
Starting task: NuGet Publisher
******************************************************************************
Set workingFolder to default: C:\BuildSystem\TfsAgent\tasks\NuGetPublisher\0.2.21
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 3.3.0.212 / 3.3.0
SYSTEMVSSCONNECTION exists true
C:\BuildSystem\TfsAgent\tasks\NuGetPublisher\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe push -NonInteractive C:\BuildSystem\TfsAgent\_work\6\s\myfolderPackage\bin\Release\mypackage.1.16.1905.nupkg -Source HunextPackages -ApiKey VSTS
Pushing mypackage 1.16.1905 to 'https://mytfsurl.com:444/tfs/DefaultCollection/_packaging/9ebd459f-9a02-456e-9243-c8d0f989c871/nuget/v2/'...
Failed to process request. 'Conflict'. 
The remote server returned an error: (409) Conflict..
Error: C:\BuildSystem\TfsAgent\tasks\NuGetPublisher\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
Packages failed to publish
******************************************************************************
Finishing task: NuGetPublisher
******************************************************************************
System.Exception: Task NuGetPublisher failed. This caused the job to fail. Look at the logs for the task for more details.
at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource)
Worker Worker-bbe2b68d-3dfb-4b56-8546-bc2935a3ffe1 finished running job bbe2b68d-3dfb-4b56-8546-bc2935a3ffe1
******************************************************************************
Finishing Build
******************************************************************************

I use package management on TFS and remote server returned 409 conflict, but in the list of packages I do not see my "mypackage 01.16.1905". Where's physically stored the package? Thanks.

1

There are 1 answers

6
PatrickLu-MSFT On

For trouble shooting, your could try to run it manually in an ordinary PowerShell console instead of running it in a build step.

And according to your log, Looks like you are using nuget 3.3. Try to use nuget 3.5 or higher to use the TFS Packaging feature due to some auth fixes that went into 3.5. You'll find the version toggle inside the Nuget task options in your build definition.

Try to update to 3.5 to see if you still have problems. Also make sure you don't have any auth issue which nuget could use the creds to send to the server.


Update

It's not possible to overwrite existing packages on TFS. Nuget.exe allows wildcards for push, so you could use nuget push *.nupkg -Source ....For this , it will publish the latest version.