1

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.

cirio
  • 11
  • 1
  • 4
  • Are you uploading the same version package? – Eddie Chen - MSFT Jan 12 '17 at 08:40
  • yes @Eddie-MSFT is the same version of package. I ran sql server profiler during the uploading and i get the tables used as storage, but the operating logic is very complex for me. have you any idea? Thanks – cirio Jan 20 '17 at 10:37

1 Answers1

0

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.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • I tried to update nuget console application with this version https://dist.nuget.org/win-x86-commandline/v3.5.0/NuGet.exe but i have the same problem locally. It could be due to "immutability of packages"? https://www.visualstudio.com/it-it/docs/package/feeds/immutability. Thanks – cirio Jan 10 '17 at 09:01
  • Yes, this should be the root cause. Since you have the same problem locally. As the link said nuget will keep a local cache of packages on your machine. Once a client has cached a particular package@version, it will return that copy on future install/restore requests. – PatrickLu-MSFT Jan 10 '17 at 09:57
  • 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. – PatrickLu-MSFT Jan 10 '17 at 10:00
  • Ok, is not possible overwrite existing packages on cloud(VSTS), but with TFS on-premise i could access Any part of my system(DB,cache ecc). Where's stored the list of packages uploaded to TFS? thank you very much for your assistance. – cirio Jan 11 '17 at 07:36
  • @cirio I think package uploaded to TFS should store in somewhere of the DB. It shouldn't be stored in a cache folder or file system on the server. For example, if you migrated the database, the package will definitely not be lost. As for what's the specific path in the DB stored the package,sorry, I'm not sure either. – PatrickLu-MSFT Jan 11 '17 at 08:07
  • as indicated by @Patrick-MSFT someone knows where packages are stored on the TFS database? – cirio Jan 12 '17 at 07:24